Commit Graph

66 Commits

Author SHA1 Message Date
Tobias Bosch 7bc282d15e feat(viewport): add initial integration test for template directives 2014-12-01 16:39:37 -08:00
Tobias Bosch 0758165fb5 fix(compiler): allow identifiers with `-` in the template bindings as keys. 2014-12-01 16:39:36 -08:00
Tobias Bosch 63053438ea fix(compiler): always wrap views into an own `<template>` element
This is needed to allow view instantiation also in browsers that
don’t support the `<template>` element and because of this would
return elements from the content of `<template>` elements when
using `element.querySelectorAll`.

Also stores the `elementBinder.nestedProtoView` correctly
when a template directive was used on a `<template>` element.
2014-12-01 16:39:36 -08:00
Victor Berchet 0703ee526c fix(Dart1.8): fix analyzer warnings 2014-12-01 21:17:16 +01:00
vsavkin 6f889e3094 feat(di): add OpaqueToken to DI
Using `new Object()` as a token causes cryptic errors. OpaqueToken class should be used instead.
2014-11-26 12:52:16 -08:00
Rado Kirov c6f14dd833 feat(viewPort): adds initial implementation of ViewPort.
ViewPort is the mechanism backing @Template directives. Those
directives can use the viewport to dynamically create, attach and
detach views.
2014-11-25 16:19:50 -08:00
vsavkin bfd3c2d5a9 fix(reflection): update pubspec.yaml to add a missing dependency on reflection 2014-11-24 18:03:26 -08:00
vsavkin 6e8175a816 feat(Reflection): extract reflection capabilities into a separate module 2014-11-24 16:53:12 -08:00
Misko Hevery 044625a098 chore: Make field declarations explicit
This used to be valid code:

```
class Foo {
  constructor() {
    this.bar = ‘string’;
  }
}
```

This will now fail since ‘bar’ is not explicitly
defined as a field. We now have to write:

```
class Foo {
  bar:string; // << REQUIRED
  constructor() {
    this.bar = ‘string’;
  }
}
```
2014-11-24 16:35:39 -08:00
vsavkin 2980eb5b0b refactor(ChangeDetector): rename WatchGroup into RecordRange 2014-11-20 10:24:18 -08:00
Tobias Bosch fc5b7edca4 feat(compiler): support `on-` and `[]` 2014-11-19 16:24:12 -08:00
Tobias Bosch c6846f1163 feat(compiler): new semantics for `template` attributes and view variables.
- Supports `<div template=“…”>`, including parsing the expressions within
  the attribute.
- Supports `<template let-ng-repeat=“rows”>`
- Adds attribute interpolation (was missing previously)
2014-11-19 14:32:15 -08:00
Rado Kirov d6193e9073 feat(examples): adds hello-world app.
The app is writen in ES6 and transpiles to ES5 and dart as part of the
usual build.

The app contains a component, a directive and a services wired together
through dependency injection.

Before Each:
- gulp build

For es5:
- gulp serve
- open 'localhost:8000/js/examples/lib/hello_world/'

For dart:
- gulp examples/pub.serve
- open 'localhost:8080'
2014-11-19 12:24:14 -08:00
Rado Kirov 1221857d17 feat(bootstraping): application bootstrapping implementation.
Entry-point to bootstrapping is a rootComponent. The bootstrapping
method, uses the component's selector to find the insertion element in
the DOM, and attaches the component in its ShadowRoot.
2014-11-18 15:02:38 -08:00
vsavkin f0d6464856 feat(ChangeDetector): change View to construct a WatchGroup hierarchy 2014-11-17 17:49:17 -08:00
Tobias Bosch b2ecdb5da7 fix(compiler): use parentheses around expressions and escape quotes 2014-11-17 17:47:50 -08:00
Tobias Bosch 03882dcccc refactor(ElementInjector): remove stale file and make StaticKeys private 2014-11-17 17:44:39 -08:00
Rado Kirov be4cb2db3a feat(view): add support for instantiation of nested component views.
Include shadowDom creation and integration tests for nested components.

Fix accidentally clobbered modules/core/test/compiler/view_spec.js by
previous commit.
2014-11-14 16:09:36 -08:00
Tobias Bosch b07ea6b90e feat(compiler): add benchmarks
- compileEmptyTemplate
- compile25ElementsNoBindings
- compile25ElementsWithBindings

For the results see the PR #197.

