Commit Graph

479 Commits

Author SHA1 Message Date
Alex Eagle b4c252bcc5 build: serve ivy todo app with real http-server (#23446)
PR Close #23446
2018-04-25 15:51:18 -07:00
Kara Erickson db77d8dc92 feat(ivy): support injection flags at runtime (#23518)
PR Close #23518
2018-04-25 13:26:58 -07:00
Pawel Kozlowski b1d03fe70b fix(ivy): properly destroy view trees where root is an embedded view without children (#23482)
The bug fixed here steams from the fact that we are traversing too far up
in the views tree hierarchy in the destroyViewTree function.

The logic in destroyViewTree is off if we start removal at an embedded view
without any child views. For such a case we should just clean up (cleanUpView)
this one view without paying attention to next / parent views.

PR Close #23482
2018-04-24 11:15:16 -07:00
Victor Berchet 6761a64522 refactor(compiler): remove a dependency from the IVY AST to the template AST (#23476)
PR Close #23476
2018-04-20 17:23:02 -07:00
Victor Berchet 9757347e71 feat(ivy): add an IVY local the compiler which avoids analyzeModule (#23441)
closes #23289

Based on a spike by @chukjaz

PR Close #23441
2018-04-19 16:32:09 -07:00
Victor Berchet 1d1e75ee2b Revert "fix(compiler): Pretty print object instead of [Object object] (#22689)" (#23442)
This reverts commit 8555a3a3cd.

Reverted because of https://github.com/angular/angular/issues/23440

PR Close #23442
2018-04-19 14:51:58 -07:00
Matias Niemelä acf6781ccc test(core): add a symbols test for renderer2 code (#23436)
PR Close #23436
2018-04-18 14:49:29 -07:00
Kara Erickson 5a1ddee88c refactor(ivy): speed up bound text nodes (#23386)
PR Close #23386
2018-04-17 13:49:19 -07:00
Misko Hevery b64a276d4b refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private (#23371) (#23383)
Ivy definition looks something like this:

```
class MyService {
  static ngInjectableDef = defineInjectable({
    …
  });
}
```

Here the argument to `defineInjectable` is well known public contract which needs
to be honored in backward compatible way between versions. The type of the
return value of `defineInjectable` on the other hand is private and can change
shape drastically between versions without effecting backwards compatibility of
libraries publish to NPM. To our users it is effectively an opaque token.
For this reson why declare the return value of `defineInjectable` as `never`.

PR Close #23383
2018-04-14 20:40:14 -07:00
Igor Minar 674c3def31 revert: refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private (#23371)
This reverts commit 2c09b707ce.
2018-04-13 23:02:29 -07:00
Miško Hevery 2c09b707ce refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private (#23371)
Ivy definition looks something like this:

```
class MyService {
  static ngInjectableDef = defineInjectable({
    …
  });
}
```

Here the argument to `defineInjectable` is well known public contract which needs
to be honored in backward compatible way between versions. The type of the
return value of `defineInjectable` on the other hand is private and can change
shape drastically between versions without effecting backwards compatibility of
libraries publish to NPM. To our users it is effectively an `OpaqueToken`.

By prefixing the type with `ɵ` we are communicating the the outside world that
the value is not public API and is subject to change without backward compatibility.

PR Close #23371
2018-04-13 16:20:25 -07:00
Misko Hevery f4017ce5e3 fix(ivy): Update Todo app to take advantage of optional injector (#23345)
PR Close #23345
2018-04-13 14:29:52 -07:00
Misko Hevery da31db757b feat(ivy): support injection even if no injector present (#23345)
- Remove default injection value from `inject` / `directiveInject` since
  it is not possible to set using annotations.
- Module `Injector` is stored on `LView` instead of `LInjector` data
  structure because it can change only at `LView` level. (More efficient)
- Add `ngInjectableDef` to `IterableDiffers` so that existing tests can
  pass as well as enable `IterableDiffers` to be injectable without
  `Injector`

PR Close #23345
2018-04-13 14:29:52 -07:00
Misko Hevery 6f213a74f2 feat(ivy): support generation of flags for directive injection (#23345)
This change changes:
- compiler uses `directiveInject` instead of `inject` for `Directive`s
- unifies the flags in `di` as well as `render3`
- changes the signature of `directiveInject` to match `inject` In prep for #23330
- compiler now generates flags for injection.

Compiler portion of #23342
Prep for #23330

PR Close #23345
2018-04-13 14:29:52 -07:00
Marc Laval e7ef02722d fix(ivy): local directives and pipes should be applied to TemplateRef (#23312)
PR Close #23312
2018-04-13 13:31:19 -07:00
Victor Berchet d5e7f60f04 refactor(ivy): misc (#23351)
PR Close #23351
2018-04-13 13:19:17 -07:00
Rafael 639d52fe71 refactor: ensure all 'TODO's are consistent (#23252)
PR Close #23252
2018-04-13 13:11:01 -07:00
Marc Laval 2bb783824e fix(ivy): support ViewContainerRef on nodes projected into an embedded view (#23333)
PR Close #23333
2018-04-13 00:20:32 -07:00
Joey Perrott b551f844e4 feat(platform-browser): add token marking which the type of animation module nearest in the injector tree (#23075)
PR Close #23075
2018-04-12 23:17:38 -07:00
Kara Erickson 0d516f1658 fix(ivy): update compiler to generate separate creation mode and update mode blocks (#23292)
PR Close #23292
2018-04-11 15:30:39 -07:00
Kara Erickson de3ca56769 fix(ivy): support separate creation mode and update mode execution in runtime (#23292)
PR Close #23292
2018-04-11 15:30:39 -07:00
Marc Laval c973830d9a refactor(ivy): clean projection support (#23287)
PR Close #23287
2018-04-10 13:16:01 -07:00
Miško Hevery f1db789450 test(ivy): update todo app to http://todomvc.com (#23168)
PR Close #23168
2018-04-10 13:14:20 -07:00
Miško Hevery 3fb4e190a8 fix(ivy): correctly bind to component context (#23168)
When compiling templates the compiler would often bind to
closest context rather than the component context.

The only time one should be binding to the cont component is
in explicit cases where the inner template declares local variable.

PR Close #23168
2018-04-10 13:14:20 -07:00
Miško Hevery 4f7fac0e03 test(ivy): cleanup todo test app (#23168)
PR Close #23168
2018-04-10 13:14:20 -07:00
Miško Hevery 720031b5f6 docs(ivy): update outstanding work for todo (#23168)
PR Close #23168
2018-04-10 13:14:20 -07:00
Marc Laval bb3f0e5ed2 feat(ivy): support projection of ViewContainerRef (#23272)
PR Close #23272
2018-04-09 16:07:42 -07:00
Marc Laval f4c56f4931 feat(ivy): implement some of the ViewContainerRef API (#23189)
PR Close #23189
2018-04-09 15:17:19 -07:00
Kara Erickson 628303d2cb fix(ivy): instantiate dirs in correct order (#23178)
PR Close #23178
2018-04-05 14:50:00 -07:00
Pawel Kozlowski d80e9304c6 fix(ivy): properly find RNode (#23193)
As we no longer create native (RNode) comment nodes for containers,
we need to execute logic for finding a next sibiling node with RNode
when inserting a view.

The mentioned logic need to be updated for the case of dynamically
created containers (LContainerNode). Indeed, we need to be able to
descend into dynamically inserted views while looking for a RNode.
To achieve this we need to have a pointer from a host LNode to a
dynamically created LContainerNode).

PR Close #23193
2018-04-05 14:47:50 -07:00
Pawel Kozlowski fc813f67f4 fix(ivy): fix issue with refreshing embedded views (#23164)
PR Close #23164
2018-04-05 10:14:02 -07:00
Pawel Kozlowski 32a41bc738 test(ivy): fixes in the TodoMVC example (#23161)
- properly display initial checked state
- properly remove a todo

Please note that the 'archive' option still doesn't
work correctly as listening to component outputs doesn't
seem to work (onArchive() is never called).

PR Close #23161
2018-04-04 10:26:18 -07:00
Alex Rickabaugh fab6b39c3d fix(core): inject() should always work in an NgModule injection scope (#23148)
Currently the context for inject() is only set when the token is seen
for the first time. This has two issues:

* It should always be set when injecting from that injector, because
  a constructor may wish to call inject() directly.
* If an NgModuleFactory is .create()'d twice, and an ngInjectableDef
  token is requested from each of them, the second time will fail.
  This is because the first injection adds the provider definition
  and calls the factory, and the provider definitions are shared.
  The second injector will see the provider definition and call the
  factory to create an instance, but without setting the correct
  context for inject().

Fixes angular/material2#10586.

PR Close #23148
2018-04-03 10:59:36 -07:00
Alex Eagle 580f05bd9c build: flatten esm5 sources before rollup (#23131)
this is needed to update to latest rules_nodejs due to breaking change in
https://github.com/bazelbuild/rules_nodejs/pull/172
It has the side-effect of correctly marking rxjs packages as side-effect-free

PR Close #23131
2018-04-03 10:47:29 -07:00
Igor Minar 92724b396b build: update to rxjs@6.0.0-rc.0 (#23106)
PR Close #23106
2018-04-03 10:00:24 -07:00
Pawel Kozlowski fa2c9a81dd feat(ivy): ViewContainerRef basic scenarios support (#23021)
PR Close #23021
2018-04-03 09:35:14 -07:00
Miško Hevery 55c9fb298f test(ivy): create todo app in ivy (#22921)
PR Close #22921
2018-04-02 15:49:48 -07:00
Miško Hevery 60065935be refactor(ivy): align compiler with runtime (#22921)
Remove `containerRefreshStart` and `containerRefreshEnd` instruction
from the output.

Generate directives as a list in `componentDef` rather than inline into
instructions. This is consistent in making selector resolution runtime
so that translation of templates can follow locality.

PR Close #22921
2018-04-02 15:49:48 -07:00
Miško Hevery 4290ea4bb9 ci: update to latest rulse_nodejs (#22921)
PR Close #22921
2018-04-02 15:49:48 -07:00
Miško Hevery e7f1af3c54 refactor(ivy): cleanup necessary domino files (#22921)
PR Close #22921
2018-04-02 15:49:48 -07:00
Kara Erickson 85d3b591b6 refactor(ivy): generate pipe names instead of defs (#23104)
PR Close #23104
2018-04-02 09:42:44 -07:00
Kara Erickson 6e5fb99304 refactor(ivy): flatten css selectors (#23074)
PR Close #23074
2018-03-30 15:27:50 -07:00
Igor Minar 22cb2c9441 build: add missing dependencies on @rxjs//operators needed for rxjs@6.0.0-beta.4 (#23084)
PR Close #23084
2018-03-30 13:07:03 -07:00
Igor Minar 6f7d14064c build: update to rxjs@6.0.0-beta.4 (#23084)
PR Close #23084
2018-03-30 13:07:03 -07:00
Kara Erickson e2e80ec61c refactor(ivy): remove pipe references from the template (#23032)
PR Close #23032
2018-03-28 09:17:27 -07:00
Kara Erickson 5a86f7144f fix(ivy): store local variables in data instead of calling loadDirective (#23029)
PR Close #23029
2018-03-28 09:17:05 -07:00
Olivier Combe d28ce50067 test(ivy): make sure `goog.getMsg()` is defined before being used (#22998)
PR Close #22998
2018-03-27 17:07:50 -04:00
Veres Lajos de90314304 style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975)
PR Close #22975
2018-03-27 14:51:53 -04:00
Kara Erickson 910a16a1ff refactor(ivy): remove directive references from template (#22986)
PR Close #22986
2018-03-26 22:33:23 -04:00
Kara Erickson 49396ca2ae refactor(ivy): move directives into separate array (#22918)
PR Close #22918
2018-03-22 21:23:02 -04:00
Kara Erickson e44f69c387 refactor(ivy): move dir flags to tnode (#22901)
PR Close #22901
2018-03-22 19:19:40 -04:00
Olivier Combe 99711b12f9 test(core): hello world i18n demo (#22654)
PR Close #22654
2018-03-22 19:01:51 -04:00
Miško Hevery c84817970e fix(ivy): remove custom tsconfig from render3 (#22913)
PR Close #22913
2018-03-22 18:02:48 -04:00
Miško Hevery 17fb9832f4 fix(ivy): fix type error in newer version of TS (#22897)
Newer version of TS is stricter about types and flags counter-variant
types in some  situations. This change inlines the DirectiveDefArgs
into the arguments which:
1) removes the inheritance which caused the issue and
2) Makes it more friendly to IDEs since they will not report comments.

Closes #22877
Closes #22843

PR Close #22897
2018-03-20 15:49:45 -07:00
Igor Minar 3cc5c2e4d0 build: update to rxjs@6.0.0-beta.0 (#22887)
PR Close #22887
2018-03-20 15:26:49 -07:00
Igor Minar b43f8bc7d3 feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573)
PR Close #22573
2018-03-19 21:51:51 -07:00
Misko Hevery fc50c77bd3 test(ivy): switch HelloWorld to ivy compiler (#22788)
PR Close #22788
2018-03-19 16:00:38 -07:00
Kara Erickson 1a0cb21538 refactor(ivy): remove unnecessary binding from hello world (#22848)
PR Close #22848
2018-03-19 16:29:45 -05:00
Kara Erickson e27cfd6236 refactor(ivy): split up directiveCreate for tree shaking (#22838)
PR Close #22838
2018-03-18 11:56:35 -07:00
Kara Erickson 1612985e48 refactor(ivy): allow tick and deps to be tree-shaken (#22838)
PR Close #22838
2018-03-18 11:47:44 -07:00
Kara Erickson 4f21d373b7 refactor(ivy): move hostBindings calls out of template (#22833)
PR Close #22833
2018-03-18 11:41:39 -07:00
Alex Rickabaugh 6ef9f2278f feat(ivy): @NgModule -> ngInjectorDef compilation (#22458)
This adds compilation of @NgModule providers and imports into
ngInjectorDef statements in generated code. All @NgModule annotations
will be compiled and the @NgModule decorators removed from the
resultant js output.

All @Injectables will also be compiled in Ivy mode, and the decorator
removed.

PR Close #22458
2018-03-16 12:57:11 -07:00
Kara Erickson bafdad9083 fix(ivy): cache local names and support multiple locals with same value (#22807)
PR Close #22807
2018-03-16 11:26:38 -07:00
Kara Erickson 9220521149 test(ivy): correct export tests and add query test (#22807)
PR Close #22807
2018-03-16 11:26:38 -07:00
Alex Eagle f9247e4b2e build: enable importHelpers in tsconfig (#22812)
This is the primary tsconfig file used for Bazel builds.
Previously, we enabled this option only for releases.

PR Close #22812
2018-03-15 21:16:03 -07:00
Victor Berchet 0ebd577db4 refactor(compiler): Drop support for the deprecated `<template>`. Use `<ng-template>` instead (#22783)
BREAKING CHANGE:

The `<template>` tag was deprecated in Angular v4 to avoid collisions (i.e. when
using Web Components).

This commit removes support for `<template>`. `<ng-template>` should be used
instead.

BEFORE:

    <!-- html template -->
    <template>some template content</template>

    # tsconfig.json
    {
      # ...
      "angularCompilerOptions": {
        # ...
        # This option is no more supported and will have no effect
        "enableLegacyTemplate": [true|false]
      }
    }

AFTER:

    <!-- html template -->
    <ng-template>some template content</ng-template>

PR Close #22783
2018-03-15 14:52:22 -07:00
Kara Erickson 4e6ac185e5 refactor(ivy): double size of DI bloom filter (#22775)
PR Close #22775
2018-03-15 14:49:39 -07:00
Adam Plumer cd2ebd22fd fix(platform-server): add styles to elements correctly (#22527)
* Partially reverts #22263 due to lack of total spec compliance
  on the server
* Maintains the camel-case styles fix

PR Close #22527
2018-03-14 14:12:31 -07:00
Miško Hevery 112431db69 test(ivy): add canonical compiler spec for class/style (#22719)
Adds a stub for `elementStyle` and `elementClass` instruction
with a canonical spec for the compiler. The spec shows the the
compiler should be using `elementStyle` and `elementClass` instruction
in place of `[class]` and `[style]` bindings respectively.
PR Close #22719
2018-03-14 12:59:52 -07:00
Miško Hevery a0a01f1e1e refactor(ivy): rename class/style to make space for new instruction (#22719)
Rename:
- `elementClass` (short: `k`) => `elementClassNamed` (short: `kn`)
- `elementStyle` (short: `s`) => `elementStyleNamed` (short: `sn`)

Currently `[class.name]` is `elementClass(0, ‘name’, value)`. We would
like to introduce new binding `[class]` which needs a new instruction
ideally `elementClass(0, value)`. Doing the rename creates space
to create such an instruction in subsequent change.

PR Close #22719
2018-03-14 12:59:52 -07:00
Miško Hevery ae19d071bb test(ivy): add ComponentFixture for cleaner tests. (#22719)
PR Close #22719
2018-03-14 12:59:52 -07:00
Pawel Kozlowski c09bd67aee fix(ivy): fix views manipulation logic (#22656)
This commit fixes a bug that would result in views insert / remove
even if a view needed only refresh operation.

The crux of the bug was that we were looking for a view to update
only in the LContainer.nextIndex position. This is incorrect as a
view with a given block id could be present later in the views
array (this happens if we about to remove a view in the middle of
the views array).

The code in this fix searches for a view to update in the views array and
can remove views in the middle of the views collection. Previously we
would remove views at the end of the collection only.

PR Close #22656
2018-03-14 12:07:15 -07:00
Michael Giambalvo 37fedd001c feat(core): add task tracking to Testability (#16863)
Allow passing an optional timeout to Testability's whenStable(). If
specified, if Angular is not stable before the timeout is hit, the
done callback will be invoked with a list of pending macrotasks.

Also, allows an optional update callback, which will be invoked whenever
the set of pending macrotasks changes. If this callback returns true,
the timeout will be cancelled and the done callback will not be invoked.

If the optional parameters are not passed, whenStable() will work
as it did before, whether or not the task tracking zone spec is
available.

This change also migrates the Testability unit tests off the deprecated
AsyncTestCompleter.

PR Close #16863
2018-03-14 08:48:48 -07:00
Kara Erickson b1365d1fa8 refactor(ivy): remove directiveRefresh instruction (#22745)
PR Close #22745
2018-03-13 23:29:21 -07:00
Miško Hevery 51027d73cc fix(ivy): Update rollup rule to prevent inlining symbols in debug. (#22747)
The new rollup rule disables inlining symbols in debug mode. This makes 
it look as if there would be more symbols but in reality these are the
symbols which are no longer being inlined.
PR Close #22747
2018-03-13 19:58:30 -07:00
Kara Erickson bd9d4df735 refactor(ivy): remove inputsPropertyName (#22716)
Closes #22591

PR Close #22716
2018-03-13 13:26:15 -07:00
Matias Niemelä 58b94e6f5e feat(animations): expose `element` and `params` within transition matchers (#22693)
PR Close #22693
2018-03-13 09:42:24 -07:00
Alex Rickabaugh db56836425 feat: tree-shakeable providers API updates (#22655)
Rename @Injectable({scope -> providedIn}).

Instead of {providedIn: APP_ROOT_SCOPE}, accept {providedIn: 'root'}.
Also, {providedIn: null} implies the injectable should not be added
to any scope.

PR Close #22655
2018-03-13 09:28:05 -07:00
Marc Laval f95730b8e2 fix(ivy): elements properties should not be stringified (#22683)
PR Close #22683
2018-03-12 13:16:05 -07:00
Kara Erickson aa7dba244b feat(ivy): support checkNoChanges (#22710)
PR Close #22710
2018-03-11 22:16:38 -07:00
Kara Erickson fa451bcd19 feat(ivy): support markForCheck (#22690)
PR Close #22690
2018-03-09 20:29:05 -08:00
Kara Erickson b26a90567c feat(ivy): support attaching and detaching views from change detection (#22670)
PR Close #22670
2018-03-08 23:44:33 -08:00
Misko Hevery 2fee5cc095 test(ivy): add injection canonical specs (#22595)
PR Close #22595
2018-03-08 12:09:39 -08:00
Kara Erickson f13f4db9dc refactor(ivy): fix rebase error (#22661)
PR Close #22661
2018-03-08 11:37:42 -08:00
Kara Erickson 4c089c1d93 feat(ivy): support ChangeDetectorRef.detectChanges (#22614)
PR Close #22614
2018-03-07 21:08:25 -08:00
Kara Erickson d485346d3c fix(ivy): lifecycle hooks should be queued for root component (#22614)
PR Close #22614
2018-03-07 21:08:25 -08:00
Marc Laval f64ee15487 feat(ivy): implement pipes (#22254)
PR Close #22254
2018-03-07 20:58:48 -08:00
Marc Laval 5d4fa7f0c8 test(ivy): add canonical examples of bindings on elements (#22403)
PR Close #22403
2018-03-07 20:55:49 -08:00
Miško Hevery 6d1367d297 feat(ivy): provide sanitization methods which can be tree shaken (#22540)
By providing a top level sanitization methods (rather than service) the
compiler can generate calls into the methods only when needed. This makes
the methods tree shakable.

PR Close #22540
2018-03-07 18:24:07 -08:00
Miško Hevery 538f1d980f refactor(core): move sanitization into core (#22540)
This is in preparation of having Ivy have sanitization inline.

PR Close #22540
2018-03-07 18:24:06 -08:00
Miško Hevery 363dfa5437 test(ivy): Back patch example (#22235)
PR Close #22235
2018-03-06 15:02:02 -08:00
Pawel Kozlowski 2c75acc5b3 feat(ivy): add support for the ngProjectAs attribute (#22498)
PR Close #22498
2018-03-06 06:55:51 -08:00
Kara Erickson 2c2b62f45f fix(ivy): preventDefault when listener returns false (#22529)
Closes #22495

PR Close #22529
2018-03-05 12:15:17 -08:00
Misko Hevery 51ca643c27 test(ivy): add injectAttribute spec (#22510)
PR Close #22510
2018-03-05 10:10:32 -08:00
Misko Hevery 69d359bb51 refactor(ivy): break compiler canonical test into smaller files (#22510)
PR Close #22510
2018-03-05 10:10:32 -08:00
Kara Erickson 9eaf1bbe67 feat(ivy): support injecting ChangeDetectorRef (#22469)
PR Close #22469
2018-02-28 13:35:48 -08:00
Kara Erickson 8c358844dd feat(ivy): support OnPush change detection (#22417)
PR Close #22417
2018-02-28 10:42:11 -08:00
Adam Plumer 40ba009e25 fix(platform-server): generate correct stylings for camel case names (#22263)
* Add correct mapping from camel case to kebab case for CSS style
names
* Remove internal CSS methods in favor of native Domino APIs

Fixes #19235

PR Close #22263
2018-02-26 17:46:21 -08:00
Marc Laval aad431642a refactor(ivy): rename componentRefresh to directiveRefresh (#22395)
PR Close #22395
2018-02-23 09:42:08 -08:00
Marc Laval 7effb0016c fix(ivy): ngOnChanges to receive SimpleChanges with non minified property names as keys (#22352)
PR Close #22352
2018-02-22 17:48:52 -08:00
Matias Niemelä b2f366b3b7 fix(animations): only use the WA-polyfill alongside AnimationBuilder (#22143)
This patch removes the need to include the Web Animations API Polyfill
(web-animations-js) as a dependency. Angular will now fallback to using
CSS Keyframes in the event that `element.animate` is no longer supported
by the browser.

In the event that an application does use `AnimationBuilder` then the
web-animations-js polyfill is required to enable programmatic,
position-based access to an animation.

Closes #17496

PR Close #22143
2018-02-22 16:07:53 -08:00
Marc Laval b3ffeaa22b fix(ivy): OnDestroy hook should not be called twice for a directive on an element (#22350)
PR Close #22350
2018-02-22 13:35:17 -08:00
Trotyl b7544cccc6
feat(core): support metadata reflection for native class types (#22356)
closes #21731

PR Close #22356
2018-02-22 13:22:03 -08:00
Marc Laval 894b098eb3 test(ivy): add missing tests on directive lifecycle hooks (#22368)
PR Close #22368
2018-02-22 11:21:15 -08:00
Victor Berchet 90e9c59e23 Revert "feat(core): support metadata reflection for native class types (#22356)"
This reverts commit 5c89d6bffa.
2018-02-22 10:26:06 -08:00
Trotyl 5c89d6bffa feat(core): support metadata reflection for native class types (#22356)
closes #21731

PR Close #22356
2018-02-21 16:09:27 -08:00
Trotyl a7ebf5aadd fix(core): properly handle function without prototype in reflector (#22284)
closes #19978

PR Close #22284
2018-02-21 14:52:04 -08:00
Marc Laval ee60bb5b36 fix(ivy): pureFunction8 should update the right bindings (#22313)
PR Close #22313
2018-02-20 11:36:50 -08:00
Victor Berchet a8b5465e24 fix(ivy): update master with renamings (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet c9ebd60435 refactor(ivy): interpolatiom instructions do not support NO_CHANGE at input. (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet 5a14e2238f refactor(ivy): split the `memory` instruction into `store` and `load` (#22268)
PR Close #22268
2018-02-18 18:48:41 -08:00
Victor Berchet c30d329faa fix(ivy): fix merge errors (master is broken) (#22291)
PR Close #22291
2018-02-18 15:03:39 -08:00
Kara Erickson 49082d7ab2 feat(ivy): support host attributes (#22213)
PR Close #22213
2018-02-18 13:22:38 -08:00
Kara Erickson 6b627f67db test(ivy): add missing host listener and host attribute binding tests (#22213)
PR Close #22213
2018-02-18 13:22:38 -08:00
Kara Erickson 5c320b4c2a test(ivy): add missing host binding and query tests (#22213)
PR Close #22213
2018-02-18 13:22:34 -08:00
Misko Hevery ac2b04a5ab test(ivy): Add small_app spec for sprint #3 (#22018)
PR Close #22018
2018-02-18 13:18:54 -08:00
Misko Hevery a63b764b54 test(ivy): move compiler canonical specs into a single directory (#22018)
PR Close #22018
2018-02-18 13:18:54 -08:00
Kara Erickson f693be3996 feat(ivy): add pureFunction0 instruction (#22214)
PR Close #22214
2018-02-16 18:03:55 -08:00
Kara Erickson a73d5308e0 refactor(ivy): rename objectLiteral to pureFn to prep for pipes (#22214)
PR Close #22214
2018-02-16 18:03:55 -08:00
Matias Niemelä e1bf067090 fix(animations): report correct totalTime value even during noOp animations (#22225)
This patch ensures that if the NoopAnimationsModule is used then it will
correctly report the associated `totalTime` property within the emitted
AnimationEvent instance when an animation event trigger is fired.

BREAKING CHANGE: When animation is trigged within a disabled zone, the
associated event (which an instance of AnimationEvent) will no longer
report the totalTime as 0 (it will emit the actual time of the
animation). To detect if an animation event is reporting a disabled
animation then the `event.disabled` property can be used instead.

PR Close #22225
2018-02-16 18:03:31 -08:00
Marc Laval dfa2fb95d5 test(ivy): clean the imported renderer2 (#22255)
PR Close #22255
2018-02-16 15:11:23 -08:00
Oussama Ben Brahim f1a063298e feat(core): set preserveWhitespaces to false by default (#22046)
Fixes #22027

PR Close #22046
2018-02-16 09:06:14 -08:00
Victor Berchet 5dd2b5135d refactor(ivy): rename `bindX()` functions to `interpolationX()` (#22229)
rationale: remove the confusion with `bind()` and `bind0()`

PR Close #22229
2018-02-15 14:20:53 -08:00
Alex Rickabaugh 7ac34e42a0 feat: allow direct scoping of @Injectables to the root injector (#22185)
@Injectable() supports a scope parameter which specifies the target module.
However, it's still difficult to specify that a particular service belongs
in the root injector. A developer attempting to ensure that must either
also provide a module intended for placement in the root injector or target
a module known to already be in the root injector (e.g. BrowserModule).
Both of these strategies are cumbersome and brittle.

Instead, this commit adds a token APP_ROOT_SCOPE which provides a
straightforward way of targeting the root injector directly, without
requiring special knowledge of modules within it.

PR Close #22185
2018-02-15 14:20:27 -08:00
Kara Erickson a589ca0adb test(ivy): clean up canonical spec (#22188)
PR Close #22188
2018-02-13 13:04:43 -08:00
Miško Hevery 20a900b648 test: Add bundle symbol extractor tool (#22002)
This tool will be used for extracting symbols out of bundles so that
we can assert that only whitelisted symbols are allowed.

PR Close #22002
2018-02-13 11:28:54 -08:00
guillaumebarranco 16d1700a8e fix(core): add stacktrace in log when error during cleanup component in TestBed (#22162)
PR Close #22162
2018-02-13 11:28:08 -08:00
Kara 5e4af7c550 fix(ivy): o2+ should work with multiple template instances (#22075)
Closes #22075
2018-02-13 10:24:41 -08:00
Alex Rickabaugh 235a235fab feat: change @Injectable() to support tree-shakeable tokens (#22005)
This commit bundles 3 important changes, with the goal of enabling tree-shaking
of services which are never injected. Ordinarily, this tree-shaking is prevented
by the existence of a hard dependency on the service by the module in which it
is declared.

Firstly, @Injectable() is modified to accept a 'scope' parameter, which points
to an @NgModule(). This reverses the dependency edge, permitting the module to
not depend on the service which it "provides".

Secondly, the runtime is modified to understand the new relationship created
above. When a module receives a request to inject a token, and cannot find that
token in its list of providers, it will then look at the token for a special
ngInjectableDef field which indicates which module the token is scoped to. If
that module happens to be in the injector, it will behave as if the token
itself was in the injector to begin with.

Thirdly, the compiler is modified to read the @Injectable() metadata and to
generate the special ngInjectableDef field as part of TS compilation, using the
PartialModules system.

Additionally, this commit adds several unit and integration tests of various
flavors to test this change.

PR Close #22005
2018-02-12 14:34:59 -08:00
Kara Erickson d9ae70c699 test(ivy): normalize template names in canonical spec (#21815)
PR Close #21815
2018-02-08 08:55:40 -08:00
Victor Berchet 3f5a3d6ea1 refactor(ivy): add internal `isProceduralRenderer()` (#22055)
PR Close #22055
2018-02-07 17:03:25 -08:00
Victor Berchet 10a014d89e refactor(ivy): prefix viewStart & viewEnd with embedded (#22055)
PR Close #22055
2018-02-07 17:03:25 -08:00
Victor Berchet 8feb8e5408 refactor(ivy): use long instruction format in tests (#22055)
PR Close #22055
2018-02-07 17:03:25 -08:00
Alex Eagle 16e5b866d2 test(ivy): also track the size of the compressed hello world bundle (#22056)
PR Close #22056
2018-02-07 16:10:00 -08:00
Kara Erickson b58c3527e9 test(ivy): add canonical spec for object literals (#22045)
PR Close #22045
2018-02-07 12:10:16 -08:00
Miško Hevery efc67ee5ef fix(ivy): make pipe invocation locality neutral (#22030)
PR Close #22030
2018-02-07 12:09:56 -08:00
Emilio e56de1025a fix(core): ensure initial value of QueryList length (#21980) (#21982)
Set initial value of `length` to `0`.

Fixes regression introduced by e544742156 (diff-a85dbe0991a7577ea24b49374e9ae90b) where the `length` property ceased to have initial value.

Closes #21980

PR Close #21982
2018-02-07 12:08:44 -08:00
Alex Eagle 370ab66c4f build(ivy): create hello world rollup (#22004)
This is a customization of the rollup_bundle rule from rules_nodejs
which adds the build-optimizer as a plugin.

Add a functional test with fast round-trip that asserts the minified app
still works.

Publish the min.js artifact on circleCI so we can track its size.

PR Close #22004
2018-02-06 08:25:22 -08:00
Kara Erickson 4d62be69c5 feat(ivy): memoize array literals in render3 (#21973)
PR Close #21973
2018-02-06 08:01:52 -08:00
Martin Sikora e81606c97a fix(core): fix proper propagation of subscriptions in EventEmitter (#22016)
Closes #21999

PR Close #22016
2018-02-06 07:56:33 -08:00
Misko Hevery 743d8bc845 feat(ivy): add canonical example of a pipe. (#21834)
PR Close #21834
2018-02-02 07:51:23 -08:00
Chuck Jazdzewski 65cf1add97 fix(ivy): remove unnecessary parameter of NgOnChangesFeature (#21879)
PR Close #21879
2018-02-01 08:33:36 -08:00
Pawel Kozlowski 1aa2947f70 feat(ivy): add support for attributes on ng-content nodes (#21935)
By adding attributes on the <ng-content> element template authors
can decide how content should be re-projected (or, in other words:
which selectors should match re-projected content).

PR Close #21935
2018-02-01 08:30:26 -08:00
Kara Erickson 81306c1f61 feat(ivy): add support for content query (#21912)
PR Close #21912
2018-01-31 10:19:15 -08:00
Kara Erickson 0365592119 test(ivy): add canonical view query example (#21912)
PR Close #21912
2018-01-31 10:19:15 -08:00
Pawel Kozlowski 285dd6be34 feat(ivy): observable QueryList (#21859)
PR Close #21859
2018-01-30 11:43:38 -08:00
Chuck Jazdzewski d364117aa8 fix(ivy): correct errors in template variable specification (#21759)
PR Close #21759
2018-01-27 10:49:30 -08:00
Pawel Kozlowski 6245637e81 fix(ivy): correct query read logic after merges (#21749)
PR Close #21749
2018-01-27 10:49:09 -08:00
David-Emmanuel Divernois 1278cca883 perf(ivy): removes generation of comments (#21638)
PR Close #21638
2018-01-27 10:48:39 -08:00
Victor Berchet 2af19c96f2 fix(core): fix retrieving the binding name when an expression changes (#21814)
fixes #21735
fixes #21788

PR Close #21814
2018-01-26 15:34:47 -08:00