Commit Graph

12720 Commits

Author SHA1 Message Date
Jason Aden 736cfa4e09 refactor(ivy): correct cyclical dependency (#28326)
PR Close #28326
2019-01-23 15:42:13 -08:00
Olivier Combe cbd626413c fix(ivy): link correct ngModule's injector to the bootstrapped component (#28183)
Previously, bootstrapping a component with render3 would create a chained injector with the test bed ngModule instead of the ngModule that the component belongs to.
Now when a component belongs to an ngModule, we use that for the chained injector, ensuring the correct injection of any providers that this ngModule contains.

FW-776 #resolve

PR Close #28183
2019-01-23 15:06:59 -08:00
Kara Erickson 317cc922ac test(ivy): turn on passing tests in platform-browser-dynamic (#28307)
PR Close #28307
2019-01-23 15:05:45 -08:00
Kristiyan Kostadinov f9b103825a fix(ivy): content projection with Shadow DOM not working (#28261)
Fixes components with native content projection (using `<content>` or `<slot>`) not working under Ivy.

The issue comes from the fact that when creating elements inside a component, we sometimes don't append the element immediately, but we leave it to projection to move it into its final destination. This ends up breaking the native projection, because the slots have to be in place from the beginning. The following changes switch to appending the element immediately when inside a component with Shadow DOM encapsulation.

This PR resolves FW-841.

PR Close #28261
2019-01-23 15:05:12 -08:00
Pawel Kozlowski 32c61f434c fix(ivy): ngUpgrade should distinguish element and module injectors (#28313)
There are cases where we should check an element injector but don't go
into the associated module injector if a token is not found. In both the
view engine and ngIvy this is acheived by passing the
`NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR` as the `notFoundValue`.

Before this fix the view engine and ngIvy were using different objects to
represent `NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR`. This was causing problems
as ngUpgrade is using `NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR` const in its
`NgAdapterInjector` to prevent searching of module injectors.

This commit makes sure that ngIvy is using the same object to represent
`NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR` as the view engine.

PR Close #28313
2019-01-23 15:01:22 -08:00
Kristiyan Kostadinov 22a43cff4d fix(ivy): error when encountering an empty class attribute (#28321)
Fixes Ivy throwing an error if it encounters an empty class attribute in a template (`class=""`).

This PR resolves FW-972.

PR Close #28321
2019-01-23 14:58:42 -08:00
Andrew Kushnir 9098225ff0 fix(ivy): View Queries inheritance fix (#28309)
Prior to this change `viewQuery` functions that represent @ViewQuery list were not composable, which caused problems in case one Component/Directive inherits another one and both of them contain View Queries. Due to the fact that we used indices to reference queries, resulting query set was corrupted (child component queries were overridden by super class ones). In order to avoid that we no longer use indices assigned at compile time and instead maintain current view query index while iterating through them. This allows us to compose `viewQuery` functions and make inheritance feature work with View Queries.

PR Close #28309
2019-01-23 14:57:17 -08:00
Kristiyan Kostadinov 9f9024b7a1 fix(ivy): handle namespaces in attributes (#28242)
Adds handling for namespaced attributes when generating the template and in the `elementAttribute` instruction.

PR Close #28242
2019-01-23 11:58:41 -08:00
William Neely 03c8528fcb docs(router): removed additional to (#25989)
PR Close #25989
2019-01-23 11:00:20 -08:00
Ben Lesh 5430d2bc66 fix(ivy): NgOnChangesFeature no longer included in hello_world (#28187)
- Wraps the NgOnChangesFeature in a factory such that no side effects occur in the module root
- Adds comments to ngInherit property on feature definition interface to help guide others not to make the same mistake
- Updates compiler to generate the feature properly after the change to it being a factory
- Updates appropriate tests

PR Close #28187
2019-01-23 10:59:34 -08:00
Ben Lesh a95e81978b refactor(ivy): Add newer, smaller NgOnChangesFeature (#28187)
PR Close #28187
2019-01-23 10:59:34 -08:00
Ben Lesh 5552661fd7 refactor(ivy): revert onChanges change back to a feature (#28187)
- adds fixmeIvy annotation to tests that should remain updated so we can resolve those issues in the subsequent commits

PR Close #28187
2019-01-23 10:59:33 -08:00
Andrew Kushnir 030350f53e fix(ivy): TestBed.get should be able to retrieve tokens from Compiler's injector (#28196)
This changes restores parity between VE TestBed and R3TestBed logic related to retrieving tokens using TestBed.get function. Now R3TestBed also tries to retrieve tokens from Compiler Injector.

PR Close #28196
2019-01-23 10:59:02 -08:00
Daniel Ruf 583061d043 refactor: remove unused parameter in _main method invocation (#28203)
PR Close #28203
2019-01-23 10:58:38 -08:00
Daniel Ruf 0a564c3158 refactor: fix code style (#28203)
PR Close #28203
2019-01-23 10:58:38 -08:00
Daniel Ruf b9854e582f refactor: remove unused parameters (#28203)
PR Close #28203
2019-01-23 10:58:37 -08:00
Pawel Kozlowski cf8770f3cc fix(ivy): don't create TNodes for native projectable nodes (#28275)
Before this commit we were creating a "fake" TNode for each and every
projectable node passed during dynamic component creation. This approach
had several problems:
- the existing TView structure had to be mutated to accomodate new TNodes and
it was very easy to "corrupt" TView / TNode data structures;
- TNodes are not really needed to fully support projectable nodes so we were
creating objects and updating existing data structures for nothing.

This commit changes the approach so we don't create "fake" TNodes for projectable
nodes but instead we process projectable nodes directly in the projection instruction.
As a result we've got less code, less object allocation and - as a bonus - we fix few
bugs where TView / TNode data structures were corrupted when using projectable nodes.

PR Close #28275
2019-01-23 10:56:09 -08:00
Kristiyan Kostadinov d8f2318811 fix(ivy): generating incorrect tag name with namespace (#28298)
Fixes the template generation function generating an incorrect tag name when the element has a namespace (e.g. `:svg:circle` gets generated rather than `circle`).

PR Close #28298
2019-01-23 10:55:44 -08:00
Pawel Kozlowski 1fd673504c build: update and unify gitignore (#28316)
PR Close #28316
2019-01-23 10:55:21 -08:00
Alex Rickabaugh 8f1198ffcd release: cut the v8.0.0-beta.1 release 2019-01-22 15:58:57 -08:00
Alex Rickabaugh fe9b3ea251 docs: release notes for the v7.2.2 release 2019-01-22 15:50:22 -08:00
Jason Aden 50df897fdc fix(router): `skipLocationChange` with named outlets (#28300)
With #27680, a bug was fixed where multiple redirects using `eager` URL update could cause navigation to fail. However, that fix introduced a problem where with `skipLocationChange` enabled, the URL tree rendered was not properly stored for reference. This specifically caused an issue with named router outlets and subsequent navigations not being recognized.

This PR stores the correct `UrlTree` for reference with later navigations. It fixes the regression introdued with #27680.

Fixes #28200

PR Close #28300
2019-01-22 15:15:02 -08:00
Jason Aden 33e49c2894 Revert "revert: fix(router): ensure URL is updated after second redirect with UrlUpdateStrategy="eager" (#27523)" (#28300)
This reverts commit eea2b0f288.

PR Close #28300
2019-01-22 15:15:02 -08:00
Kristiyan Kostadinov ea1b5c100f fix(ivy): not applying camelCased style properties (#28276)
Fixes Ivy not applying properties that are set in camelCase, because it goes through the `CSSStyleDeclaration` API via `setProperty` and `removeProperty` which requires for [the values to be in dash-case](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/setProperty).

**Note:** I opted to let the browser normalize the value, rather than convert it to dash-case during compile time, because there are some special cases like browser-prefixed properties where we might not normalize it in-line with the browser.

This PR fixes FW-579.

PR Close #28276
2019-01-22 12:29:14 -08:00
Sarun Intaralawan 18a9afc738 docs(core): deprecate ViewEncapsulation.Native (#26361)
PR Close #26361
2019-01-22 12:19:54 -08:00
Judy Bogart 589dd479e2 docs: add input docs (#27376)
PR Close #27376
2019-01-22 12:19:28 -08:00
Judy Bogart 661a98aeda docs: add api doc for ngif (#27376)
PR Close #27376
2019-01-22 12:19:28 -08:00
Judy Bogart 988243437a docs: add method doc (#27377)
PR Close #27377
2019-01-22 12:18:02 -08:00
Judy Bogart 3b9553bb17 docs: expand input descriptions (#27377)
PR Close #27377
2019-01-22 12:18:02 -08:00
Judy Bogart 522e4ea898 docs: add doc for TrackByFunction (#27377)
PR Close #27377
2019-01-22 12:18:02 -08:00
Judy Bogart b6819fe9bb docs: add inpur vars doc (#27377)
PR Close #27377
2019-01-22 12:18:02 -08:00
Judy Bogart 6c3b57a968 docs: add api doc for ngfor (#27377)
PR Close #27377
2019-01-22 12:18:02 -08:00
Judy Bogart 37f8263430 docs: correct array to map (#27379)
PR Close #27379
2019-01-22 12:16:45 -08:00
Judy Bogart a84a9ba705 docs: add input doc (#27379)
PR Close #27379
2019-01-22 12:16:45 -08:00
Judy Bogart d73734dcb7 docs: add api doc for ng_style directive (#27379)
PR Close #27379
2019-01-22 12:16:45 -08:00
Judy Bogart e0fbe8611e docs: add api doc to template_ref (#27380)
PR Close #27380
2019-01-22 12:13:50 -08:00
George Kalpakas 94e305f48e build: upgrade `cli-hello-world[-ivy]` integration projects to @angular/cli@7.2.1 (#27697)
PR Close #27697
2019-01-22 12:02:10 -08:00
Alex Rickabaugh 1964be0b17 feat(ivy): implement listLazyRoutes() for ngtsc (#27697)
This commit uses the NgModuleRouteAnalyzer introduced previously to
implement listLazyRoutes() for NgtscProgram. Currently this implementation
is limited to listing routes globally and cannot list routes for a given lazy
module. Testing seems to indicate that the CLI uses the global form, but this
should be verified.

Jira issue: FW-629

PR Close #27697
2019-01-22 12:02:10 -08:00
Alex Rickabaugh 41b2499f17 test(ivy): introduce route testing mode for ngtsc tests (#27697)
This commit introduces a new mode for the NgtscTestEnvironment which
builds the NgtscProgram and then asks for the list of lazy routes,
instead of running the TS emit phase.

PR Close #27697
2019-01-22 12:02:10 -08:00
Alex Rickabaugh da85cee07c feat(ivy): implement ngtsc's route analysis (#27697)
This commit introduces the NgModuleRouteAnalyzer & friends, which given
metadata about the NgModules in a program can extract the list of lazy
routes in the same format that the ngtools API uses.

PR Close #27697
2019-01-22 12:02:10 -08:00
George Kalpakas 2fc5f002e0 refactor(ivy): re-use the `ForeignFunctionResolver` interface when appropriate (#27697)
This makes the types (and intentions) more explicit and clear.

PR Close #27697
2019-01-22 12:02:10 -08:00
Alex Rickabaugh 19a2b783cf feat(ivy): create a ModuleResolver to map module paths to files (#27697)
PR Close #27697
2019-01-22 12:02:10 -08:00
Alex Rickabaugh 9e5016c845 feat(ivy): DynamicValue now indicates why the value is dynamic (#27697)
This commit changes the partial evaluation mechanism to propagate
DynamicValue errors internally during evaluation, and not to "poison"
entire data structures when a single value is dynamic. For example,
previously if any entry in an array was dynamic, evaluating the entire
array would return DynamicValue. Now, the array is returned with only
the specific dynamic entry as DynamicValue.

Instances of DynamicValue also report the node that was determined to
be dynamic, as well as a potential reason for the dynamic-ness. These
can be nested, so an expression `a + b` may have a DynamicValue that
indicates the 'a' term was DynamicValue, which will itself contain a
reason for the dynamic-ness.

This work was undertaken for the implementation of listLazyRoutes(),
which needs to partially evaluate provider arrays, parts of which are
dynamic and parts of which contain useful information.

PR Close #27697
2019-01-22 12:02:09 -08:00
Paul Gschwendtner 070fca1591 fix(ivy): ngtsc fails building flat module out on windows (#27993)
`ngtsc` currently fails building a flat module out file on Windows because it generates an invalid flat module TypeScript source file. e.g:

```ts
5 export * from './C:\Users\Paul\Desktop\test\src\export';
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

This is because `path.posix.relative` does not properly with non-posix paths, and only expects posix paths in order to work.

PR Close #27993
2019-01-22 11:49:53 -08:00
Sander Elias d336bff200 fix(ivy): add missging getDirectives export (#28259)
fix(ivy): expose missing getDirectives from dicovery_utils

PR Close #28259
2019-01-22 11:43:52 -08:00
Jason Aden f99082fd3c build: hide vscode settings e.g. debug launch config (#28299)
PR Close #28299
2019-01-22 11:38:15 -08:00
Kapunahele Wong 75074d009f docs: rewrite event binding section and add example (#26162)
PR Close #26162
2019-01-22 11:31:41 -08:00
Giorgos Bamparopoulos 197676a6dd docs: rename "internal" access modifier to "protected" (#26627)
PR Close #26627
2019-01-22 11:20:26 -08:00
Luiz Machado 1fb6731285 docs: fix crisis-detail milestone files (#27025)
Crisis Detail's template was being added two times and the component's TS none.
PR Close #27025
2019-01-22 11:19:51 -08:00
Hamza TEI 1df8be5573 docs: update link to post on redirects in router guide (#27256)
Change victor savkin's url post on redirects to:
http://vsavkin.tumblr.com/post/146722301646/angular-router-empty-paths-componentless-routes

PR Close #27256
2019-01-22 11:17:18 -08:00