Closes #197
2014-11-14 14:25:02 -08:00
vsavkin d7208b8429 feat(ElementInjector): add NgElement 2014-11-14 13:22:39 -08:00
vsavkin ac8351b7bc feat(ElementInjector): change ElementInjector so @parent and @ancestor do not include self. 2014-11-14 13:18:39 -08:00
vsavkin e15bcf0ffd refactor(ChangeDetector): pass formatters when instantiating a watch group 2014-11-14 13:16:55 -08:00
vsavkin 03410850b4 feat(change_detector): cleanup 2014-11-14 13:16:55 -08:00
vsavkin dcd905ae85 feat(change_detector): add support for formatters 2014-11-14 13:16:55 -08:00
vsavkin 79a9430f2c feat(change_detection): add support for binary operations and literals 2014-11-14 13:16:55 -08:00
Rado Kirov b8e3617a1d refactor(annotations): replace Module functions with plain lists.
Renames:
elementServices -> shadowDomServices.
2014-11-14 13:03:24 -08:00
Tobias Bosch 1b79c91320 fix(compiler, view): centralize TemplateElement checks and fix inconsistencies
Fixes #189
Closes #194
2014-11-14 11:04:18 -08:00
Tobias Bosch 5e0ff2cbb7 refactor(ElementBinder): Store componentDirective and templateDirective as well. 2014-11-13 17:36:45 -08:00
Tobias Bosch 7308a3acc7 refactor(ElementInjector): support components
- Allow to access containing component directive instance from the shadow DOM.
- Allow to access app services of the app level injector of the component
  when the component is instantiated.
2014-11-13 17:32:52 -08:00
Tobias Bosch 7a70f8f92d feat(compiler): initial version of the compiler.
Supports:
- binds text nodes, element properties and directive properties
- locates decorator, component and template directives.
- inline templates of components

The compiler is built using a pipeline design,
see core/src/compiler/pipeline package.

Integration tests to show how the compiler, change_detection and DI work
together:
core/test/compiler/integration_spec.js
2014-11-11 17:55:50 -08:00
vsavkin 9448d78aa8 refactor(ProtoElementInjector): change `instantiate` to take positional args 2014-11-06 10:13:07 -08:00
vsavkin b5f6417635 refactor(ElementInjector): use `index` instead of the `elementInjector` field to instantiate element injectors 2014-11-06 10:03:20 -08:00
vsavkin 693489ce38 refactor(Parser): cleanup 2014-11-06 09:11:13 -08:00
vsavkin 8cc008bda1 feat(Parser): add support for assignments 2014-11-06 09:11:13 -08:00
Victor Berchet 0a766f4654 feat(Change Detection): Implement map changes 2014-11-05 14:02:03 -08:00
Rado Kirov 965fa1a985 feat(parser): adds basic expressions to the parser.
Mostly copy pasta from angular.dart.

Remove GetterFactory in favor for ClosureMap (which has basically the same
implementation).
2014-10-31 14:32:12 -07:00
Rado Kirov 8c566dcfb5 feat(elementBinder): introduce element binder.
It is a plain-old-data class to seperate the protoInjector from the
textNodes and elementBinding data.
2014-10-30 14:59:32 -07:00
Rado Kirov 91f50b67b7 feat(view): hook watch group instantiation in the view. 2014-10-29 17:04:56 -07:00
vsavkin acd7035347 feat(test_lib): change test_lib.dart to structurally compare objects 2014-10-29 18:25:32 -04:00
vsavkin 9bd65abb32 feat(ElementInjector): throw when encounter a cyclic dependency 2014-10-29 17:52:51 -04:00
Rado Kirov b0c9d05ea7 feat(view): add onChange implementation to view. 2014-10-29 13:32:20 -07:00
Tobias Bosch 08d4a37c06 feat(selector): initial version of the selector 2014-10-28 14:46:55 -07:00
vsavkin e3b772425e feat(ElementInjector): change ElementInjector to accept bindings or types 2014-10-27 17:56:05 -04:00
vsavkin 31831eee5e feat(View): implement ProtoView.instantiate 2014-10-27 17:18:35 -04:00
vsavkin 79d270c3dd feat(ElementInjector): add support for "special" objects 2014-10-27 14:14:56 -04:00
vsavkin e3548b497f feat(ElementInjector): implement ElementInjector 2014-10-27 10:16:50 -04:00
vsavkin 1a7d5160f2 use Promise instead of Future 2014-10-12 17:47:52 -04:00
vsavkin b71cd9f380 refactor(di): use boolean instead of bool 2014-10-12 17:15:58 -04:00
Misko Hevery a9896ed391 design: view instantiation test 2014-10-10 20:54:33 -07:00
Victor Berchet 5527a1b1a4 feature(change detection): implement barebone ChangeDetector
fixes #39
2014-10-08 11:11:56 +02:00