Commit Graph

469 Commits

Author SHA1 Message Date
Tim Blasi d5195d4097 test(change detect): Port Locals tests to pregenerated cds
Move existing unit tests exercising Locals to also test Dart's
pre-generated change detectors.

See #502
2015-06-08 13:27:11 -07:00
Victor Berchet 4d338a4f5c test(ElementInjector): test that hostInjector has priority over viewInjector 2015-06-08 20:34:44 +02:00
Victor Berchet 6a6b43de07 feat(ElementInjector): throw if multiple directives define the same host injectable
relates to #2015
2015-06-08 20:34:44 +02:00
Victor Berchet 309ef0f354 refactor(test): remove explicit calls to flushMicrotasks()
flushMicrotasks() is now called at after the fakeAsync callback returns,
see https://github.com/angular/angular/pull/2290
2015-06-08 20:30:49 +02:00
Tim Blasi 81fc657356 refactor(change detect): Remove unnecessary param from tests 2015-06-08 11:21:45 -07:00
Victor Berchet 29c72abcc4 feat(Events): allow a different event vs field name
closes #2272
closes #2344
2015-06-08 19:29:49 +02:00
Tim Blasi d1b35f9174 fix(dart/transform): Don't set ReflectionCapabilities over an async gap
Update the transformer's `TemplateCompiler` phase to avoid setting
`reflector.reflectionCapabilities`, allowing asynchronous
operations, and restoring the original value, which allows
`reflector.reflectionCapabilities` to get into a bad state.
2015-06-06 17:10:06 -07:00
Misko Hevery a418397174 fix: corrected var/# parsing in template
Closes #2084
2015-06-05 16:22:41 -07:00
Misko Hevery 8d081ea7af fix: include error message in the stack trace 2015-06-05 16:22:41 -07:00
Tobias Bosch 8a52375fb8 chore(transformer): add tests for property bindings and multiple executions 2015-06-05 13:11:24 -07:00
Tobias Bosch 87b3b718e3 refactor(render): don’t use a global cache for property setters
Related to #2359
2015-06-05 13:11:23 -07:00
Tim Blasi 529805508a feat(dart/change_detect): Add type to ChangeDetector context
Add a type for the `context` field in Dart's pre-generated change
detectors. This requires slight changes to set the dehydrated value of
`context` to `null` rather than `ChangeDetectionUtil.uninitialized()`,
which was its former dehydrated state.

Mirror these chagnes as closely as possible in the
`ChangeDetectionJITGenerator` to allow easier maintenance.

