412 Commits

Author SHA1 Message Date
Brian Ford
84dc6ae76b fix(test_lib): spy funcs should match null arguments 2015-05-08 13:51:43 -07:00
Tim Blasi
200e190f70 fix(dart/transform): Handle hostAttributes in DirectiveMetadata
Handle `hostAttributes` in the transformer.
`hostAttributes` was introduced in 51839ca6772ed5e033c71118ce1dc78cc990246d

Closes #1742
2015-05-08 11:19:11 -07:00
Tim Blasi
44f829dbc6 feat(dart/transform): Use the render Compiler and the DirectiveParser
Update the `TemplateCompile` step to use the full render `Compiler`.

Provide `DirectiveMetadata` for `ViewDefinition` objects and use it to
run the `DirectiveParser` step of the render compile pipeline.
2015-05-08 11:18:40 -07:00
vsavkin
d717529e9a fix(change_detection): updated dynamic change detector not to mutate when throwing
Closes #1762
2015-05-08 10:46:08 -07:00
Tobias Bosch
c68fa27444 refactor(render): remove recursion from renderer
The goal is to make implementing a renderer straight forward.

BREAKING_CHANGE:

- Renderer interface was redone / simplified.
- `DirectDomRenderer` was replaced by `DomRenderer`.
- `DirectDomRenderer.setImperativeComponentRootNodes` is replaced
  by the following 2 steps:
    1. `ViewManager.getComponentView(elementRef) -> ViewRef`
    2. `DomRenderer.setComponentViewRootNodes(viewRef, rootNodes)`
- all `@View` annotations need to have a template, but the template
  may be empty. Previously views that had a `renderer` property did
  not have to have a `template`.
- `dynamicComponentLoader.loadIntoNewLocation` does no more allow
  to pass an element, but requires a css selector.
  Special syntax: `:document` can be used as prefix to search globally
  on the document instead of in the provided parent view.

Part of #1675
2015-05-08 09:37:41 -07:00
Martin Probst
4ce0d5e024 fix(dart): Remove unused imports.
These imports cause dart analyze errors once ts2dart removes the
IMPLEMENTS import.
2015-05-08 15:24:37 +02:00
Pawel Kozlowski
51839ca677 feat(compiler): allow setting attributes on a host element
Closes #1402
2015-05-08 14:22:07 +02:00
vsavkin
fa28b28d0a build(typescript): Migrated change detection to typescript 2015-05-07 17:18:04 -07:00
Jacob MacDonald
0e2047f9ca chore(benchmarks): add transform benchmark runner and clean up benchmark output 2015-05-07 10:36:04 -07:00
vsavkin
cb87fa0970 chore(build): migrated di to TypeScript 2015-05-06 19:00:56 -07:00
Tim Blasi
c8ebd11d63 feat(dart/transform): Generate DirectiveMetadata for exports
For all files that export another library, include `DirectiveMetadata`
for the exported library in that file's associated `ng_meta.json` file.
2015-05-06 17:17:04 -07:00
Rado Kirov
be7504d451 fix(decorators): fixes decorator reflection.
The bug appears when there are only type annotations without parameter
annotations.
2015-05-06 13:44:44 -07:00
Tobias Bosch
abc3de7efe refactor(render): rename RenderView and RenderProtoView
Part of #1675
Closes #1705
2015-05-06 11:46:52 -07:00
Tobias Bosch
0856516ae9 refactor(renderer): separate compiler from renderer
Part of #1675
Closes #1702
2015-05-06 10:50:15 -07:00
Rado Kirov
c9cec60007 fix(router): fix for leading slash in dart
Using string1 === string2 translates to identical(string1, string2) in
dart, which is incorrect as it is possilbe for dart strings to have
different reference.
2015-05-05 15:19:06 -07:00
Tim Blasi
0520ca68b4 feat(dart/transform): Add DirectiveMetadataExtractor transform step
Add a step that reads `DirectiveMetadata` object off annotated classes
into `.ng_meta.dart` files. These will be used by the `TemplateCompiler`
step as inputs to the Angular 2 render compiler.

