71 Commits

Author SHA1 Message Date
Kristiyan Kostadinov
d144a3bd91 fix(ivy): not throwing error for unknown properties on container nodes ()
Fixes Ivy not throwing an error if it runs into an invalid property binding on a container node (e.g. `<div *ngFor="let row of rows">` instead of `<div *ngFor="let row if rows">`).

This PR resolves FW-1219.

PR Close 
2019-04-08 12:03:34 -07:00
Adam Plumer
7b70760c8d refactor: move DOCUMENT imports from platform-browser to common ()
PR Close 
2019-03-14 16:01:57 -04:00
Andrew Kushnir
fe76494759 fix(ivy): use default selector for Components if selector is empty ()
Prior to this change default selector for Components was not applied in case selector is missing or defined as an empty string. This update aligns this behavior between Ivy and VE: now default selector is used for Components when it's needed. Directives with empty selector are not allowed and trigger a compile-time error in both Ivy and VE.

PR Close 
2019-03-12 14:09:46 -07:00
Kara Erickson
1950e2d9ba fix(ivy): throw on bindings to unknown properties ()
This commit adds a devMode-only check which will throw if a user
attempts to bind a property that does not match a directive
input or a known HTML property.

Example:
```
<div [unknownProp]="someValue"></div>
```

The above will throw because "unknownProp" is not a known
property of HTMLDivElement.

This check is similar to the check executed in View Engine during
template parsing, but occurs at runtime instead of compile-time.

Note: This change uncovered an existing bug with host binding
inheritance, so some Material tests had to be turned off. They
will be fixed in an upcoming PR.

PR Close 
2019-02-07 12:37:32 -08:00
Kara Erickson
5c4d95541e fix(ivy): mark views dirty by default when events fire ()
In Ivy, we support a new manual mode that allows for stricter control
over change detection in OnPush components. Specifically, in this mode,
events do not automatically mark OnPush views as dirty. Only changed
inputs and manual calls to `markDirty()` actually mark a view dirty.

However, this mode cannot be the default for OnPush components if we
want to be backwards compatible with View Engine. This commit re-adds
the legacy logic for OnPush components where events always mark views
dirty and makes it the default behavior.

Note: It is still TODO to add a public API for manual change detection.

PR Close 
2019-02-01 15:48:06 -05:00
Andrew Kushnir
76cedb8bf3 fix(ivy): verify Host Bindings and Host Listeners before compiling them ()
Prior to this change we may encounter some errors (like pipes being used where they should not be used) while compiling Host Bindings and Listeners. With this update we move validation logic to the analyze phase and throw an error if something is wrong. This also aligns error messages between Ivy and VE.

PR Close 
2019-01-29 16:36:22 -08:00
Kara Erickson
46aec4a58f feat(ivy): support host properties in DebugElement.properties ()
DebugElement.properties should contain a map of element
property names to element property values, with entries
for both normal property bindings and host bindings.
Many Angular core tests depend on this map being present.

This commit adds support for host property bindings in
DebugElement.properties, which fixes the Angular core tests.
There is still work to be done for normal property bindings.

PR Close 
2019-01-25 12:39:01 -08:00
Kristiyan Kostadinov
9f9024b7a1 fix(ivy): handle namespaces in attributes ()
Adds handling for namespaced attributes when generating the template and in the `elementAttribute` instruction.

PR Close 
2019-01-23 11:58:41 -08:00
Ben Lesh
2b9cc8503d fix(ivy): Ensure proper namespace is used to create elements in JIT ()
PR Close 
2019-01-18 09:56:41 -08:00
Kristiyan Kostadinov
bac71ef419 fix(ivy): componentFactories not populated in ModuleWithComponentFactories ()
Fixes the `ModuleWithComponentFactories.componentFactories` not being populated when calling `compileModuleAndAllComponentsSync` in Ivy.

These changes resolve FW-929.

PR Close 
2019-01-16 09:52:15 -08:00
crisbeto
da8ee29e72 fix(ivy): throw meaningful error for uninitialized output ()
Throws a similar error to ViewEngine when encountering an `@Output` that hasn't been initialized to an `Observable`.

These changes resolve FW-680.

PR Close 
2019-01-15 09:47:21 -08:00
Kristiyan Kostadinov
b6510a320b fix(ivy): debug node references not returning template ref ()
Fixes the `DebugNode.references` returning a reference to the underlying comment node, rather than the `TemplateRef` that the reference is pointing to. The issue comes from the fact that `discoverLocalRefs` falls back directly to returning the native node, if the ref isn't pointing to a directive, rather than looking through the locals.

These changes resolve FW-870.

PR Close 
2019-01-14 17:11:11 -08:00
Kristiyan Kostadinov
9277142d54 fix(ivy): support multiple exportAs ()
Allows for multiple, comma-separated `exportAs` names, similarly to `ViewEngine`.

These changes fix FW-708.