Closes #2070
2015-06-05 12:53:25 -07:00
Tim Blasi 851797aecb refactor(dart): Run dartfmt 0.1.8
Format Dart code using dartfmt 0.1.8. Update pubspec to require
dart_style 0.1.8.
2015-06-05 11:45:36 -07:00
Tim Blasi dc6e7eb19b feat(dart/transform): Record Type interfaces
To support interface-based lifecycle methods (#2220), we need to be able
to query for the `interface`s a class supports. Record implemented
interfaces to allow mirror-less querying at runtime.

Closes #2204
2015-06-04 15:02:12 -07:00
vsavkin e5419febe4 feat(transformers): updated transformers 2015-06-04 14:14:03 -07:00
vsavkin 69b75b7fd8 feat(view): added support for exportAs, so any directive can be assigned to a variable 2015-06-04 14:14:03 -07:00
Tobias Bosch 827841ec5b refactor(render): add `DomElement`
Replaces the multiple arrays of `DomView`
by a single array with `DomElement`s.

Note: this commit does not show a performance regression
(tested against the tree benchmark locally).
2015-06-04 11:44:26 -07:00
Victor Berchet 53694eb64a feat(FakeAsync): check pending timers at the end of fakeAsync in Dart
Made possible with quiver 0.21.4
2015-06-04 09:09:18 +02:00
Rado Kirov 552985e305 fix(types): parametrize QueryList. 2015-06-03 17:08:55 -07:00
Martin Probst f999d5a156 chore: move to clang-format 1.0.17.
clang-format 1.0.17 substantially improves formatting for fat arrow functions
and array literal detection. It also fixes a number of minor formatting issues.
2015-06-03 15:27:27 -07:00
vsavkin 3baf815d76 feat(forms): added support for status classes 2015-06-03 14:43:46 -07:00
vsavkin 96cadcc29e refactor(forms): handle dirty/pristine explicitly 2015-06-03 14:43:46 -07:00
Tobias Bosch 5030ffb01c feat(view): introduce free embedded views
Free embedded views are view instances that are created
logically in the same was as views of a ViewContainer,
but their dom nodes are not attached.

BREAKING CHANGE:

- `Renderer.detachFreeHostView` was renamed to
  `Renderer.detachFreeView`
- `DomRenderer.getHostElement()` was generalized into
  `DomRenderer.getRootNodes()`
2015-06-03 14:42:00 -07:00
Tim Blasi 246151b2f9 test(dart/transform): More change detector unit tests
Port some change detector unit tests which formerly ran only on dynamic
& JIT change detection to run for pre-generated Dart change detectors as
well.
2015-06-03 10:37:34 -07:00
Ian Riley 2b714df64e refactor(test/mock): Ts'ify angular2/test/mock
Translates the last test directory -- angular2/test/mock -- to TypeScript.
2015-06-03 09:52:37 -07:00
Victor Berchet c7572ac1f9 feat(fakeAsync): flush the microtasks before returning
fixes #2269
2015-06-03 06:48:08 +02:00
vsavkin ec3a78289f feat(forms): added touched and untouched to Control 2015-06-02 17:32:41 -07:00
vsavkin f543834be9 feat(forms): renamed control, control-group into ng-control and ng-control-group 2015-06-02 16:24:08 -07:00
vsavkin 6bef1c4169 feat(forms): changed the selector of TemplatdrivenFormDirective to match <form> 2015-06-02 16:24:08 -07:00
vsavkin 652ed0cf6d feat(form): implemented an imperative way of updating the view by updating the value of a control 2015-06-02 16:24:07 -07:00
vsavkin 559f54e92b feat(forms): added ng-model 2015-06-02 16:24:07 -07:00
Tobias Bosch ba7956f521 fix(render): only look for content tags in views that might have them.
Largetable benchmark with `interpolationAttr` and 200 rows / 20 columns:
Time for destroy/create pair dropped from about 1260ms to about 150ms.

Related to #2298, but does not really fix it as we are still slow
if people are using `<content>`.

Closes #2297
2015-06-02 15:31:07 -07:00
Victor Berchet 0b43e3cf32 refactor(lang_spec): Add missing ;s and clang-format 2015-06-02 21:09:38 +02:00
Jeff Cross ba07f39347 refactor(router): convert to typescript
Fixes #2001
2015-06-02 11:06:44 -07:00
Marc Laval 4c8e11a577 fix(ShadowCss): keyframes tests failing in Safari
Closes #2283
2015-06-02 19:23:06 +02:00
Victor Berchet c60091b949 refactor(Compiler): improve the error message on component load error
by adding the fetched url.

relates to #1460
2015-06-02 12:59:50 +02:00
Tobias Bosch 62a95823e0 fix(selector): support multiple `:not` clauses
Fixes #2243
2015-06-01 14:24:19 -07:00
Tim Blasi 22f5925202 fix(facade): Make PromiseWrapper#all semantics equivalent
The semantics between ES6 `Promise#all` and Dart's `Future#wait` are
different for values that are not `Promise`/`Future`s. In ES6,
non-`Promise` values are immediately completed to their current value.
In Dart, non-`Future` values cause an error.

Updated Dart's `PromiseWrapper#all` implementation to conform to the ES6
spec.
2015-06-01 07:26:46 -07:00
vsavkin a9d6fd9afa feat(forms): implemented template-driven forms 2015-05-30 11:56:00 -07:00
vsavkin f19970a481 feat(transformers): added support for lifecycle events 2015-05-29 16:40:34 -07:00
vsavkin d523613329 test(di): added a test verifying hierarchical injection 2015-05-29 15:52:46 -07:00
Tim Blasi 000a8e25a2 fix(dart/transform): Fix DirectiveMetadata read tests 2015-05-29 14:56:42 -07:00
Tim Blasi 8a3b0b366f feat(dart/transform): Generate ChangeDetector classes
Use the `ProtoViewDto` created by the render `Compiler` to create a
`ChangeDetectorDefinition`.

From there, generate a subclass of `AbstractChangeDetector` for each
`ChangeDetectorDefinition`.

Run some basic unit tests for the dynamic and JIT change detectors on
pre-generated change detectors.
2015-05-29 14:48:53 -07:00
Tobias Bosch f9908cd436 feat(test): add element probe
Usage: bootstrap the app with the special binding
`ELEMENT_PROBE_CONFIG` from `angular2/debug`.
This will provide a global method `ngProbe(element)` that
will expose a `DebugElement` with directive instances, ... on it.

During tests that use Angular's test injector, the probe is
enabled by default. The `DebugElement ` can be retrieved via the
function `inspectDomElement` of `angular2/debug`. Note
that the `TestComponentBuilder` already returns `DebugElement `s.

Closes #1992
2015-05-29 12:44:21 -07:00
Tobias Bosch 75578f41e7 feat(view): add `AppViewListener` interface
Basic functionality how element probe is hooked into
the system.
2015-05-29 11:33:22 -07:00
Tim Blasi ffb219fb91 style(dart): Format Dart source with dart_style 0.1.8 2015-05-29 10:42:47 -07:00
Victor Berchet 35f0ee510a refactor(transformer): updates in properties syntax 2015-05-29 11:44:44 +02:00
Victor Berchet d7df853bde feat(Directive): convert properties to an array
fixes #2013

BREAKING CHANGE:

Before

    @Directive(properties: {
      'sameName': 'sameName',
      'directiveProp': 'elProp | pipe'
    })

After

    @Directive(properties: [
      'sameName',
      'directiveProp: elProp | pipe'
    ])
2015-05-29 11:44:43 +02:00
vsavkin c39c8ebcd0 feat(change_detection): added onInit and onCheck hooks 2015-05-28 16:46:22 -07:00
Tim Blasi 5d2af54730 feat(dart/transform): Improve constant evaluation
Use `package:analyzer`'s `ConstantEvaluator` to read from the AST.
This cleanly builds values for us from adjacent strings, interpolations,
etc.
2015-05-28 15:18:22 -07:00