Update one test to avoid unsupported functionality, format others.
2015-05-05 12:07:50 -07:00
Brian Ford
75da6e4c4a feat(router): export decorator version of RouteConfig 2015-05-04 15:44:16 -07:00
Jacob MacDonald
1864f60afb feat(benchmarks): Add basic dart transformer benchmarks.
Adds simple benchmarks for various transformation phases, as well as hello_world.
Does not integrate these into any benchmark frameworks yet.
2015-05-04 14:03:58 -07:00
Rado Kirov
457c15cd6c feat(decorators): adds decorator versions of DI annotations.
In 'angular2/di' the symbol:
- Inject is a decorator
- InjectAnnotation is an annotation

Internally one an get a hold of annotations without *Annotations appened
(to make ts2dart work without workarounds) by importing from
'angular2/src/di/annotations_impl' instead of 'angular2/di'. This is
needed only for users that transpile through TS and through ts2dart.
2015-05-04 13:35:09 -07:00
Brian Ford
28feac9411 refactor(router): rename "alias" to "as" 2015-05-03 20:37:00 -07:00
Brian Ford
9153331303 feat(router): route redirects 2015-05-03 20:37:00 -07:00
Brian Ford
9d5c33f9dd feat(router): sibling outlets 2015-05-03 20:26:47 -07:00
Brian Ford
68ed8f1b6b refactor(router): rename LocationMock to LocationSpy 2015-05-01 16:41:25 -07:00
Brian Ford
46ad3552c7 fix(router): infer top-level routing from app component
Closes #1600
2015-05-01 16:41:25 -07:00
Brian Ford
4965226f3f fix(router): use lists for RouteConfig annotations 2015-05-01 15:55:53 -07:00
Brian Ford
ea546f5069 feat(router): add location service 2015-05-01 15:55:53 -07:00
vsavkin
ce6a2ba836 refactor(view): moved the logic from ProtoView to ProtoViewFactory 2015-05-01 13:35:17 -07:00
Alex Eagle
3c77855b39 chore(build): Remove .es6 files which shadow .ts files.
This removes .es6 files which are pure duplicates of a
.ts file in the same folder.
Next we need to remove .js files as well, and remove karma preprocessors for dart.
2015-05-01 09:51:03 -07:00
vsavkin
c1579222bd fix(view): changed view manager to hydrate change detector after creating directives 2015-04-30 22:01:55 -07:00
Rado Kirov
f863ea0db5 feat(decorators): adds support for parameter decorators.
Paramater decorators expect to be called as currently implemented by TS.
2015-04-30 18:42:40 -07:00
Tobias Bosch
9e8d31d532 fix(compiler): clone templates before compiling them
This is needed as the compiler changes templates during compilation
and we are caching templates in the `TemplateLoader`.

Closes #1058
2015-04-30 16:40:57 -07:00
Tobias Bosch
f75a50c1dd refactor(compiler): rename decorator directives into directive
BREAKING CHANGE:
Previously, `Directive` was the abstract base class of several directives.
Now, `Directive` is the former `Decorator`, and `Component` inherits from it.
2015-04-30 13:38:40 -07:00
Tobias Bosch
8faf6364dc refactor(core): remove DynamicComponent
BREAKING CHANGE:
A dynamic component is just a component that has no @View annotation…
2015-04-30 09:17:25 -07:00
Tobias Bosch
3aac2fefd7 refactor(compiler): remove Viewport directives, use Decorator instead
BREAKING_CHANGE:
- The special type of `Viewport` directives is removed
  in favor of a more general `Decorator` directive
- `ViewContainerRef` now no more has a default `ProtoViewRef`
  but requires an explicit one when creating views.

