Commit Graph

2763 Commits

Author SHA1 Message Date
JoostK df123e0410 fix(animations): mark actual descendant node as disabled (#26180)
PR Close #26180
2018-12-14 15:19:56 -08:00
JoostK 023bd31965 fix(ivy): ngcc should not emit TypeScript syntax (#27051)
If a template contains specific TypeScript syntax, such as a non-null
assertion, the code that is emitted from ngcc into a JavaScript bundle
should not retain such syntax as it is invalid in JS.

A full-blown TypeScript emit of a complete ts.SourceFile would be
required to be able to emit JS and possibly downlevel into a lower
language target, which is not an option for ngcc as it currently
operates on partial ASTs, not full source files.

Instead, ngtsc no longer produces TypeScript specific syntax in the first
place, such that TypeScript print logic will only generate JS code.

PR Close #27051
2018-12-14 15:19:31 -08:00
Ingo Bürk b39efdd9d6 fix(common): KeyValuePipe should return empty array for empty objects (#27258)
This lets KeyValuePipe return an empty array (rather than undefined)
when the input is empty.

PR Close #27258
2018-12-14 15:19:13 -08:00
cexbrayat 0b78f54d4f docs(router): typo in state documentation (#27671)
PR Close #27671
2018-12-14 15:13:45 -08:00
Igor Minar 522919a537 fix(bazel): emit full node stack traces when Angular compilation crashes (#27678)
The default 10 items are often not enough to debug deeply nested compilation operations.

This PR is based on @martinprobst's http://cl/225528216.

PR Close #27678
2018-12-14 14:58:21 -08:00
Miško Hevery 650c5a02ac Revert "fix(router): ensure URL is updated after second redirect with UrlUpdateStrategy="eager" (#27523)"
This reverts commit ad26cd6d0c.
2018-12-14 13:18:16 -08:00
Christopher Dahm d0d351cccb docs(common): update currencyPipe default digitsInfo values (#27417)
Change the docs to reflect the actual default values

Fixes #27414
PR Close #27417
2018-12-14 10:26:56 -08:00
JoostK a9543457ef fix(ivy): prevent invalid forward references in setClassMetadata call (#27561)
In Ivy, a pure call to `setClassMetadata` is inserted to retain the
information that would otherwise be lost while eliding the Angular
decorators. In the past, the Angular constructor decorators were
wrapped inside of an anonymous function which was only evaluated once
`ReflectionCapabilities` was requested for such metadata. This approach
prevents forward references from inside the constructor parameter
decorators from being evaluated before they are available.

In the `setClassMetadata` call, the constructor parameters were not wrapped
within an anonymous function, such that forward references were evaluated
too early, causing runtime errors.

This commit changes the `setClassMetadata` call to pass the constructor
parameter decorators inside of an anonymous function again, such that
forward references are not resolved until requested by
`ReflectionCapabilities`, therefore avoiding the early reads of forward refs.

PR Close #27561
2018-12-14 10:24:16 -08:00
JoostK a8ebc837ea fix(ivy): support complex type nodes in ModuleWithProviders (#27562)
With ngcc's ability to fixup pre-Ivy ModuleWithProviders such that they
include a reference to the NgModule type, the type may become a qualified
name:

```
import {ModuleWithProviders} from '@angular/core';
import * as ngcc0 from './module';

export declare provide(): ModuleWithProviders<ngcc0.Module>;
```

ngtsc now takes this situation into account when reflecting a
ModuleWithProvider's type argument.

PR Close #27562
2018-12-14 10:23:43 -08:00
cooljeffro 7fae9114c8 docs(common): Fix typo in KeyValuePipe docs (#27580)
PR Close #27580
2018-12-14 10:21:47 -08:00
Kristiyan Kostadinov 5d34657198 fix(ivy): attempting to remove detached view on destroy (#27585)
Currently the `ViewRef.destroy` method assumes that its index inside the view container will always be valid, however if it has been removed already, it'll be -1 which will throw an error.

The error manifested itself in one of the unit tests where a view had been detached during the test and then `TestBed` attempted to destroy its `ComponentRef` which ended threw an `Error during cleanup of component`.

PR Close #27585
2018-12-14 10:21:23 -08:00
Alex Eagle d32939d51a build: restrict visibility of npm_package targets (#27611)
dependencies on these cause very long rebuilds which have to re-package angular.
Such tests belong in the integration/ folder

PR Close #27611
2018-12-14 10:20:40 -08:00
Igor Minar d528e30cef test(ivy): update fixmes in packages/core/test/linker/jit_summaries_integration_spec.ts (#27639)
the issues referenced were stale and unrelated.

PR Close #27639
2018-12-14 10:20:18 -08:00
Igor Minar 8f8c5ba12e test(ivy): improve fixme message in //packages/platform-webworker/test (#27639)
the old one was not detailed enough

PR Close #27639
2018-12-14 10:20:18 -08:00
Igor Minar cba92db6bf test(ivy): remove stale fixmes from //packages/platform-server/test (#27639)
these issues have already been resolved but we forgot to reenable the tests.

PR Close #27639
2018-12-14 10:20:18 -08:00
Keen Yee Liau 3680aef801 test(bazel): integration test for ng new with Bazel (#27659)
integration test for bazel build and bazel test

PR Close #27659
2018-12-14 10:19:22 -08:00
Jason Aden ad26cd6d0c fix(router): ensure URL is updated after second redirect with UrlUpdateStrategy="eager" (#27523)
Navigating to a route such as `/users`, you may get redirected to `/login`. Previously, if you go then route to `/users` again the URL will end up showing `/users` after the second redirect. This only happened in `UrlUpdateStrategy="eager"`. This is now fixed so after the second redirect, the URL shows the correct page.

Fixes #27116

PR Close #27523
2018-12-13 14:59:41 -08:00
Andrew Kushnir fdf39985f0 fix(ivy): do not use MSG_ prefix for i18nPostprocess invocation (FW-779) (#27468)
Closure Compiler doesn't allow non-goo.getMsg const names to start with `MSG_`, so we should use different prefix for const that references a result of the `i18nPostprocess` fn invocation. With this update we also append file-based prefix to i18n constants (via $$ postfix) to ensure the names are unique across codebase of a project (otherwise it might lead to errors while compiling a project with Closure Compiler).

PR Close #27468
2018-12-13 14:58:56 -08:00
Paul Gschwendtner 44dfa606ed fix(bazel): ng_package writes unrelevant definitions to bazel out (#27519)
In order to keep the bazel bin directory as clean as possible, we should not write definition files that are not relevant to a `ng_package` to an undesired location in the bazel bin directory. This currently just happens because we only filter out external definition files while we also should filter out definitions that aren't just in the current package.

The `packager.ts` file currently tries to write these files to the package, but fails because those are not inside of the current package. So the logic to create a relative path for the file fails, and the definition will be copied to a location like:

```js
// Notice the double "bazel-out" here.
C:\Users\Paul\_bazel_Paul\kn4tsvyh\execroot\angular_material\bazel-out\x64_windows-fastbuild\bin\src\bazel-out\x64_windows-fastbuild\bin\src\cdk
```

[See logic that causes this](4f9374951d/packages/bazel/src/ng_package/packager.ts (L105-L124)) (nothing wrong with that logic because it assumes that only paths from within the package are passed to it)

PR Close #27519
2018-12-13 14:58:38 -08:00
Igor Minar 3970d00edd test(ivy): remove state fixme from packages/compiler-cli/test:ngtools_api (#27638)
it seems that we forgot to remove it in the recent refactoring.

PR Close #27638
2018-12-13 14:57:38 -08:00
Pawel Kozlowski 10c7b89f14 test(ivy): update root causes for @angular/core TestBed failures (#27650)
PR Close #27650
2018-12-13 14:56:00 -08:00
Pawel Kozlowski 0397e08153 test(ivy): update test status for cases modified in ivy (#27652)
PR Close #27652
2018-12-13 14:55:38 -08:00
Alex Rickabaugh 6b96931576 fix(ivy): enable flat module index production in Bazel (#27655)
ngtsc now produces flat module index files when that option is enabled
in tsconfig, but Bazel still needs the output declared in order for them to
be passed through.

This fixes some tests which verify this behavior on Bazel.

FW-738 #resolve

PR Close #27655
2018-12-13 14:55:15 -08:00
Keen Yee Liau 8313ffc38d fix(bazel): Load http_archive and rules_nodejs dependencies (#27609)
Bazel 0.20 requires loading http_archive explicitly.
rules_nodejs dependencies must now be installed explicity as well.

PR Close #27609
2018-12-13 11:01:31 -08:00
Greg Magolan 1cc08b4a4a fix(bazel): fix major/minor semver check between @angular/bazel npm packager version and angular bazel repo version (#27635)
PR Close #27635
2018-12-13 10:59:14 -08:00
Igor Minar 7fabe4429d fix(ivy): add support for optional nullable injection tokens (#27552)
FW-778 #resolve

PR Close #27552
2018-12-12 13:04:29 -08:00
Andrew Kushnir 37c05bd575 fix(ivy): avoid destroy renderer method invocation for child views (#27592)
Since Renderer is shared across root and child views, we need to avoid `destroy` method invocation for child views and only invoke is for root view when needed. Prior to this change, the `destroy` function was called whenever child view was destroyed, thus causing errors at runtime.

PR Close #27592
2018-12-12 13:04:09 -08:00
Pawel Kozlowski 28ceca0163 test(ivy): update root causes for @angular/core TestBed failures (#27627)
PR Close #27627
2018-12-12 11:02:03 -08:00
Kara Erickson 053b43d308 fix(ivy): update new host binding test with instruction change (#27605)
The pure functions in host bindings change was merged after the change in
host binding instructions, so it had a new test that wasn't yet updated
with the new generated code. This commit updates the new test.

PR Close #27605
2018-12-11 12:09:40 -08:00
Pawel Kozlowski 6980631631 test(ivy): update root causes for @angular/core TestBed failures (#27602)
PR Close #27602
2018-12-11 11:28:43 -08:00
Kara Erickson 452668b581 fix(ivy): host bindings should work if input has same name (#27589)
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 #27589
2018-12-11 11:27:08 -08:00
Andrew Kushnir ceb14deb60 fix(ivy): proper slot allocation for pure functions in `hostBindings` function (#27587)
Prior to this update, we always returned the number of host vars defined in @Component definition as a value for `allocatePureFunctionsSlot` callback in ValueConverter. As a result, pure function arguments were not accounted for, thus leasing to incorrect slot offsets in `pureFunction` calls. Now we update and return total # of host vars, so the offsets are defined correctly.

PR Close #27587
2018-12-11 11:26:04 -08:00
Pete Bacon Darwin 3290fc3365 fix(bazel): fix TS errors in the `schematics/bazel-workspace` files (#27600)
Upgrading to the new `ts_library` rule uncovered TS errors in these
files. This commit fixes the code to pass TS checking.

PR Close #27600
2018-12-11 09:24:08 -08:00
Keen Yee Liau 30a3b49830 fix(bazel): Read latest versions from latest-versions.ts & use semver check (#27526)
When @angular/bazel is installed, a postinstall script is run to make sure that
the npm version is *exactly* the same as the Angular repository install by
Bazel. This check is overly stringent. Instead, it should enforce that the
version satisfies the range check instead. This is consistent with the range
defined in angular-cli/packages/schematics/angular/utility/latest-versions.ts.

This commit also fixes the Bazel workspace to use the same Rxjs version if it's
already installed.

PR Close #27526
2018-12-10 16:35:42 -08:00
Alex Eagle 50687e11cf build: fix type-check errors introduced during rules_ts 0.21 (#27586)
PR Close #27586
2018-12-10 16:33:41 -08:00
Alex Eagle bf57e9d781 build: update rules_typescript (#27586)
This release of rules_typescript fixes a critical bug: typescript code
was not checked at all, including type-checking, tsetse, and strict deps

fixes #27569

PR Close #27586
2018-12-10 16:33:41 -08:00
Andrew Kushnir 05cdfb90e9 fix(ivy): make ViewRef.detectChanges work with embedded views (FW-749) (#27521)
In `ViewRef.detectChanges`, we are passing `ViewRef.context` into `detectChanges` to trigger change detection. This only makes sense for component `ViewRefs` (i.e. injected `ChangeDetectorRefs`) because with embedded views, `context` is not a component instance where the view has been monkey-patched. It's a just a normal object, so the view will be undefined.

In order to resolve this problem, we now invoke `detectChangesInternal` and also pass `LView` (to make sure we always have a view available).

PR Close #27521
2018-12-10 14:20:22 -08:00
Igor Minar f5c0b30256 test: remove extranious fixme from packages/bazel/test/ngc-wrapped (#27578)
we forgot to remove this when the last fixme was removed.

PR Close #27578
2018-12-10 10:31:06 -08:00
Pawel Kozlowski 2182be48c4 test(ivy): enable more of @angular/core tests on node and in a browser (#27572)
PR Close #27572
2018-12-10 10:30:03 -08:00
Olivier Combe 9e7a8f6e89 refactor(ivy): dedup render3 NodeInjector (#27541)
We had two `NodeInjector` classes: one in `view_compatibility` and one in `di`. We replaced the one in `di` with the one from `view_compatibility` and reconciled their differences.
PR Close #27541
2018-12-10 10:29:13 -08:00
Alex Eagle 44dd764d6d build: update to Bazel 0.20 (#27394)
refactor Bazel RBE configs

PR Close #27394
2018-12-07 14:29:03 -08:00
Andrew Kushnir 255e672295 fix(ivy): define correct SVG namespace (FW-757) (#27529)
The trailing slash in SVG namespace prevented its correct resolution, thus triggering issues at runtime.

PR Close #27529
2018-12-07 11:53:52 -08:00
Paul Gschwendtner f0341142b8 fix(bazel): tsickle dependency not working with typescript 3.1.x (#27402)
`@angular/bazel` currently requires TypeScript 3.1.x as a peer dependency, but comes with `tsickle` as dependency. The current version of `tsickle` that is specified by `@angular/bazel` does not support TypeScript 3.1.x (which is a peer dependency) and therefore we need to make sure that `tsickle` works with the required TypeScript versions.

This change updates `tsickle` to the latest version that comes with b10fb6de0a in order to work with TypeScript 3.1.x.

PR Close #27402
2018-12-07 10:51:36 -08:00
cexbrayat b0c75611d6 fix(forms): typed argument for FormBuilder group (#26985)
PR Close #26985
2018-12-07 09:30:07 -08:00
Pete Bacon Darwin 2a35471abe test(upgrade): add diagnosis to failing ivy tests (#27542)
PR Close #27542
2018-12-07 09:29:12 -08:00
Alex Eagle cab5927bd5 ci: use buildifier binary release (#27489)
Switch from Skylint to buildifier --lint - this is required for the Bazel 0.20 upgrade since Bazel no longer lets us use the embedded JDK to build and run Java programs, and Skylint is a Java program

PR Close #27489
2018-12-07 09:27:32 -08:00
Andrew Kushnir dcb44e6dea fix(ivy): generate proper event listener names for animation events (FW-800) (#27525)
Prior to this change, animation event names were treated as a regular event names, stripping `@` symbol and event phase. As a result, event listeners were not invoked during animations. Now animation event name is formatted as needed and the necessary callbacks are invoked.

PR Close #27525
2018-12-07 09:25:18 -08:00
Pawel Kozlowski 5657126d86 test(ivy): run browser-specific @angular/core tests on CI (#27545)
PR Close #27545
2018-12-07 09:24:15 -08:00
Alex Rickabaugh aa48810d80 feat(ivy): generate flat module index files (#27497)
Previously, ngtsc did not respect the angularCompilerOptions settings
for generating flat module indices. This commit adds a
FlatIndexGenerator which is used to implement those options.

FW-738 #resolve

PR Close #27497
2018-12-07 09:22:29 -08:00
Alex Rickabaugh 352c582f98 refactor(ivy): allow for shim generators not based on existing files (#27497)
Previously the ngtsc ShimGenerator interface expected that all shims would
be generated using the contents of existing ts.SourceFiles. This assumption
was true for ngfactory and ngsummary files, but breaks down for flat module
index files, which are standalone.

This commit prepares for flat module index generation by enabling shim
generators which don't require an existing file.

PR Close #27497
2018-12-07 09:22:29 -08:00
Marc Laval f013c57186 test(router): correct a wrong test (FW-766) (#27511)
PR Close #27511
2018-12-06 13:41:20 -08:00
Pawel Kozlowski 913563a41d test(ivy): finish root cause analysis for @angular/core TestBed failing tests (#27510)
PR Close #27510
2018-12-06 13:41:02 -08:00
Marc Laval 8fa7e93c30 test(ivy): enable router tests with pending timers (FW-768) (#27509)
PR Close #27509
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) (#27500)
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 #27500
2018-12-06 13:40:15 -08:00
Andrew Kushnir c71d7b5633 fix(ivy): setting up animation properties correctly (FW-643) (#27496)
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 #27496
2018-12-06 13:38:40 -08:00
Keen Yee Liau 4da739a970 fix(bazel): Respect existing angular installation (#27495)
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 #27495
2018-12-06 13:36:19 -08:00
Sander Elias 21d13dd15a fix(ivy): Added missing getHostElement to export (#27488)
PR Close #27488
2018-12-06 13:35:41 -08:00
Marc Laval 8e9858fadb fix(ivy): align NgModuleRef implementation between Ivy and ViewEngine (#27482)
Solves FW-765 and FW-767

PR Close #27482
2018-12-06 13:35:08 -08:00
JoostK 159ab1c257 fix(ivy): ngtsc should include generic types on injectable definitions (#27037)
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 #27037
2018-12-06 13:33:13 -08:00
Kara Erickson 160cace336 test(ivy): fix query compliance spec (#27501)
PR Close #27501
2018-12-06 09:26:57 -08:00
Paul Gschwendtner ca1c430f30 fix(compiler-cli): ngtsc shim files not being generated on case-insensitive platforms (#27466)
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 #27466
2018-12-06 09:24:52 -08:00
Igor Minar 091a504377 Revert "fix(router): change processing url tree children condition (#26243)" (#27516)
This reverts commit ccc77ca441.

Breaks Pantheon see cl/224256517.

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

Breaks Pantheon see cl/224256517.

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

PR Close #27386
2018-12-05 20:55:32 -08:00
Igor Minar 95f8b63265 test(service-worker): run the remaining service-worker tests under bazel (#27386)
PR Close #27386
2018-12-05 20:55:31 -08:00
Igor Minar 4f81a7c590 test(common): run @angular/common/http/testing tests under bazel (#27386)
PR Close #27386
2018-12-05 20:55:31 -08:00
Andrew Kushnir a315dedb85 fix(ivy): fix fixmeIvy invocations in "platform-browser" tests (#27498)
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 #27498
2018-12-05 16:33:27 -08:00
Alex Rickabaugh f514ac3da2 test(ivy): enable //packages/router/test/aot_ngsummary_test in Ivy mode (#27483)
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 #27483
2018-12-05 16:26:39 -08:00
Alex Rickabaugh 0ae8c08b3c build(ivy): expect factories and summaries in Ivy mode (#27483)
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 #27483
2018-12-05 16:26:39 -08:00
Alex Rickabaugh 276bdd1f3e fix(ivy): move the generation of ɵNonEmptyModule to shim construction (#27483)
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 #27483
2018-12-05 16:26:39 -08:00
Alex Rickabaugh d553ec2f36 fix(ivy): generate correct moduleNames for factories and summaries (#27483)
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 #27483
2018-12-05 16:26:39 -08:00
Alex Rickabaugh dfdaaf6a0d fix(ivy): deduplicate directives in component scopes (#27462)
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 #27462
2018-12-05 14:36:24 -08:00
Olivier Combe b82f62a11d test(ivy): enable ivy tests for platform-browser/animations (#27478)
PR Close #27478
2018-12-05 14:35:23 -08:00
Pawel Kozlowski 821fecb413 test(ivy): update root causes for @angular/core TestBed failures (#27479)
PR Close #27479
2018-12-05 11:24:06 -08:00
Alex Rickabaugh 8f425701e4 test(ivy): enable //packages/bazel/test/ngc-wrapped/... tests for Ivy (#27470)
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 #27470
2018-12-05 10:46:51 -08:00
Alex Rickabaugh 0d8ab323a7 fix(ivy): add missing directoryExists() method to shim CompilerHost (#27470)
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 #27470
2018-12-05 10:46:51 -08:00
Alex Rickabaugh 345bdd3db0 fix(ivy): generate empty ngfactory files if needed (#27470)
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 #2 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 #27470
2018-12-05 10:46:51 -08:00
Jason Aden d70a7f3ac9 feat(router): add pathParamsOrQueryParamsChange mode for runGuardsAndResolvers (#27464)
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 #26861 #18253

PR Close #27464
2018-12-05 10:43:29 -08:00
Ben Lesh cd858323f2 feat(ivy): Forward refs now supported (#27439)
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 #27439
2018-12-05 10:41:24 -08:00
Olivier Combe 2bc39860bb feat(ivy): support inputs & outputs with aliases in component decorators (#27350)
PR Close #27350
2018-12-05 10:40:08 -08:00
Olivier Combe 1279a503a1 feat(ivy): add ng-reflect debug text for containers (#27350)
PR Close #27350
2018-12-05 10:40:08 -08:00
miginmrs 20cef5078d fix(router): process empty path segment when preceding a named outlet (#26243)
PR Close #10726

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

PR Close #26224

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

PR Close #27360
2018-12-04 23:18:19 -08:00
Misko Hevery faca8b1382 test(ivy): remove symbol tests which are too big and not useful (#27446)
PR Close #27446
2018-12-04 23:17:52 -08:00
Andrew Kushnir a3ee08968e fix(ivy): compiler compliance tests actualized (#27473)
PR #27404 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 #27404. This commit actualizes this test to get rid of unnecessary `allocHostVars` instruction.

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

PR Close #27465
2018-12-04 21:01:58 -08:00
Olivier Combe 9062b391a2 test(ivy): root cause analysis for platform-browser (#27460)
PR Close #27460
2018-12-04 20:02:33 -08:00
Olivier Combe c07afd9db1 test(ivy): enable ivy tests for platform-browser (#27460)
PR Close #27460
2018-12-04 20:02:33 -08:00
Pawel Kozlowski b25f06ee7c test(ivy): update root causes for @angular/core TestBed failures (#27459)
PR Close #27459
2018-12-04 20:02:21 -08:00
Marc Laval 8973f12ee4 fix(ivy): provided Injector should be instantiated by its factory (#27456)
(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 #27456
2018-12-04 20:01:49 -08:00
Pete Bacon Darwin 486f69fcac test(upgrade): do not lock up browser when unit test fails (#27454)
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 #27454
2018-12-04 20:01:37 -08:00
Pete Bacon Darwin 145121a75d test(upgrade): re-enable tests fixed in ivy (#27454)
PR Close #27454
2018-12-04 20:01:37 -08:00
Andrew Kushnir 130ae158c4 test(ivy): more precise TestBed failure causes for View/Content Queries (FW-670) (#27447)
PR Close #27447
2018-12-04 20:01:03 -08:00
Misko Hevery 295e0f65a1 refactor(ivy): remove old unused test case (#27442)
PR Close #27442
2018-12-04 20:00:17 -08:00
Jason Aden 0d4149c736 test(router): add test verifying guards re-run when parent path segments change (#27440)
Related to #26861

PR Close #27440
2018-12-04 19:59:53 -08:00
Kristiyan Kostadinov 862697d4bd fix(ivy): return new ViewRef when detaching view (#27437)
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 #27437
2018-12-04 19:59:37 -08:00