2663 Commits

Author SHA1 Message Date
Marc Laval
f013c57186 test(router): correct a wrong test (FW-766) ()
PR Close 
2018-12-06 13:41:20 -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
Marc Laval
8fa7e93c30 test(ivy): enable router tests with pending timers (FW-768) ()
PR Close 
2018-12-06 13:40:42 -08:00
Andrew Kushnir
cad67148b1 fix(ivy): "select" attribute on <ng-content> should not be case-sensitive (FW-789) ()
While generating attributes for `projection` instruction, we checked whether attribute name is equal to 'select' in lower case. However in other cases we treat 'select' attribute name as case-insensitive. This PR makes 'select' attribute consistently case-insensitive.

PR Close 
2018-12-06 13:40:15 -08:00
Andrew Kushnir
c71d7b5633 fix(ivy): setting up animation properties correctly (FW-643) ()
Prior to this change, animation properties were defined as element attributes, which caused errors at runtime. Now all animation-related attributes are defined as element properties.

Also as a part of this update, we start to account for bindings used in animations, which was previously missing.

PR Close 
2018-12-06 13:38:40 -08:00
Keen Yee Liau
4da739a970 fix(bazel): Respect existing angular installation ()
If user has already installed Angular, Bazel should fetch the same
version. Otherwise, user will see an error in the post-install step
that performs version check.

PR Close 
2018-12-06 13:36:19 -08:00
Sander Elias
21d13dd15a fix(ivy): Added missing getHostElement to export ()
PR Close 
2018-12-06 13:35:41 -08:00
Marc Laval
8e9858fadb fix(ivy): align NgModuleRef implementation between Ivy and ViewEngine ()
Solves FW-765 and FW-767

PR Close 
2018-12-06 13:35:08 -08:00
JoostK
159ab1c257 fix(ivy): ngtsc should include generic types on injectable definitions ()
Analogously to directives, the `ngInjectableDef` field in .d.ts files is
annotated with the type of service that it represents. If the service
contains required generic type arguments, these must be included in
the .d.ts file.

PR Close 
2018-12-06 13:33:13 -08:00
Kara Erickson
160cace336 test(ivy): fix query compliance spec ()
PR Close 
2018-12-06 09:26:57 -08:00
Paul Gschwendtner
ca1c430f30 fix(compiler-cli): ngtsc shim files not being generated on case-insensitive platforms ()
Common insensitive platforms are `win32/win64` (see:
[here](3e4c5c95ab/src/compiler/sys.ts (L681-L682)))

Currently when running `bazel build packages/core --define=compile=aot`, the `compiler-cli` will throw because it cannot find the `index.ngfactory.ts` file in the compiler host. This is because the shim host wrapper is not properly generating the requested `ngfactory` file.

This happens because we call `getCanonicalFileName` that returns a path that is different to the actual program filenames that are used to construct a map of generated files. Since the generators always use the paths which are not "canonical" and pases them internally like that, we can just stop manually calling `getCanonicalFileName`.

PR Close 
2018-12-06 09:24:52 -08:00
Igor Minar
091a504377 Revert "fix(router): change processing url tree children condition ()" ()
This reverts commit ccc77ca441ae11d2b516806b4b1c1b7b3062b896.

Breaks Pantheon see cl/224256517.

PR Close 
2018-12-06 09:17:20 -08:00
Igor Minar
4f61832d1c Revert "fix(router): process empty path segment when preceding a named outlet ()" ()
This reverts commit 20cef5078dc86bc5d9831fafec076d912ad3521f.

Breaks Pantheon see cl/224256517.

PR Close 
2018-12-06 09:17:20 -08:00
Igor Minar
917a7884be test(benchpress): make most of the tests run under bazel ()
PR Close 
2018-12-05 20:55:32 -08:00
Igor Minar
dacf58eb99 docs: remove obsolete packages/examples/web_workers/ts/.gitkeep ()
PR Close 
2018-12-05 20:55:32 -08:00
Igor Minar
21f6daf0bb test: correct bazel visibility for @angular/private/testing ()
we don't want anyone else to depened on this stuff.

PR Close 
2018-12-05 20:55:32 -08:00
Igor Minar
95f8b63265 test(service-worker): run the remaining service-worker tests under bazel ()
PR Close 
2018-12-05 20:55:31 -08:00
Igor Minar
4f81a7c590 test(common): run @angular/common/http/testing tests under bazel ()
PR Close 
2018-12-05 20:55:31 -08:00
Andrew Kushnir
a315dedb85 fix(ivy): fix fixmeIvy invocations in "platform-browser" tests ()
Some "platform-browser" tests were updated before `fixmeIvy` function contract was changed to `fixmeIvy(...).it(...)`, thus triggering failed tests to run on CI. This commit updates these cases to invoke `fixmeIvy` correctly.

