13685 Commits

Author SHA1 Message Date
Kara
630aaa6bfb docs: add Deborah Kurata to Trusted Collaborators ()
This commit adds Deborah to the Trusted Collaborators list, so she will appear in the Collaborators list on angular.io.
PR Close 
2019-04-02 15:53:48 -07:00
Paul Gschwendtner
7c8f4e3202 feat(core): template-var-assignment update schematic ()
Introduces a new update schematic called "template-var-assignment"
that is responsible for analyzing template files in order to warn
developers if template variables are assigned to values.

The schematic also comes with a driver for `tslint` so that the
check can be used wtihin Google.

PR Close 
2019-04-02 15:47:32 -07:00
Paul Gschwendtner
15eb1e0ce1 refactor(core): stronger type for resolved angular decorators ()
PR Close 
2019-04-02 15:47:32 -07:00
Paul Gschwendtner
780081def0 refactor(core): move schematic typescript logic to utility package ()
PR Close 
2019-04-02 15:47:32 -07:00
Ben Lesh
5a724b34bd refactor(ivy): move instructions ()
- moves all publicly exported instructions to their own files
- refactors namespace instructions to set state in `state.ts`
- no longer exports * from `instructions.ts`.
- `instructions.ts` renamed to `shared.ts` (old `shared.ts` contents folded in to `instructions.ts`)
- updates `all.ts` to re-export from public instruction files.

PR Close 
2019-04-02 15:47:02 -07:00
Alex Eagle
03d914a6c2 build: hide @angular/http for Angular v8 ()
Currently our plan is to skip the publish, docgen, and update steps for this package.
During RC, we'll determine if the breaking change is too difficult for users, in which case we might restore the package for another major.

PR Close 
2019-04-02 10:55:31 -07:00
JoostK
98f8b0f328 fix(ivy): ngcc - properly handle aliases class expressions ()
In ES2015, classes could have been emitted as a variable declaration
initialized with a class expression. In certain situations, an intermediary
variable suffixed with `_1` is present such that the variable
declaration's initializer becomes a binary expression with its rhs being
the class expression, and its lhs being the identifier of the intermediate
variable. This structure was not recognized, resulting in such classes not
being considered as a class in `Esm2015ReflectionHost`.

As a consequence, the analysis of functions/methods that return a
`ModuleWithProviders` object did not take the methods of such classes into
account.

Another edge-case with such intermediate variable was that static
properties would not be considered as class members. A testcase was added
to prevent regressions.

Fixes 

PR Close 
2019-04-02 10:50:46 -07:00
JoostK
5a1d21ebb4 ci: exclude ngcc from needing g3 presubmit ()
In a770aa2 ngcc was moved up one folder, however the angular-robot config
was not updated to reflect this change.

PR Close 
2019-04-02 10:50:46 -07:00
Emilie Huet
cbd5d28f71 docs: add info regarding injecting custom pipes ()
Indicate that a pipe also needs to be included in the providers array

PR Close 
2019-04-02 10:38:36 -07:00
Pete Bacon Darwin
9f54d76ef5 refactor(upgrade): use Bazel packages to avoid symlinks in the source ()
Previously we had to share code between upgrade/dynamic and upgrade/static
by symlinking the `src` folder, which allowed both packages to access
the upgrade/common files.

These symlinks are always problematic on Windows, where we had to run
a script to re-link them, and restore them.

This change uses Bazel packages to share the `upgrade/common` code,
which avoids the need for symlinking the `src` folder.

Also, the Windows specific scripts that fixup the symlinks have also
been removed as there is no more need for them.

PR Close 
2019-04-02 10:38:01 -07:00
Ben Lesh
e5201f92fc refactor(platform-browser): rename _singleTagWhitelist ()
PR Close 
2019-04-02 10:37:29 -07:00
Ben Lesh
3487055d10 refactor(compiler): rename INTERPOLATION_BLACKLIST_REGEXPS ()
PR Close 
2019-04-02 10:36:26 -07:00
Ben Lesh
1c07061246 refactor: change error message ()
Removes usage of whitelist from error messages, comments and test descriptions in ts_api_guardian

