Commit Graph

92 Commits

Author SHA1 Message Date
Tobias Bosch 0a51ccbd68 feat(render): don’t use the reflector for setting properties
BREAKING CHANGES:
- host actions don't take an expression as value any more but only a method name,
  and assumes to get an array via the EventEmitter with the method arguments.
- Renderer.setElementProperty does not take `style.`/... prefixes any more.
  Use the new methods `Renderer.setElementAttribute`, ... instead

Part of #2476
Closes #2637
2015-06-22 18:35:16 -07:00
vsavkin 92ffc465d6 feat(host): limits host properties to renames 2015-06-22 12:10:02 -07:00
vsavkin 20a8f0dbe5 refactor(pipes): removed pipes from properties
BREAKING CHANGE:

This PR remove an ability to use pipes in the properties config. Instead, inject the pipe registry.
2015-06-19 16:56:52 -07:00
Martin Probst 920982c4e8 chore: update files to match clang-format 1.0.21. 2015-06-19 15:00:32 -07:00
vsavkin f80f97253c refactor(change_detection): made ChangeDetector and ProtoChangeDetector interfaces
List of changes:

- Makes ChangeDetector and ProtoChangeDetector interfaces
- Assigns a unique id to every detector
2015-06-18 17:41:22 -07:00
Martin Probst 941362014b feat: remove MapWrapper.clear().
It's the same in Dart and JavaScript.
2015-06-18 14:55:13 -07:00
Martin Probst be7ac9fd41 feat: remove MapWrapper.create()/get()/set().
Better dart2js code, better Angular code.
2015-06-18 14:55:12 -07:00
Yegor Jbanov 5beaf6d735 fix(change detection): preserve memoized results from pure functions 2015-06-17 17:33:37 -07:00
Martin Probst c7e48350d3 chore: kill ListWrapper.create() and .push().
These wrappers are not natively understood by
ts2dart. Removing them will improve Dart2JS
compilation due to fewer megamorphic calls to List
functions.

It also makes Angular code more succinct and
improves type safety in Angular due to better type
inference of the Array component type.

This change exposed several bugs in Angular.
2015-06-17 16:21:55 -07:00
Victor Berchet cdfb635737 refactor(facade): refactor type check function - is*() 2015-06-16 19:27:34 +02:00
vsavkin 5bfcca2d5b feat(query): notify on changes 2015-06-15 11:10:21 -07:00
Victor Berchet 7d32879929 feat(Parser): support if statements in actions
fixes #2022
2015-06-15 18:54:12 +02:00
Tim Blasi 8e3bf3907a feat(dart/transform): Use the best available Change Detectors
Enable pregenerated (for Dart) and JIT (for Js) change detectors when
possible. Previously we would always use `DynamicChangeDetector`s, but
these cause megamorphic calls and are therefore much slower.

Closes #502
2015-06-12 16:04:09 -07:00
Martin Probst f3d741854a fix: add types for ts2dart's façade handling.
... in many, many places.
2015-06-12 15:41:08 -07:00
Martin Probst a6e7123995 feat: adjust formatting for clang-format v1.0.19. 2015-06-12 09:51:57 -07:00
Victor Berchet f9745327e6 fix(Parser): Parse pipes in arguments
fixes #1680
2015-06-11 21:02:40 +02:00
Victor Berchet f2371487a1 refactor(ProtoRecord): switch to enum 2015-06-11 17:11:34 +02:00
Victor Berchet 331a051e75 feat(Parser): implement Unparser
fixes #1949
closes #2395
2015-06-10 16:24:59 -07:00
Tim Blasi 76beaa2097 refactor(change detect): Clean up change detector test layout
- Rename simple_watch_config > change_detector_config
- Add a bunch of comments explaining what's going on with the change
  detector tests.

Closes #2468
2015-06-10 16:09:48 -07:00
Tim Blasi ad95601e3c test(change detect): Port remaining unit tests
Move all remaining unit tests for change detectors to exercise Dart
pre-generated change detectors as well as `dynamic` and `JIT` change
detectors.

