719 Commits

Author SHA1 Message Date
George Kalpakas
56f8c23adf test(ivy): add tests for ComponentFactory#create() fix in ()
PR Close 
2018-12-04 14:03:44 -08:00
JoostK
6552471c49 fix(ivy): account for useValue: undefined providers in module injector ()
PR Close 
2018-12-03 14:39:25 -08:00
Kristiyan Kostadinov
7ec05b4d8c fix(ivy): run initialializers in TestBed on init ()
Fixes the initializers not being run by `TestBed` when creating a fixture.

PR Close 
2018-12-03 14:37:49 -08:00
Andrew Kushnir
8eb102ab10 fix(ivy): avoid counting style/class bindings in component/directive hostBindings ()
PR Close 
2018-12-03 14:37:30 -08:00
Kara Erickson
2a39425e48 fix(ivy): temporary hack to set host styles and static classes ()
PR Close 
2018-12-03 11:05:36 -08:00
Andrew Kushnir
6f5c124fe9 fix(ivy): proper accounting of host vars in case of inherited Directives ()
Prior to this change, the number of host vars stored for directives with `hostBindings` in expando block was incorrect for inherited directives (in case both parent and child directive have `hostBindings` defined). Now if we identify that we already added a `hostBinding` into expando block, we just increase the corresponding number of host binding vars

PR Close 
2018-12-03 09:18:07 -08:00
Matias Niemelä
a082f6484a fix(ivy): fix style prop instructions to account for zero-based values ()
PR Close 
2018-12-03 08:23:23 -08:00
Pawel Kozlowski
a1470c94a6 test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-12-03 08:19:56 -08:00
Andrew Kushnir
a088b8c203 feat(ivy): introduce "allocHostVars" instruction as a replacement for "hostVars" field (FW-692) ()
PR Close 
2018-11-30 14:03:12 -08:00
Alex Rickabaugh
64a34616d8 fix(ivy): support string tokens in dependency injection ()
In Angular, it used to be an accepted practice to use strings as dependency
injection tokens. E.g. {provide: 'test', useValue: 'provided'}. However,
the Ivy node injection system did not support this. The Ivy DI system
attempts to patch a Bloom bit index onto each type registered with it, and
this patch operation does not work for a string token.

This commit adds string token support to the bloom filter system by
reserving bit 0 for string tokens. This eliminates the need for each string
token to store its own Bloom bit, at the expense of slightly more expensive
lookups of string tokens.

PR Close 
2018-11-30 14:00:23 -08:00
Pawel Kozlowski
1fa5478fef test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-11-30 13:41:21 -08:00
Kristiyan Kostadinov
23bc8edf24 test: move remaining fixmeIvy to test level ()
Moves all of the remaning `describe`-level fixme instances to the `it` level.

PR Close 
2018-11-29 21:28:01 -08:00
Misko Hevery
816ec0b1c3 refactor(ivy): treate LView as the primary global state ()
- rename `LViewData` to `LView` (to be consistent with `TView`)
- Remove `getRenderer`, `getRendererFactory`, `getTview`, `getCurrentQueries`,

PR Close 
2018-11-29 21:26:15 -08:00
Pawel Kozlowski
8ceea0f238 test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-11-29 21:21:13 -08:00
Andrew Kushnir
7773d7f552 fix(ivy): add polyfill for goog.getMsg to unblock tests (FW-663) ()
PR Close 
2018-11-28 11:40:56 -08:00
Pawel Kozlowski
7076773360 test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-11-28 11:38:51 -08:00
Misko Hevery
39e426cde3 fix(ivy): TestBed.get(Compiler) throws "Error: Runtime compiler is not loaded" ()
BREAKING CHANGE:

The public API for `DebugNode` was accidentally too broad. This change removes
1. Public constructor. Since `DebugNode` is a way for Angular to communicate information
   on to the developer there is no reason why the developer should ever need to
   Instantiate the `DebugNode`
2. We are also removing `removeChild`, `addChild`, `insertBefore`, and `insertChildAfter`.
   All of these methods are used by Angular to constructor the correct `DebugNode` tree.
   There is no reason why the developer should ever be constructing a `DebugNode` tree
   And these methods should have never been made public.