PR Close 
2018-12-05 16:33:27 -08:00
Alex Rickabaugh
f514ac3da2 test(ivy): enable //packages/router/test/aot_ngsummary_test in Ivy mode ()
This commit enables the above test to run under --define=compile=aot.
To accomplish this, one import is rewritten from a strange form to the
correct absolute form.

FW-658 #resolve

PR Close 
2018-12-05 16:26:39 -08:00
Alex Rickabaugh
0ae8c08b3c build(ivy): expect factories and summaries in Ivy mode ()
Previously, Bazel/Blaze were only expecting .ngfactory.js and .ngsummary.js
files to be generated in legacy mode. ngtsc was attempting to write those
files, but they ended up being ignored at the Bazel level.

This commit causes Bazel to expect these files, and rearranges the logic
a little bit as the name 'include_ng_files' is now incorrect.

FW-514 FW-737 #resolve

PR Close 
2018-12-05 16:26:39 -08:00
Alex Rickabaugh
276bdd1f3e fix(ivy): move the generation of ɵNonEmptyModule to shim construction ()
ngfactory files have a ɵNonEmptyModule constant included if there are no
other exported factory symbols. Previously this extra export was added
dynamically in a TS transformer.

However, synthetically constructed exports don't get properly downleveled
during JS emit, and this generated constant caused issues with downstream
tests.

Instead, this commit configures the shim to always have this export to
begin with, and to filter it out if it's not required.

Testing strategy: covered by existing ngtsc_spec tests which verify the
presence of the ɵNonEmptyModule symbol.

PR Close 
2018-12-05 16:26:39 -08:00
Alex Rickabaugh
d553ec2f36 fix(ivy): generate correct moduleNames for factories and summaries ()
In ngtsc, files loaded into the ts.Program have a "module name", set via
ts.SourceFile.moduleName, which ends up being written into an AMD module
name triple-slash directive in the generated .js file.

For generated shim files (ngfactories, ngsummaries) that are constructed
synthetically, there was previously no moduleName set, which caused some
issues with downstream tests.

This commit adds logic to compute and set moduleNames for both generated
ngfactory and ngsummary shims.

PR Close 
2018-12-05 16:26:39 -08:00
Alex Rickabaugh
dfdaaf6a0d fix(ivy): deduplicate directives in component scopes ()
A previous fix to ngtsc opened the door for duplicate directives in
the 'directives' array of a component. This would happen if the directive
was declared in a module which was imported more than once within the
component's module.

This commit adds deduplication when the component's scope is materialized,
so declarations which arrive via more than one module import are coalesced.

PR Close 
2018-12-05 14:36:24 -08:00
Olivier Combe
b82f62a11d test(ivy): enable ivy tests for platform-browser/animations ()
PR Close 
2018-12-05 14:35:23 -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
Alex Rickabaugh
8f425701e4 test(ivy): enable //packages/bazel/test/ngc-wrapped/... tests for Ivy ()
This commit allows //packages/bazel/test/ngc-wrapped/... tests to run
under Ivy mode. To get them to pass, it addresses a problem with the
way the tests are configured: both test targets have sloppy .d.ts
dependencies configured, leading to many type errors being generated
in TypeScript for the .d.ts files.

Due to the way ngc directs TypeScript emit, it avoids type-checking
.d.ts files and thus this issue does not surface. ngtsc does a whole-
program emit which results in full .d.ts type-checking by default,
catching this configuration issue.

To fix this, skipLibCheck is added to the tsconfig.jsons for these
tests, which tells TypeScript to skip type-checking of the .d.ts files,
avoiding this problem in a similar way to ngc.

PR Close 
2018-12-05 10:46:51 -08:00
Alex Rickabaugh
0d8ab323a7 fix(ivy): add missing directoryExists() method to shim CompilerHost ()
The method `ts.CompilerHost.directoryExists` is optional, and was not
previously handled by our ts.CompilerHost wrapper for factory and
summary shims (GeneratedShimsHostWrapper).

TypeScript checks for the existence of this method and silently ignores
things like typeRoots if it's not found. This commit adds proper handling
of directoryExists() to the shim.

A test is also added which verifies typeRoots behavior works when shims
are enabled.

PR Close 
2018-12-05 10:46:51 -08:00
Alex Rickabaugh
345bdd3db0 fix(ivy): generate empty ngfactory files if needed ()
Previously the ngfactory shim generator in ngtsc would always write two
imports in the factory file shims:

1) an import to @angular/core
2) an import to the base file

If the base file has no exports, import  would be empty. This turns out
to cause issues downstream.

This commit changes the generated shim so if there are no exports in the
base file, the generated shim is empty too.

PR Close 
2018-12-05 10:46:51 -08:00
Jason Aden
d70a7f3ac9 feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAndResolvers ()
This option means guards and resolvers will ignore changes to matrix parameters. Guards and resolvers will be rerun when the path changes, when path parameters change, or when query parameters change.