See #502
2015-06-10 14:11:42 -07:00
Tim Blasi ddd5a235c3 test(change detect): Port change detect tests for mode
More the change detect tests that exercise various detection modes to
use the Dart pre-generated change detectors in addition to the `dynamic`
and `JIT` change detectors.

See #502
2015-06-09 17:04:50 -07:00
Tim Blasi 0409b4ca49 test(change detect): Port more change detect tests
Move more change detector unit tests to exercise the Dart pre-generated
change detectors in addition to `dynamic` and `JIT` change detectors.

See #502
2015-06-09 07:18:48 -07:00
gdi2290 e77710a372 fix(JsonPipe): always transform to json
BREAKING CHANGE:

no longer cache ref
2015-06-08 16:22:04 -07:00
Tim Blasi b6e95bb96e feat(change detect): Throw on attempts to use dehydrated detector
- Modify change detectors to `throw` when attempting to detect changes
  on a dehydrated detector.
- Modify `DynamicChagneDetector` to use `null` for the `context` of a
  dehydrated detector.
2015-06-08 16:10:41 -07:00
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
Tim Blasi 81fc657356 refactor(change detect): Remove unnecessary param from tests 2015-06-08 11:21:45 -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
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
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
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
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
vsavkin c39c8ebcd0 feat(change_detection): added onInit and onCheck hooks 2015-05-28 16:46:22 -07:00
Victor Berchet a9be2ebf1b feat: add support for the safe navigation (aka Elvis) operator
fixes #791
2015-05-28 23:03:30 +02:00
Jeff Cross 01fb8e6635 fix: fix clang errors 2015-05-28 11:08:26 -07:00
Jeff Cross 9d90128463 refactor(ChangeDetection): convert change detection tests to typescript 2015-05-28 10:01:30 -07:00
Marc Laval 661a04798e fix(test): adds longer timers for NgZone and PromisePipe tests (IE11)
Closes #2055
2015-05-22 13:30:49 +02:00
gdi2290 d61a0dfa22 test(ObservablePipe): onDestroy shouldn't throw 2015-05-22 12:31:46 +02:00
gdi2290 4afd2b4138 feat(PromisePipe): remove ref onDestroy 2015-05-20 14:00:57 -07:00
Misko Hevery a664f5a6de fix: don't call onAllChangesDone on checkNoChanges 2015-05-20 08:27:48 +02:00
Victor Berchet 0ae89ac096 feat(CD): add support for === and !==
relates to #1500
2015-05-20 07:50:43 +02:00
Victor Berchet 6ec5d5daaf refactor(async): extract timer related functions into a TimerWrapper 2015-05-20 07:47:46 +02:00
gdi2290 986038242a feat(change_detection): json pipe
Closes #1957
2015-05-18 14:34:37 -07:00
gdi2290 7a4a635399 feat(change_detection): uppercase and lowercase pipes
because the world needs more uppercase madness

[✔] clang-format
[✔] tests
2015-05-15 19:46:52 +02:00
vsavkin 08f21dbf51 feat(change_detection): implemented change detection that can be configured with pregenerated change detectors 2015-05-13 16:23:22 -07:00
vsavkin d8c7c274e4 refactor(change_detector): extracted ChangeDetectorDefinition 2015-05-13 16:23:22 -07:00
Misko Hevery 111fa60a93 chore: rename for to ng-for
Closes #1598
Closes #1295
Closes #1827

Closes #1827
2015-05-12 15:32:44 -07:00
Jeff Cross 5691063ba0 refactor(ChangeDetection): rename AsyncPipe to ObservablePipe
The async pipe in templates will now delegate to both Observable pipe or Promise pipe,
whichever first says it can support the input. Therefore, it's beneficial to disambiguate
the name of the AsyncPipe/AsyncPipeFactory constructors to reflect that these actually
support only Observables.
2015-05-11 14:25:27 -07:00
Jeff Cross 7498758584 feat(PromisePipe): add pipe for promises 2015-05-11 14:23:46 -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