3. All properties have been change to `readonly` since `DebugNode` is used by Angular
   to communicate to developer and there is no reason why these APIs should be writable.

While technically breaking change we don’t expect anyone to be effected by this change.

PR Close 
2018-11-27 13:42:23 -08:00
Alex Rickabaugh
23b06af940 fix(core): export a value for InjectFlags ()
A recent commit (probably 2c7386c) has changed the import graph of the
DI types in core, and somehow results in the ngc compiler deciding to
re-export core DI types from application factories which tangentially
use inject(). This is not really surprising; ngc's import graph can be
very unstable.

However, this results in a re-export of InjectFlags surviving JS
compilation. InjectFlags was a const enum, akin to an interface in TS,
with no runtime repesentation. This causes a warning to be emitted by
Webpack when it sees the re-export of InjectFlags.

This commit avoids the issue by removing 'const' from the declaration
of InjectFlags, causing it to have a runtime value. This is a temporary
fix. The real fix will be for ngc to no longer write exports of const
enums.

Testing strategy: manually verified. Due to the problem only manifesting
when recompiling after a change and then running Webpack, there is no
existing framework via which this could be easily tested with an
integration test. Additionally, the potential for this issue is gone in
Ivy, so this solution is only temporarily needed.

Fixes .

PR Close 
2018-11-27 13:40:39 -08:00
Igor Minar
f7ba4b2ff9 fix(ivy): remove obsolete ng_module code for global and jit mode ()
These paths are no longer needed / used.

I had to disable one jit mode spec because it fails now that we actually run it.
I root caused the jit test failure as missing forwardRef support. See FW-645.

PR Close 
2018-11-27 10:30:58 -08:00
Igor Minar
d1227ec800 ci(ivy): packages/core/test/render3 now passes with ivy aot ()
PR Close 
2018-11-27 10:30:58 -08:00
Kristiyan Kostadinov
4622d0b23a fix(ivy): detach ViewRef from ApplicationRef on destroy ()
Currently we store the `_appRef` when a `ViewRef` is attached, however we don't use it for anything. These changes use it to detach the view from the `ApplicationRef` when it is destroyed. These changes also fix that the `ComponentRef` doesn't remove its `ViewRef` on destroy.

PR Close 
2018-11-27 10:24:53 -08:00
Pawel Kozlowski
0487fbe236 fix(ivy): throw a descriptive error when trying to insert / move destroyed view ()
PR Close 
2018-11-27 10:23:14 -08:00
Kara Erickson
d0e8020506 fix(ivy): blueprints should be synced whenever they are off ()
PR Close 
2018-11-27 10:22:03 -08:00
Kara Erickson
a7ba05ad82 fix(ivy): fix directive instantiation at slots above 2^12 ()
PR Close 
2018-11-27 10:20:02 -08:00
Olivier Combe
2fce701ced feat(ivy): enable ng-reflect debug attributes ()
PR Close 
2018-11-27 10:18:51 -08:00
Marc Laval
c2f30542e7 fix(ivy): should support components without selector ()
PR Close 
2018-11-27 10:17:35 -08:00
JoostK
d767e0b2c0 fix(ivy): consider providers for view/content queries ()
In ViewEngine it is possible to query for a token that is provided by
a directive that is in scope. See StackBlitz for example:
https://stackblitz.com/edit/ng-viewengine-viewchild-providers

Material uses this pattern with its `MatFormFieldControl` setup, see
https://bit.ly/2zgCUxD for documentation.

PR Close 
2018-11-27 10:16:57 -08:00
Pawel Kozlowski
9e5223eaba test(core): add more root causes for TestBed tests failures ()
PR Close 
2018-11-26 09:24:32 -08:00
Pawel Kozlowski
3c9ad1d231 fix(ivy): inject null for missing attributes ()
PR Close 
2018-11-26 09:23:56 -08:00
Andrew Kushnir
dc300c5c41 feat(ivy): render flags support in host bindings function (FW-649) ()
PR Close 
2018-11-21 15:33:47 -08:00
JoostK
c8c8648abf fix(ivy): prevent ngcc from referencing missing ɵsetClassMetadata ()
When ngtsc compiles @angular/core, it rewrites core imports to the
r3_symbols.ts file that exposes all internal symbols under their
external name. When creating the FESM bundle, the r3_symbols.ts file
causes the external symbol names to be rewritten to their internal name.

