795 Commits

Author SHA1 Message Date
Miško Hevery
116946fb11 style: tslint enforces no debugger statements left behind ()
PR Close 
2018-08-16 16:00:22 -07:00
Misko Hevery
503905c807 feat(ivy): add ngcc ivy switch ()
Provides a runtime and compile time switch for ivy including
`ApplicationRef.bootstrapModule`.

This is done by naming the symbols such that `ngcc` (angular
Compatibility compiler) can rename symbols in such a way that running
`ngcc` command will switch the `@angular/core` module from `legacy` to
`ivy` mode.

This is done as follows:

```
const someToken__PRE_NGCC__ = ‘legacy mode’;
const someToken__POST_NGCC__ = ‘ivy mode’;

export someSymbol = someToken__PRE_NGCC__;
```

The `ngcc` will search for any token which ends with `__PRE_NGCC__`
and replace it with `__POST_NGCC__`. This allows the `@angular/core`
package to be rewritten to ivy mode post `ngcc` execution.

PR Close 
2018-08-16 13:51:42 -07:00
Kara Erickson
6482f6f0fe refactor(ivy): separate container into 2 instructions ()
PR Close 
2018-08-16 13:47:14 -07:00
Greg Magolan
9605456b66 build: refactor ambient node & jasmine types so they are only included where needed ()
PR Close 
2018-08-16 13:46:43 -07:00
Miško Hevery
9ee6702fa9 refactor(ivy): remove short instruction names as they provide no value ()
PR Close 
2018-08-16 11:04:34 -07:00
Victor Berchet
1f1103913a refactor(ivy): cleanup the public API for core/testing ()
PR Close 
2018-08-15 09:53:17 -07:00
Kieran Whiteman
be2cf4dfd6 docs(core): Correct spelling error in directives docs ()
Link to life-cycle hooks was spelt as "life-cycle hoooks".
PR Close 
2018-08-14 16:39:33 -07:00
Ben Lesh
a0a29fdd27 feat(ivy): Add AOT handling for bare classes with Input and Output decorators ()
PR Close 
2018-08-14 16:36:18 -07:00
Alex Rickabaugh
82e2725154 fix(ivy): handle the case where no base factory is found ()
When an Angular decorated class is inherited, it might be the case that
the entire inheritance chain actually has no constructor defined. In
that event, a factory which simply instantiates the type without any
arguments should be used.

PR Close 
2018-08-14 14:23:24 -07:00
Pawel Kozlowski
9117fa199c test(ivy): activate local references canonical spec ()
PR Close 
2018-08-14 12:01:55 -07:00
Pawel Kozlowski
0c4209f4b9 refactor(ivy): harmonize container and element / elementContainer signatures ()
PR Close 
2018-08-14 12:01:23 -07:00
Victor Berchet
14ac7ad6b4 feat(ivy): implement TestBed ()
PR Close 
2018-08-14 11:58:47 -07:00
Victor Berchet
85106375ac refactor(ivy): misc cleanup ()
PR Close 
2018-08-14 11:58:47 -07:00
Ben Lesh
bbb3f8fa60 docs(ivy): add better documentation around debugging ivy tests ()
PR Close 
2018-08-13 21:44:55 -07:00
Ben Lesh
1bb30147d3 fix(ivy): add typeof guard around ngDevMode for instances where we cannot set it in Node ()
PR Close 
2018-08-13 20:50:53 -07:00
Ben Lesh
97d8b5ed88 fix(ivy): reordering how root is acquired ()
PR Close 
2018-08-13 17:25:47 -07:00
Miško Hevery
2016afdbff fix(ivy): remove ivy dependency on ViewEngine's resolveRendererType2 ()
PR Close 
2018-08-10 13:32:04 -07:00
Kara Erickson
409860a4da fix(ivy): queries should be restored when view changes ()
PR Close 
2018-08-10 09:13:16 -07:00
Kara Erickson
2b128a47b9 refactor(ivy): queries should not rely on LNode ()
PR Close 
2018-08-10 09:13:16 -07:00
Pawel Kozlowski
2d759927d4 feat(ivy): add support for ng-container in the compiler ()
PR Close 
2018-08-09 13:13:04 -07:00
Alex Rickabaugh
33fd7e0784 fix(ivy): export NgModuleFactory via r3_symbols for core factories ()
When @angular/core is compiled by ngtsc, a factory file is generated
for ApplicationModule, that is currently invalid because r3_symbols
does not export NgModuleFactory. This change fixes that issue and
ensures the generated ngfactory file for @angular/core is valid.

PR Close 
2018-08-09 09:58:13 -07:00
Alex Rickabaugh
2befc65777 fix(ivy): ngtsc should pay attention to declaration order ()
When generating the 'directives:' property of ngComponentDef, ngtsc
needs to be conscious of declaration order. If a directive being
written into the array is declarated after the component currently
being compiled, then the entire directives array needs to be wrapped
in a closure.

This commit fixes ngtsc to pay attention to such ordering issues
within directives arrays.

PR Close 
2018-08-09 09:58:13 -07:00
Alex Rickabaugh
6f085f8610 fix(ivy): add missing exportAs field to ngDirectiveDef ()
This commit includes the missing exportAs field from @Directive and
propagates it into the ngDirectiveDef.

PR Close 
2018-08-09 09:58:13 -07:00
Alex Rickabaugh
5be186035f feat(ivy): enable inheritance of factory functions in definitions ()
This commit creates an API for factory functions which allows them
to be inherited from one another. To do so, it differentiates between
the factory function as a wrapper for a constructor and the factory
function in ngInjectableDefs which is determined by a default
provider.