PR Close 
2019-01-10 16:53:26 -08:00
Misko Hevery
885f1af509 build: extract interface and util sub compilation from core ()
PR Close 
2019-01-10 16:31:44 -08:00
Marc Laval
76ed13bffe fix(ivy): directives without selector should not be supported ()
PR Close 
2019-01-10 10:51:30 -08:00
Kara Erickson
cea3b8f885 test(ivy): update root cause of linker test ()
PR Close 
2019-01-09 10:33:54 -08:00
Andrew Kushnir
6e7c46af1b fix(ivy): adding event listeners for global objects (window, document, body) ()
This update introduces support for global object (window, document, body) listeners, that can be defined via host listeners on Components and Directives.

PR Close 
2019-01-08 10:33:17 -08:00
Pawel Kozlowski
45880532bf test(ivy): update root causes for @angular/core tests ()
PR Close 
2019-01-07 08:44:57 -08:00
Pawel Kozlowski
cdd737e28b test(ivy): mark tests using getDebugContext as obsolete in ivy ()
PR Close 
2018-12-21 15:07:31 -05:00
Matias Niemelä
880e8a5cfc refactor: fix broken formatting 2018-12-20 09:16:09 -08:00
Kristiyan Kostadinov
a833b98fd0 fix(ivy): change detection strategy not being passed to compiler ()
Fixes the defined change detection strategy not being passed to the compiler when a component is being compiled.

PR Close 
2018-12-20 12:00:58 -05:00
Kara Erickson
99d0e27587 test(ivy): update root cause for core test ()
PR Close 
2018-12-20 11:58:14 -05:00
Matias Niemelä
3ab25ab078 refactor: fix broken linting rules due to revert 2018-12-19 13:06:43 -08:00
Marc Laval
8f8572fd3e fix(ivy): @Host should behave as in View Engine ()
PR Close 
2018-12-19 15:12:35 -05:00
Alex Eagle
e8f7241366 build: fix our copy of Array#find typing ()
It should be nullable, matching the lib.es2015.d.ts from TypeScript

PR Close 
2018-12-19 15:11:52 -05:00
Olivier Combe
4c1cd1bb78 feat(ivy): support context discovery for containers & ICU expressions ()
Context discovery was only available on elements. This PR adds support for containers and ICU expressions.
FW-378 #resolve
FW-665 #comment linker integration tests

PR Close 
2018-12-17 16:47:29 -08:00
Miško Hevery
e94975d109 fix(ivy): check semantics of NgModule for consistency ()
`NgModule` requires that `Component`s/`Directive`s/`Pipe`s are listed in
declarations, and that each `Component`s/`Directive`s/`Pipe` is declared
in exactly one `NgModule`. This change adds runtime checks to ensure
that these sementics are true at runtime.

There will need to be seperate set of checks for the AoT path of the
codebase to verify that same set of semantics hold. Due to current
design there does not seem to be an easy way to share the two checks
because JIT deal with references where as AoT deals with AST nodes.

PR Close 
2018-12-17 14:49:51 -08:00
Pawel Kozlowski
b00aeeff37 fix(ivy): properly destroy views created by ComponentFactory ()
PR Close 
2018-12-14 15:22:11 -08:00
Pawel Kozlowski
28ceca0163 test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-12-12 11:02:03 -08:00
Kara Erickson
452668b581 fix(ivy): host bindings should work if input has same name ()
Previously in Ivy, host bindings did not work if they shared a public name
with an Input because they used the `elementProperty` instruction as is.
This instruction was originally built for inside component templates, so it
would either set a directive input OR a native property. This is the
correct behavior for inside a template, but for host bindings, we always
want the native properties to be set regardless of the presence of an Input.

This change adds an extra argument to `elementProperty` so we can tell it to
ignore directive inputs and only set native properties (if it is in the
context of a host binding).

PR Close 
2018-12-11 11:27:08 -08:00
Pawel Kozlowski
5657126d86 test(ivy): run browser-specific @angular/core tests on CI ()
PR Close 
2018-12-07 09:24:15 -08:00
Pawel Kozlowski
913563a41d test(ivy): finish root cause analysis for @angular/core TestBed failing tests ()
PR Close 
2018-12-06 13:41:02 -08:00
Pawel Kozlowski
821fecb413 test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-12-05 11:24:06 -08:00
Olivier Combe
2bc39860bb feat(ivy): support inputs & outputs with aliases in component decorators ()
PR Close 
2018-12-05 10:40:08 -08:00
Olivier Combe
1279a503a1 feat(ivy): add ng-reflect debug text for containers ()
PR Close 
2018-12-05 10:40:08 -08:00
Misko Hevery
f52600e261 test(ivy): add ability to find already passing tests ()
PR Close 
2018-12-05 09:34:52 -08:00
Andrew Kushnir
8e644d99fc fix(ivy): taking "interpolation" config option into account (FW-723) ()
PR Close 
2018-12-04 14:04:14 -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
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
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
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
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
Pawel Kozlowski
d666370e16 test(core): add JIRA references for root-casuse ivy TestBed failures ()
PR Close 
2018-11-21 09:18:54 -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
Miško Hevery
53e4e0c1a3 fix(ivy): Enable AoT tests to run on CI; disable failing tests ()
PR Close 
2018-11-07 10:35:20 -08: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
George Kalpakas
809e8f742e test: make NgMatchers type-aware ()
PR Close 
2018-07-06 13:48:02 -07:00