The primary use case for such a mode is when updating the UI and getting the URL to be in sync with local changes. For example, if displaying a sortable table, changing the sort direction is often handled by the table itself. But you would want to update the URL to be in sync with what's being displayed to the user. As long as the table sort direction is stored as a matrix parameter, you can use this option to update the URL without causing the overhead of re-running guards and resolvers.

Related to  

PR Close 
2018-12-05 10:43:29 -08:00
Ben Lesh
cd858323f2 feat(ivy): Forward refs now supported ()
Adds deferred execution of scope setting for modules such that forward refs can be supported in ivy. Design docs can be found at https://docs.google.com/document/d/11KTbybis9rt0cZgMKd1wo_IKb6y1PMU-RoTDVLTXK4Y/edit#

PR Close 
2018-12-05 10:41:24 -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
miginmrs
20cef5078d fix(router): process empty path segment when preceding a named outlet ()
PR Close 

PR Close 
2018-12-05 10:39:30 -08:00
miginmrs
ccc77ca441 fix(router): change processing url tree children condition ()
stop adding next path of pathless activated route to the url

PR Close 

PR Close 
2018-12-05 10:39:30 -08:00
Misko Hevery
f52600e261 test(ivy): add ability to find already passing tests ()
PR Close 
2018-12-05 09:34:52 -08:00
Miško Hevery
4b9948c1be fix(core): More precise return type for InjectableDecorator ()
closes 

PR Close 
2018-12-04 23:18:19 -08:00
Misko Hevery
faca8b1382 test(ivy): remove symbol tests which are too big and not useful ()
PR Close 
2018-12-04 23:17:52 -08:00
Andrew Kushnir
a3ee08968e fix(ivy): compiler compliance tests actualized ()
PR  introduced additional test case to make sure we generate `elementStyling` instructions with proper set of arguments (first argument was missing in some cases). It looks like that PR was created before we updated host vars count calculation and the `allocHostVars` becomes unnecessary in the test cases introduced in PR . This commit actualizes this test to get rid of unnecessary `allocHostVars` instruction.

PR Close 
2018-12-04 21:07:59 -08:00
Kristiyan Kostadinov
b6dbcf93a0 test(ivy): add root cause on tree shakable providers test ()
Adds the root cause on one of the failing NgModule tests.

PR Close 
2018-12-04 21:01:58 -08:00
Olivier Combe
9062b391a2 test(ivy): root cause analysis for platform-browser ()
PR Close 
2018-12-04 20:02:33 -08:00
Olivier Combe
c07afd9db1 test(ivy): enable ivy tests for platform-browser ()
PR Close 
2018-12-04 20:02:33 -08:00
Pawel Kozlowski
b25f06ee7c test(ivy): update root causes for @angular/core TestBed failures ()
PR Close 
2018-12-04 20:02:21 -08:00
Marc Laval
8973f12ee4 fix(ivy): provided Injector should be instantiated by its factory ()
(FW-777)

When an Injector is provided, R3Injector instantiates it by calling its
constructor instead of its factory, not resolving dependencies.
With this fix, the ngInjectorDef is checked and the factory is correctly
used if it is found.

PR Close 
2018-12-04 20:01:49 -08:00
Pete Bacon Darwin
486f69fcac test(upgrade): do not lock up browser when unit test fails ()
Previously, if the two injectors are not the same, jasmine tried to
display an error message, but it got stuck in an infinite loop trying
to render the injectors that were different.

PR Close 
2018-12-04 20:01:37 -08:00
Pete Bacon Darwin
145121a75d test(upgrade): re-enable tests fixed in ivy ()
PR Close 
2018-12-04 20:01:37 -08:00
Andrew Kushnir
130ae158c4 test(ivy): more precise TestBed failure causes for View/Content Queries (FW-670) ()
PR Close 
2018-12-04 20:01:03 -08:00
Misko Hevery
295e0f65a1 refactor(ivy): remove old unused test case ()
PR Close 
2018-12-04 20:00:17 -08:00
Jason Aden
0d4149c736 test(router): add test verifying guards re-run when parent path segments change ()
Related to 

PR Close 
2018-12-04 19:59:53 -08:00
Kristiyan Kostadinov
862697d4bd fix(ivy): return new ViewRef when detaching view ()
When detaching a view by its index via `ViewContainerRef.detach(index)`, in `ViewEngine` we used to return a new `ViewRef` ([for reference](https://github.com/angular/angular/blob/master/packages/core/src/view/refs.ts#L227)), however in Ivy we return the same `ViewRef` which means that its internal `_viewContainerRef` is never reset and we'll throw an error if the consumer tried to attach it to the `ApplicationRef`. These changes return a new `ViewRef` in order to match the original behavior.

These changes also add the same errors as `ViewEngine` when attempting to attach a view that is attached already. This was the original goal of this PR, however it ended up uncovering the issues with the `ViewRef`.

PR Close 
2018-12-04 19:59:37 -08:00