Related to 

PR Close 
2019-04-02 10:29:33 -07:00
Ben Lesh
d11b0c0c41 refactor(compiler): update docs ()
PR Close 
2019-04-02 10:28:52 -07:00
Ben Lesh
1293da1cf7 refactor(core): update docs ()
PR Close 
2019-04-02 10:28:23 -07:00
Greg Magolan
7c1f73ac7b build(bazel): update to nodejs rules 0.27.9 ()
PR Close 
2019-04-02 10:27:14 -07:00
George Kalpakas
0e201ea9d8 fix(docs-infra): fix scroll position restoration error in ScrollService ()
Based on Google Analytics error report, the following error happens
occasionally (15% or total errors for 2019-03):

```
Cannot read property '0' of null TypeError: at t.scrollToPosition@main.js
```

This was a result of calling [ViewportScroller#scrollToPosition()][1]
with `null`, which in turn happens when calling
[ScrollService#scrollToPosition()][2] while `this.scrollPosition` is
`null`. This can be a result of a `popstate` event without an associated
history state.

This commit fixes the error by checking whether `this.scrollPosition` is
`null`, before using it with `scrollToPosition()`.

(It also refactors away the unneeded internal `popStateFired` property.)

[1]: https://github.com/angular/angular/blob/deca6a60d/packages/common/src/viewport_scroller.ts#L101-L105
[2]: https://github.com/angular/angular/blob/deca6a60d/aio/src/app/shared/scroll.service.ts#L158-L161

PR Close 
2019-04-02 10:26:49 -07:00
George Kalpakas
53be333439 perf(docs-infra): avoid unnecessary JSON parsing in ScrollService ()
PR Close 
2019-04-02 10:26:49 -07:00
George Kalpakas
19081dc9a3 refactor(docs-infra): minor clean-up of ScrollService ()
PR Close 
2019-04-02 10:26:49 -07:00
cexbrayat
9e4c0bd815 docs: fix typos in getting-started ()
PR  introduced a new getting-started guide and a few typos slipped through the review.

PR Close 
2019-04-02 10:25:59 -07:00
George Kalpakas
deca6a60dd test(docs-infra): avoid click-related CI flake in e2e test ()
One of the tests introduced in  is susceptible to a kind of
WebDriver flake related to trying to click elements hidden behind fixed
positioned elements.
This commit works around the issue by clicking the elements directly
using JavaScript (instead of `WebElement#click()`).

PR Close 
2019-04-01 16:18:03 -07:00
Pete Bacon Darwin
63013f1aeb fix(ivy): support finding the import of namespace-imported identifiers ()
Currently there is no support in ngtsc for imports of the form:

```
import * as core from `@angular/core`

export function forRoot(): core.ModuleWithProviders;
```

This commit modifies the `ReflectionHost.getImportOfIdentifier(id)`
method, so that it supports this kind of return type.

PR Close 
2019-04-01 16:06:14 -07:00
Filipe Silva
8bfaaf164a docs: add Web Worker guide ()
Followup to https://github.com/angular/angular-cli/pull/13700

PR Close 
2019-04-01 15:31:47 -07:00
cexbrayat
1f469cd7bb docs: improve formatDate description ()
PR  reworded the description, making it less obvious that the value to format can be a `Date`.

PR Close 
2019-04-01 15:14:50 -07:00
Alex Rickabaugh
7041e61562 perf(ivy): basic incremental compilation for ngtsc ()
This commit introduces a mechanism for incremental compilation to the ngtsc
compiler.

Previously, incremental information was used in the construction of the
ts.Program for subsequent compilations, but was not used in ngtsc itself.

This commit adds an IncrementalState class, which tracks state between ngtsc
compilations. Currently, this supports skipping the TypeScript emit step
when the compiler can prove the contents of emit have not changed.

This is implemented for @Injectables as well as for files which don't
contain any Angular decorated types. These are the only files which can be
proven to be safe today.

See ngtsc/incremental/README.md for more details.

PR Close 
2019-04-01 15:13:56 -07:00
Alex Rickabaugh
7316212c1e test(ivy): support multiple compilations in the ngtsc test env ()
This commit adds support for compiling the same program repeatedly in a way
that's similar to how incremental builds work in a tool such as the CLI.

* support is added to the compiler entrypoint for reuse of the Program
  object between compilations. This is the basis of the compiler's
  incremental compilation model.

* support is added to wrap the CompilerHost the compiler creates and cache
  ts.SourceFiles in between compilations.

* support is added to track when files are emitted, for assertion purposes.

* an 'exclude' section is added to the base tsconfig to prevent .d.ts
  outputs from the first compilation from becoming inputs to any subsequent
  compilations.

PR Close 
2019-04-01 15:13:56 -07:00
Alex Rickabaugh
aaa16f286d feat(ivy): performance trace mechanism for ngtsc ()
This commit adds a `tracePerformance` option for tsconfig.json. When
specified, it causes a JSON file with timing information from the ngtsc
compiler to be emitted at the specified path.

This tracing system is used to instrument the analysis/emit phases of
compilation, and will be useful in debugging future integration work with
@angular/cli.

See ngtsc/perf/README.md for more details.

PR Close 
2019-04-01 15:13:55 -07:00
Alex Rickabaugh
3e569767e3 fix(ivy): avoid remote scoping if it's not actually required ()
Currently, ngtsc decides to use remote scoping if the compilation of a
component may create a cyclic import. This happens if there are two
components in a scope (say, A and B) and A directly uses B. During
compilation of B ngtsc will then note that if B were to use A, a cycle would
be generated, and so it will opt to use remote scoping for B.

ngtsc already uses the R3TargetBinder to correctly track the imports that
are actually required, for future cycle tracking. This commit expands that
usage to not trigger remote scoping unless B actually does consume A in its
template.

PR Close 
2019-04-01 15:13:35 -07:00
Tim Deschryver
abf69dec5b docs: fix typos in getting started ()
PR Close 
2019-04-01 15:06:10 -07:00
Yun Peng
701da0099b build: Remove --watchfs from bazelrc file ()
--watchfs is causing the build to be flaky on Windows because Bazel
doesn't have proper support for watchfs on Windows, but it doesn't seem
to bring much performance on Linux, either.

Fixes: https://github.com/angular/angular/issues/29541

PR Close 
2019-04-01 14:57:30 -07:00
Jason Aden
f9497bf28b fix(router): adjust setting navigationTransition when a new navigation cancels an existing one ()
Prior to this change, if a navigation was ongoing and a new one came in, the router could get into a state where `router.currentNavigation` was `null` even though a navigation was executing. This change moves where we set the `currentNavigation` value so it's inside a `switchMap`. This solves the problem because the `finally` on the `switchMap` had been setting `currentNavigation` to `null` but the new `currentNavigation` value would have already been set. Essentially this was a timing problem and is resolved with this change.

Fixes  

PR Close 
2019-04-01 12:11:55 -07:00
Judy Bogart
d7e5535d00 docs: add custom-element ref to library overview ()
PR Close 
2019-04-01 12:04:06 -07:00
Pete Bacon Darwin
8d3d75e454 feat(compiler-cli): ngcc - make logging more configurable ()
This allows CLI usage to filter excessive log messages
and integrations like webpack plugins to provide their own logger.

// FW-1198

PR Close 
2019-04-01 11:53:28 -07:00
Pete Bacon Darwin
39345b6fae style(compiler-cli): ensure FFR type is implemented correctly ()
PR Close 
2019-04-01 11:53:08 -07:00
Pete Bacon Darwin
06859f1335 refactor(compiler-cli): track visited source files in PartialEvaluator ()
PR Close 
2019-04-01 11:53:08 -07:00
George Kalpakas
717aa7c6e4 docs: update CODEOWNERS with missing or removed guides/examples ()
PR Close 
2019-04-01 11:52:23 -07:00
Martin Ockovsky
9cd90532c1 docs: add missing window key shortcut to language service guide ()
PR Close 
2019-04-01 11:28:12 -07:00
Jorge Cano
ff2a55f14f docs: update Jorge Cano GDE bio ()
PR Close 
2019-04-01 11:26:40 -07:00
George Kalpakas
0abd5f5f03 test(docs-infra): add e2e test for the contributors page ()
Previously, if the shape of data in `contributors.json` was incorrect,
there would be a runtime error (when trying to parse the data), which
would result in a blank page. The likelihood for this happening is
higher after , where the shape of data changed.

This commit adds some basic e2e tests that verify the page works as
expected and there are contributors listed.

PR Close 
2019-04-01 11:24:42 -07:00
George Kalpakas
cd6581e4f0 docs: use smaller image for Jason Bedard (since it was already available) ()
PR Close 
2019-04-01 11:24:42 -07:00
Dave
76110d71d3 docs(http): add information about body content type to flush method for testing ()
PR Close 
2019-04-01 11:03:49 -07:00
Martin Mädler
a4fb0486c1 docs: fix broken changelog link ()
PR Close 
2019-04-01 11:01:39 -07:00
Filipe Silva
8a13f6b278 docs: remove ngcc steps from Ivy opt-in ()
PR Close 
2019-04-01 11:01:14 -07:00
Filipe Silva
ee7c5ed620 docs: add Ivy lazy load opt-in ()
PR Close 
2019-04-01 11:01:14 -07:00
George Kalpakas
2ff3d2d421 test(upgrade): work around SauceLabs issue with loading AngularJS files ()
Sometimes (especially on mobile browsers on SauceLabs) the script may
fail to load due to a temporary issue with the internet connection. To
avoid flakes on CI when this happens, we retry the download after some
delay.

Related to .

PR Close 
2019-04-01 10:59:45 -07:00
Paul Gschwendtner
33016b8929 fix(core): static-query schematic should detect static queries in getters. ()
Queries can also be statically accessed within getters. e.g.

```ts
ngOnInit() {
  this.myQueryGetter.doSomething();
}
```

In that case we need to check if the `myQueryGetter` definition accesses
a query statically. As we need to use the type checker for every property acess
within lifecylce hooks, the schematic might become slower than before, but considering
that this is a one-time execution, it is totally fine using the type-checker extensively.

PR Close 
2019-04-01 10:58:51 -07:00
George Kalpakas
b2c03b8cd4 build(docs-infra): remove unused PhantomJS dependency ()
PhantomJS is [not being developed any more][1] and with modern
alternatives (such as Chrome headless) there is no reason to keep it as
a dependency.

[1]: https://github.com/ariya/phantomjs/issues/15344

PR Close 
2019-04-01 10:57:30 -07:00
George Kalpakas
fd4c939394 build(docs-infra): upgrade cli command docs sources to f63f8c60f ()
Updating [angular#master](https://github.com/angular/angular/tree/master) from [cli-builds#master](https://github.com/angular/cli-builds/tree/master).
Relevant changes in [commit range](35df0b528...f63f8c60f):

**Modified**
- help/build.json

Closes 

PR Close 
2019-04-01 10:55:22 -07:00
Amit Chaurasia
6759aa68dc docs: added complete path to the spec file ()
PR Close 
2019-04-01 10:54:30 -07:00
Roland Rytz
ab4be7bf80 docs: fix typo in description of angular.io/index.html ()
change "compeling" to "compelling" in description meta tag

PR Close 
2019-04-01 10:54:08 -07:00