Closes #1536
2015-04-29 15:59:55 -07:00
Rado Kirov
fb67e37339 feat(decorators): adds decorators to be used by TS and Babel transpiled apps. 2015-04-29 15:13:25 -07:00
Tim Blasi
648c514c28 feat(dart/transform): Add directiveMetadata{To,From}Map
Add utility methods to convert `render.dom.DirectiveMetadata` to and
from maps. This will allow saving and restoring `DirectiveMetadata` in
the Angular 2 Transformer.

We discussed adding this as a member on `DirectiveMetadata`. Since this
is not necessary for anything except the Transformer, we decided to put
it into a separate file to avoid shipping it with the Angular 2 core
code.
2015-04-29 14:22:08 -07:00
Tobias Bosch
09f8d8f7ba refactor(core): introduce ViewRef and ProtoViewRef
BREAKING CHANGES:
- `NgElement` merged into `ElementRef`
- `Compiler.compile…` returns `ProtoViewRef`
- `ViewContainer` uses `ProtoViewRef`s and `ViewRef`s.
- `ViewRef`/`ProtoViewRef` in renderer were renamed to
  `RenderViewRef`/`RenderProtoViewRef`.

Related to #1477
Closes #1592
2015-04-29 14:03:38 -07:00
vsavkin
e3c11045bf fix(compiler): changed the compiler to set up event listeners and host properties on host view elements
Closes #1584
2015-04-29 05:27:45 +00:00
Pawel Kozlowski
ee1b574baf fix(di): improve error messages for invalid bindings
Fixes #1515

Closes #1573
2015-04-28 23:42:36 +00:00
Matteo Suppo
d4925b61ff fix(change_detector): ensure that locals are only used when implicit receiver
closes #1542
2015-04-28 23:40:22 +00:00
vsavkin
e4586249fa refactor(change_detection): removed NO_CHANGED and replaced it with WrappedValue 2015-04-28 23:37:09 +00:00
Matthew Hill
3d62546314 fix(compiler): only sets viewDefinition absUrl if the view has either a template or templateUrl
fixes #1326
closes #1327
2015-04-28 15:40:07 -07:00
Tobias Bosch
a801da6f7c fix(ViewManager): dehydrate views recursively over ViewContainers
Closes #1560
2015-04-27 17:39:20 -07:00
Tobias Bosch
6fcd3709cf fix(render): return views when destroyed in ViewContainer
Closes #1316
2015-04-27 17:39:09 -07:00
Brian Ford
1b2754dacd feat(router): add initial implementation 2015-04-27 17:15:58 -07:00
Tim Blasi
15376a6d24 feat(dart/transform): Dedup getters, setters, & methods
Dedup the getters, setters, and methods generated by the transformer
when compiling a template.

Run `dartformat` over the transform code.
2015-04-27 17:04:31 -07:00
Tim Blasi
99fdb9ac41 fix(dart/transform): Use var instead of bool in generated files
If a source file hides `bool` (explicitly or implicitly via `show`), a
generated file using `bool` may not resolve.

Closes #1455
2015-04-27 14:23:24 -07:00
Tobias Bosch
6dece68bb8 refactor(core): rename ViewContainer to ViewContainerRef
This also renames InternalAppViewContainer into AppViewContainer

Related to #1477
Closes #1554
2015-04-27 10:12:21 -07:00
Tobias Bosch
bfa381b35a refactor(view): introduce AppViewManager to consolidate logic
AppViewManager is the single entry point to changing the view hierarchy.
It is split between the manager itself which does coordination and
helper methods, so both are easily testable in isolation.

Also, ViewContainer is now only a pure reference to a bound element
with the previous functionality but does not contain the list of views
any more.

Part of #1477
2015-04-24 20:26:18 -07:00
Tobias Bosch
f78406392b fix(test_lib): support multi matches with deep equality for function calls 2015-04-24 17:53:41 -07:00