Under ngcc compilations of FESM bundles, the indirection of
r3_symbols.ts is no longer in place such that the external names are
retained in the bundle. Previously, the external name `ɵdefineNgModule`
was explicitly declared internally to resolve this issue, but the
recently added `setClassMetadata` was not declared as such, causing
runtime errors.

Instead of relying on the r3_symbols.ts file to perform the rewrite of
the external modules to their internal variants, the translation is
moved into the `ImportManager` during the compilation itself. This
avoids the need for providing the external name manually.

PR Close 
2018-11-21 09:20:11 -08:00
Pawel Kozlowski
d666370e16 test(core): add JIRA references for root-casuse ivy TestBed failures ()
PR Close 
2018-11-21 09:18:54 -08:00
Misko Hevery
e56c8bf8d1 fix(ivy): align discovery methods for consistency ()
PR Close 
2018-11-20 11:44:14 -08:00
Miško Hevery
ca40565f9a fix(ivy): hack implementation of host styles ()
PR Close 
2018-11-20 11:43:29 -08:00
Olivier Combe
bf3beb5959 fix(ivy): set ng-version attribute on root component ()
PR Close 
2018-11-20 10:43:51 -08:00
Andrew Kushnir
92e80af875 feat(ivy): ICU support for Ivy ()
PR Close 
2018-11-16 16:09:30 -08:00
Marc Laval
848f4148c0 fix(ivy): DI should work when no element injector on starting node ()
PR Close 
2018-11-16 09:26:29 -08:00
crisbeto
6574e61062 test(ivy): skip useJit tests with Ivy ()
Currently the `useJit` option from `TestBed.configureCompiler` isn't supported. These changes rework the existing test suites not to pass in `useJit` when running with Ivy.

PR Close 
2018-11-15 21:19:21 -08:00
Kara Erickson
ee12e725c0 fix(ivy): component ref injector should support change detector ref ()
PR Close 
2018-11-15 21:18:24 -08:00
Olivier Combe
e22a302cad feat(ivy): support for i18n & ICU expressions ()
PR Close 
2018-11-14 16:22:01 -08:00
Pawel Kozlowski
ce5242462b fix(ivy): implement rootNodes getter on ViewRef ()
PR Close 
2018-11-14 12:28:03 -08:00
Marc Laval
1c9e526a83 fix(ivy): use the root view injector when resolving dependencies ()
PR Close 
2018-11-14 12:26:36 -08:00
Miško Hevery
f8f1168fa6 Revert "feat(ivy): support for i18n & ICU expressions ()"
This reverts commit a63fd2d0f5f867ee17bf991a72ccbe6d6fa76566.
2018-11-14 10:23:21 -08:00
Olivier Combe
a63fd2d0f5 feat(ivy): support for i18n & ICU expressions ()
PR Close 
2018-11-13 14:50:30 -08:00
Kara Erickson
bc652a2943 fix(ivy): jit compilation should support content queries with type predicates ()
PR Close 
2018-11-13 12:18:13 -08:00
Kara Erickson
e6e590479e fix(ivy): support forward refs in @Inject annotations ()
PR Close 
2018-11-13 12:17:18 -08:00
Kara Erickson
123da1a8c2 test(ivy): split out provider tests ()
PR Close 
2018-11-13 12:17:18 -08:00
Kara Erickson
8b9249a670 fix(ivy): host bindings should support content children and content hooks ()
PR Close 
2018-11-12 14:26:06 -08:00
Kara Erickson
1810cdf2c3 fix(ivy): compiler should generate restoreView() for local refs in listeners ()
PR Close 
2018-11-12 12:50:58 -08:00
Kara Erickson
552836ebf0 fix(ivy): merged host bindings functions should take superclass hostVars into account ()
PR Close 
2018-11-09 09:55:47 -08:00