Commit Graph

20406 Commits

Author SHA1 Message Date
mgechev 72a00dcc6b docs: add a style recommendation for initializing inputs (#40698)
This practice is to better align with `strictPropertyInitialization`
which is coming by default with strict mode in v12.

PR Close #40698
2021-02-12 17:07:30 -08:00
Bjarki 980f6a4958 fix(core): address Trusted Types bug in Chrome 83 (#40815)
In Chrome 83 passing a TrustedScript to eval just returns the
TrustedScript back without evaluating it, causing the
newTrustedFunctionFor{Dev,JIT} functions to fail. This is a browser bug
that has been fixed in Chrome 84, and only affects Angular applications
running with JIT (which includes unit tests).

As a temporary workaround for users still on Chrome 83, detect when this
occurs in the newTrustedFunctionFor* functions and fall back to the
straightforward, non-Trusted Types compatible implementation. The only
combination that is left affected consists of Angular applications
running with JIT, that have explicitly configured Trusted Types in
enforcement mode, with users that are still on Chrome 83.

Also correct docstring for newTrustedFunctionForJIT.

PR Close #40815
2021-02-12 16:59:58 -08:00
mgechev 9661873df1 docs: add ng-conf 2021 (#40783)
PR Close #40783
2021-02-12 16:49:22 -08:00
Nils Mehlhorn 5554a3f174 docs: add NgRx book to resources (#39841)
PR Close #39841
2021-02-12 16:48:57 -08:00
Jeremy Elbourn bbbfa3e6bd docs: clarify that support schedule is subject to change (#40770)
Initially raised due to #39509, this change updates our
"Support policy and schedule" with the same disclaimer
from the "Release frequency" section above.

PR Close #40770
2021-02-12 16:14:52 -08:00
Sam Hrncir ccd10ea315 docs: Clarify new ng workspace options (#40816)
Hope this helps make the tutorial go even smoother for people after me.

PR Close #40816
2021-02-12 16:13:30 -08:00
JiaLiPassion 44b8b0ffe1 release: cut the zone.js-0.11.4 release (#40775)
PR Close #40775
2021-02-12 13:33:05 -08:00
Daniel cbb6b4a30b docs: capitalize Angular word in zone.md file (#40813)
PR Close #40813
2021-02-12 12:01:55 -08:00
Sam Hrncir b4c8143cc2 docs: Update start-deployment.md (#40817)
Updated section reference to current name listed in sidebar.
PR Close #40817
2021-02-12 09:30:03 -08:00
Pete Bacon Darwin 9cb43fb507 refactor(compiler-cli): implement `ɵɵngDeclarePipe()` (#40803)
This commit implements creating of `ɵɵngDeclarePipe()` calls in partial
compilation, and processing of those calls in the linker and JIT compiler.

See #40677

PR Close #40803
2021-02-12 09:00:16 -08:00
Sam Hrncir 6425a6d543 docs: typo fix (#40804)
PR Close #40804
2021-02-12 08:59:47 -08:00
George Kalpakas 9cdf654293 build(docs-infra): upgrade cli command docs sources to 84b99497f (#40824)
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](c61df5d30...84b99497f):

**Modified**
- help/generate.json
- help/new.json

PR Close #40824
2021-02-12 08:59:11 -08:00
George Kalpakas 43ecf8a77b feat(platform-server): allow shimming the global env sooner (#40559)
`@angular/platform-server` provides the foundation for rendering an
Angular app on the server. In order to achieve that, it uses a
server-side DOM implementation (currently [domino][1]).

For rendering on the server to work as closely as possible to running
the app on the browser, we need to make DOM globals (such as `Element`,
`HTMLElement`, etc.), which are normally provided by the browser,
available as globals on the server as well.

Currently, `@angular/platform-server` achieves this by extending the
`global` object with the DOM implementation provided by `domino`. This
assignment happens in the [setDomTypes()][2] function, which is
[called in a `PLATFORM_INITIALIZER`][3]. While this works in most cases,
there are some scenarios where the DOM globals are needed sooner (i.e.
before initializing the platform). See, for example, #24551 and #39950
for more details on such issues.

This commit provides a way to solve this problem by exposing a
side-effect-ful entry-point (`@angular/platform-server/init`), that
shims the `global` object with DOM globals. People will be able to
import this entry-point in their server-rendered apps before
bootstrapping the app (for example, in their `main.server.ts` file).
(See also [#39950 (comment)][4].)

In a future update, the [`universal` schematics][5] will include such an
import by default in newly generated projects.

[1]: https://www.npmjs.com/package/domino
[2]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/domino_adapter.ts#L17-L21
[3]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/server.ts#L33
[4]: https://github.com/angular/angular/issues/39950#issuecomment-747598403
[5]: https://github.com/angular/angular-cli/blob/cc51432661eb4ab4b6a3/packages/schematics/angular/universal

PR Close #40559
2021-02-12 08:55:25 -08:00
George Kalpakas 177eab2260 ci: add integration test for Angular Elemens with SSR (#40559)
This commit adds an integration test that uses `@angular/elements` with
`@angular/platform-server` in order to highlight a current
incompatibility. The issue will be fixed in a subsequent commit.

PR Close #40559
2021-02-12 08:55:25 -08:00
George Kalpakas b5efc95ae5 build(platform-server): add `domino` to the list of dependencies (#40559)
The `platform-server` package currently depends on the [domino][1]
package. This commit adds `domino` to the list of dependencies for the
`platform-server` `ng_module` target.

[1]: https://www.npmjs.com/package/domino

PR Close #40559
2021-02-12 08:55:25 -08:00
Sam Hrncir ca43938d24 docs: copy paste error (#40812)
The removed bit was copied and pasted from a previous section.  Not relevent for the particular step of the tutorial.
The removed bit can we found as intended in __Adding Navigation__ section.
PR Close #40812
2021-02-11 15:59:55 -08:00
Alex Rickabaugh 80f4ff3338 fix(compiler-cli): set TS original node on imported namespace identifiers (#40711)
This commit causes imports added by ngtsc's `ImportManager` to have their
TypeScript "original node" set to the generated `ts.ImportDeclaration`
statement.

In g3, the tsickle transformer runs after the Angular transformer and post-
processes Angular's compilation output. One of its post-processing tasks is
to transform generated imports and references to imported symbols from the
commonjs module system to the g3 module system. Part of this transformation
involves recognizing modules with specific metadata and altering references
to symbols from those modules accordingly.

Normally, tsickle can rely on TypeScript's binding for an imported symbol to
find its origin module and thus the correct metadata for the symbol. However
the Angular transform generates new synthetic imports which don't have such
binding information. Angular's imports are always namespace imports of the
form:

```
import * as qualifier 'module/specifier';
```

References to such an import are then of the form `qualifier.SymbolName`.

To process such imports properly, tsickle needs to be able to associate the
reference to `qualifier` in the expression `qualifer.SymbolName` with the
`ts.ImportDeclaration` statement that defines it. It expects to do this by
looking at the `ts.getOriginalNode()` for the `qualifier` reference, which
should be the `ts.ImportDeclaration`. This commit changes ngtsc's import
generation mechanism to set the original node on `qualifier` identifiers
according to this expectation.

This commit is not tested in the direct compiler tests, since:

1) there is no observable behavior externally from setting the original node
2) we don't have tests that intercept transformer operations (which could be
   used to directly assert against the AST nodes)
3) tsickle's published version does not (yet) contain the g3-specific
   transformations which rely on the original node and would thus allow the
   behavior to be observed.

Instead, we rely on the g3 testing suite to validate the correctness of this
fix. Breaking this functionality would cause g3 compilation errors for
targets, since tsickle would be unable to transform imports correctly.

PR Close #40711
2021-02-11 15:58:25 -08:00
Alan Agius 5eb195416b fix(compiler-cli): extend `angularCompilerOptions` in tsconfig from node (#40694)
TypeScript supports non rooted extends, we should do the same

b346f5764e/src/compiler/commandLineParser.ts (L2603-L2628)

Closes: #36715

PR Close #40694
2021-02-11 13:29:51 -08:00
Alan Agius 719f9ef7ac refactor(bazel): use `readConfiguration` to read config file (#40694)
With this change we clean up the parsing of tsconfig files.

PR Close #40694
2021-02-11 13:29:51 -08:00
Alan Agius b7c4d07e81 fix(compiler-cli): `readConfiguration` existing options should override options in tsconfig (#40694)
At the moment, when passing an Angular Compiler option
in the `existingOptions` it doesn't override the defined in the TSConfig.

PR Close #40694
2021-02-11 13:29:51 -08:00
Joey Perrott dfc9f36dd8 build: update browserstacktunnel-wrapper (#40810)
Update browserstacktunnel-wrapper to address security vulnerabilities

PR Close #40810
2021-02-11 13:11:14 -08:00
Joey Perrott 09b5ad5733 build: update cldr-data-downloader (#40810)
Update cldr-data-downloader to address security vulnerabilities.

PR Close #40810
2021-02-11 13:11:14 -08:00
Joey Perrott af6451060d build: update gulp and gulp-conventional-changelog (#40810)
Update gulp and gulp-conventional-changelog to address security vulnerabilities.

PR Close #40810
2021-02-11 13:11:14 -08:00
Joey Perrott e27787a583 build: remove jpm dependency (#40807)
Remove our dependency on jpm as it goes unused in our repository.

PR Close #40807
2021-02-11 12:30:55 -08:00
Joey Perrott fcf00de864 ci: remove BES usages from CI (#40809)
Removes BES configuration from CI bazel configuration as it is increasingly seeing timeouts
causing failures, but the uploaded results go largely unlooked at.

PR Close #40809
2021-02-11 12:28:55 -08:00
Joey Perrott 267c566baf Revert "fix(router): fix load interaction of navigation and preload strategies (#40389)" (#40806)
This reverts commit e9a19a6152.

PR Close #40806
2021-02-11 11:59:10 -08:00
GChuf f72626d3cc build: Update dependencies (#40726)
Updates some dependencies.

PR Close #40726
2021-02-11 11:17:21 -08:00
Paul Gammans e9a19a6152 fix(router): fix load interaction of navigation and preload strategies (#40389)
Fix router to ensure that a route module is only loaded once especially
in relation to the use of preload strategies with delayed or partial
loading.

Add test to check the interaction of PreloadingStrategy and normal
router navigation under differing scenarios.
Checking:
 * Prevention of duplicate loading of modules.
   related to #26557
 * Prevention of duplicate RouteConfigLoad(Start|End) events
   related to #22842
 * Ensuring preload strategy remains active for submodules if needed
   The selected preload strategy should still decide when to load submodules
 * Possibility of memory leak with unfinished preload subscription
   related to #26557
 * Ensure that the stored loader promise is cleared so that subsequent
   load will try the fetch again.
 * Add error handle error from loadChildren
 * Ensure we handle error from with NgModule create

Fixes #26557 #22842 #26557

PR Close #40389
2021-02-11 09:15:09 -08:00
Joey Perrott c22ae5d9b9 fix(dev-infra): update npm package subsitutions to reflect no longer having an imported workspace (#40785)
Update replacements of the `//dev-infra/` piece of bazel path segments to reference the `@npm//`
workspace rather than creating its own workspace.

PR Close #40785
2021-02-11 09:13:00 -08:00
Joey Perrott 2d7bc1d301 ci: Remove language-service from testing group (#40795)
Much like the compiler-cli, the language-service package has internal testing
tools that are not intended for external use and do not need fw-testing review.
See #40679.

PR Close #40795
2021-02-11 09:03:23 -08:00
waterplea 7ca244a38b docs(core): add missing dot at the end of the sentence (#40800)
PR Close #40800
2021-02-11 09:00:51 -08:00
waterplea ef8bf6745c docs(core): fix typo in interpolation property description (#40800)
PR Close #40800
2021-02-11 09:00:51 -08:00
Joey Perrott 68da05dc47 Revert "ci: Remove language-service from testing group (#40787)" (#40794)
This reverts commit 06671e85f9.

PR Close #40794
2021-02-10 16:06:21 -08:00
kirjs c56ecab515 feat(common): support ICU standard "stand alone day of week" with `DatePipe` (#40766)
This commit adds support for Finnish full date formatting,
as well as `c/cc/ccc/cccc/ccccc/cccccc` date formats in the `DatePipe`.

Fixes #26922

PR Close #40766
2021-02-10 16:03:06 -08:00
Nicholas Papadopoulos 6f017a4d60 docs: fix typo in workspace config docs (#40784)
PR Close #40784
2021-02-10 16:01:12 -08:00
Andrew Scott 06671e85f9 ci: Remove language-service from testing group (#40787)
Much like the compiler-cli, the language-service package has internal testing
tools that are not intended for external use and do not need fw-testing review.
See #40679.

PR Close #40787
2021-02-10 16:00:31 -08:00
Joey Perrott 9b4263bf70
release: cut the v12.0.0-next.0 release (#40793) 2021-02-10 15:32:04 -08:00
Alex Rickabaugh 06ee07b15f docs: release notes for the v11.2.0 release (#40791)
PR Close #40791
2021-02-10 14:50:13 -08:00
Amit Gharat fface518f1 docs: add Angular + NgRx book by the asian BPB Publications (#39680)
PR Close #39680
2021-02-10 11:14:34 -08:00
Dmitry Drobyshev 38972653fa fix(http): emit error on XMLHttpRequest abort event (#40767)
Before this change, when Google Chrome cancels a XMLHttpRequest, an Observable of the response
never finishes. This happens, for example, when you put your computer to sleep or just press
Ctrl+S to save the browser page. After this commit, if request is canceled or aborted an
appropriate Observable will be completed with an error.

Fixes #22324

PR Close #40767
2021-02-10 11:13:05 -08:00
Alexey Elin ddff6b63d7 docs: fix absent documentation for digitsInfo parameter in the API docs (#40746)
PR Close #40746
2021-02-10 11:09:09 -08:00
Alexey Elin 7a8821c9aa docs: add link to component-less routes description. (#40741)
Currently it's not clear what a component-less route is. Add a link to  make it clear

PR Close #40741
2021-02-10 11:08:39 -08:00
JoostK bbf61fc2be fix(compiler): include parenthesis in expression source spans (#40740)
The parser does not include parenthesis in the AST, so if a LHS
expression would be parenthesized then its start span would start
after the opening parenthesis. Previously, some parent AST nodes would
be created with the start span of its LHS as its own start, so this
resulted in the parent AST node not encompassing the opening parenthesis
in its source span. This commit fixes the issue by capturing the start
index prior to parsing a child AST tree, which is then used as the
start of the source span of the the parent AST node that is parsed.

Fixes #40721

PR Close #40740
2021-02-10 11:07:11 -08:00
JoostK 94f4d5cba6 refactor(compiler-cli): remove event output helper from TCB (#40738)
In 5c547675b11a24b16c20df1718583a0e7ed49cbd the `EventEmitter.subscribe`
API was extended with a new signature that allows the emitter's generic
type `T` to flow into the subscribe callback. This new signature removes
the need for the special `_outputHelper` function that used to be
emitted into TCBs when `strictOutputEventTypes`/`strictTemplates` is
enabled.

PR Close #40738
2021-02-10 11:06:35 -08:00
Mickael Istria e895166082 docs(language-service): Add note about Eclipse IDE support of Angular LS (#40551)
Mention Eclipse Wild Web Developer that ships with Angular language
service.

PR Close #40551
2021-02-10 11:05:52 -08:00
Kristiyan Kostadinov 9478cda83b fix(compiler): throw error for duplicate template references (#40538)
Adds an error if a reference is used more than once on the same element (e.g. `<div #a #a>`).
We used to have this error in ViewEngine, but it wasn't ported over to Ivy.

Fixes #40536.

PR Close #40538
2021-02-10 11:05:16 -08:00
abarghoud 03f0b157c1 fix(common): date is not correctly formatted when year is between 0 and 99 (#40448)
use setFullYear method when parsing date to avoid javascript date factory behaviour

Fixes #40377

PR Close #40448
2021-02-10 11:04:37 -08:00
Kanstantsin Kamkou 8f2260a073 docs: clarify observables recommendation (#39237)
Observables are not the only async mechanism that Angular employs.
This change respects that application developers are not required to
use Observables in their own application architecture.

Closes #39155

PR Close #39237
2021-02-10 11:04:04 -08:00
stsogoo 0654c05c41 fix(core): properly move embedded views of dynamic component's projectable nodes (#37167)
This commit fixes the issue of the ASSERTION ERROR issue when
a projected node(RNode) inside an array is checked against the types
of TNodeType.Element, TNodeType.Container, TNodeType.ElementContainer,
TNodeType.IcuContainer, TNodeType.Projection. As it's inside an array,
it doesn't fall into any of those types, as a result, it throws
the ASSERTION ERROR.

PR Close #37120

PR Close #37167
2021-02-10 11:03:06 -08:00
Zach Arend 378da71f27 fix(compiler-cli): don't crash when we can't resolve a resource (#40660)
Produces a diagnostic when we cannot resolve a component's external style sheet or external template.

The previous behavior was to throw an exception, which crashed the
Language Service.

fixes angular/vscode-ng-language-service#1079

PR Close #40660
2021-02-10 10:48:33 -08:00