Commit Graph

2720 Commits

Author SHA1 Message Date
Pawel Kozlowski ea10a3abe5 test(ivy): enable all test for @angular/common (#27700)
PR Close #27700
2018-12-17 09:32:09 -08:00
cyraid f8096d4993 docs(animations): rename animateChild() to animate() (#26184)
Renamed "animateChild()" to "animate()" in the comments/usage.
  The docs state to use animateChild() but uses animate() in the examples.
PR Close #26184
2018-12-14 15:27:37 -08:00
Ruslan Dzhabbarov 7dab458884 docs(common): fix documentation for getLocaleCurrencyName (#27087)
PR Close #27087
2018-12-14 15:27:03 -08:00
JoostK f4a797db24 fix(ivy): prevent ngcc from inadvertently dropping Ivy definitions (#27159)
A surprising interaction with the MagicString library caused inserted
Ivy definitions to be dropped during the removal of decorators, iff all
decorators on the class could be removed. In that case, the removal
location corresponds with the exact location where Ivy definitions were
inserted into.

This commit moves the removal of decorators to occur before Ivy
definitions are inserted. This effectively avoids the problem, as later
inserted text fragments will be retained by MagicString.

PR Close #27159
2018-12-14 15:26:15 -08:00
Olivier Combe 4df82bdbc1 test(ivy): don't run`ViewEngine` tests for ivy (#27645)
All the tests in `packages/core/test/view/` are specific to the `ViewEngine` and shouldn't run for ivy. This PR introduces a new BUILD.bazel file to run those tests separately.

PR Close #27645
2018-12-14 15:23:15 -08:00
Pawel Kozlowski b00aeeff37 fix(ivy): properly destroy views created by ComponentFactory (#27676)
PR Close #27676
2018-12-14 15:22:11 -08:00
levgaas f1c9d6a81f fix(animations): do not truncate decimals for delay (#24455)
Do not truncate decimals for animation delay if specified in seconds

PR Close #24455
2018-12-14 15:20:23 -08:00
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