The new form is:

factory: (t?) => new (t || SomeType)(inject(Dep1), inject(Dep2))

The 't' parameter allows for constructor inheritance. A subclass with
no declared constructor inherits its constructor from the superclass.
With the 't' parameter, a subclass can call the superclass' factory
function and use it to create an instance of the subclass.

For @Injectables with configured providers, the factory function is
of the form:

factory: (t?) => t ? constructorInject(t) : provider();

where constructorInject(t) creates an instance of 't' using the
naturally declared constructor of the type, and where provider()
creates an instance of the base type using the special declared
provider on @Injectable.

PR Close 
2018-08-09 09:58:13 -07:00
Pawel Kozlowski
9c92a6fc7a test(ivy): add test for <ng-container> and shallow queries ()
PR Close 
2018-08-09 07:35:01 -07:00
Miško Hevery
b64fed1ba3 fix(ivy): prevent ngDevMode from getting removed too early ()
PR Close 
2018-08-08 13:13:16 -07:00
Igor Minar
74518c4b2e style: fix whitespace and indentation in the testing guide ()
PR Close 
2018-08-08 13:11:15 -07:00
JiaLi.Passion
ebf508fcd0 docs: add docs for fakeAsync test with custom macroTask in aio ()
PR Close 
2018-08-08 13:11:15 -07:00
Roope Hakulinen
732026c3f5 feat(core): add DoBootstrap interface. ()
Closes .

PR Close 
2018-08-07 13:17:06 -07:00
Pawel Kozlowski
af9ced9026 fix(ivy): project ng-container nodes ()
PR Close 
2018-08-07 12:02:48 -07:00
Pawel Kozlowski
dbdbbdbe86 fix(ivy): support ng-container inside another ng-container ()
PR Close 
2018-08-07 11:48:42 -07:00
Michael Giambalvo
16c03c0f38 fix(core): In Testability.whenStable update callback, pass more complete ()
data about tasks.

When building a list of pending tasks for callers of whenStable(),
Testability will copy data about the task into a new object, in order to
avoid leaking references to tasks.

This change copies more properties from Tasks into the list of pending
tasks, as well as a reference to Task.data to give callers more
information about the tasks that are pending.

Specifically, this also copies runCount and task ID, which are needed in
order for callers to know when a given task is repeating.

PR Close 
2018-08-06 13:49:19 -07:00
Pawel Kozlowski
3355502f2f fix(ivy): support ng-container at the root of a view with delayed insertion ()
PR Close 
2018-08-06 13:47:44 -07:00
vincecampanale
4933e103d3 docs(core): clarify supported ViewChild selectors ()
PR Close 
2018-08-06 13:40:47 -07:00
Vani
7d006c5005 docs(core): fix tree-shakable spelling ()
PR Close 
2018-08-06 13:40:15 -07:00
Vani
67ad59c245 docs: standardize spelling of tree-shakable ()
PR Close 
2018-08-06 13:40:15 -07:00
Jessy Cormier
c1587029db docs: add missing word in outputs description. ()
PR Close 
2018-08-06 13:36:49 -07:00
Victor Berchet
aea8832243 refactor(ivy): misc cleanup ()
PR Close 
2018-08-05 15:31:19 -07:00
Victor Berchet
1e7ca22078 refactor(ivy): make all directives public by default ()
To match the View Engine behavior.

We should make this configurable so that the node injector is tree shaken when
directives do not need to be published.

PR Close 
2018-08-05 15:31:19 -07:00
JoostK
4e264781ee refactor(ivy): do not mention LViewData in public documentation ()
PR Close 
2018-08-03 14:48:11 -07:00
Victor Berchet
afa6b9e794 fix(ivy): execute the optional begin and end methods of the rendererFactory ()
This is required to i.e. flush animations when using a Renderer2.
`rf.begin()` and `rf.end()` around the change detection.

PR Close 
2018-08-03 10:17:13 -07:00
Victor Berchet
b38931b484 fix(ivy): use devModeEqual in no change mode ()
To avoid the unfamous error `Expression has changed after it was checked.`

PR Close 
2018-08-02 22:57:28 -07:00
Kara Erickson
1fb7111da1 fix(ivy): content query results should be available in content hooks ()
PR Close 
2018-08-02 19:32:09 -07:00
Pawel Kozlowski
c2c12e52fe feat(ivy): support ng-container as a child of an already inserted view ()
PR Close 
2018-08-02 18:50:03 -07:00
Pawel Kozlowski
28c7a4efbc feat(ivy): add basic support for ng-container ()
This commit adds basic support for <ng-container> - most of the
functionality should work as long as <ng-container> is a child of
a regular element.

PR Close 
2018-08-02 18:50:03 -07:00
Aldo Roman Nureña
183757daa2 fix(core): fix tests for uninitialized @Output error ()
PR Close 
2018-08-02 09:37:21 -07:00
Aldo Roman
adf510f986 fix(core): throw error message when @Output not initialized ()
Closes 

PR Close 
2018-08-02 09:37:21 -07:00
Victor Berchet
d46a961509 docs(ivy): API doc tweaks ()
PR Close 
2018-08-01 16:19:54 -07:00
Greg Magolan
7d6b258778 build: revert yarn.lock rxjs version to 6.0.0 ()
PR Close 
2018-08-01 13:23:35 -07:00
mhartington
2b6e1f0f4b docs(core): remove experimental tag ()
Remove experimental note on APP_INITIALIZER.

PR Close 
2018-08-01 10:56:06 -07:00