Compare commits
24 Commits
10.0.0-rc.
...
10.0.0
Author | SHA1 | Date | |
---|---|---|---|
345940bbc1 | |||
c49507b289 | |||
c730142508 | |||
27aa00b15f | |||
36a00a255b | |||
0e3249c89b | |||
920019ab70 | |||
82c8b44db7 | |||
bb3a307d5a | |||
dcb0ddaf5e | |||
4c1edd52c5 | |||
d512e27979 | |||
0619d82e0b | |||
a4038d5b94 | |||
e3d5e1fab7 | |||
035036308a | |||
0d29259d9b | |||
26b0f3dc96 | |||
5c9306b0fe | |||
3befb0e4b9 | |||
97bb88f10b | |||
6c7467a58b | |||
c579a85c12 | |||
400fdd08fd |
140
.pullapprove.yml
140
.pullapprove.yml
@ -34,41 +34,8 @@
|
||||
####################################################################################
|
||||
# GitHub usernames
|
||||
####################################################################################
|
||||
# aikidave - Dave Shevitz
|
||||
# alan-agius4 - Alan Agius
|
||||
# alxhub - Alex Rickabaugh
|
||||
# AndrewKushnir - Andrew Kushnir
|
||||
# andrewseguin - Andrew Seguin
|
||||
# atscott - Andrew Scott
|
||||
# ayazhafiz - Ayaz Hafiz
|
||||
# clydin - Charles Lyding
|
||||
# crisbeto - Kristiyan Kostadinov
|
||||
# dennispbrown - Denny Brown
|
||||
# devversion - Paul Gschwendtner
|
||||
# dgp1130 - Doug Parker
|
||||
# filipesilva - Filipe Silva
|
||||
# gkalpak - Georgios Kalpakas
|
||||
# gregmagolan - Greg Magolan
|
||||
# IgorMinar - Igor Minar
|
||||
# jbogarthyde - Judy Bogart
|
||||
# jelbourn - Jeremy Elbourn
|
||||
# JiaLiPassion - Jia Li
|
||||
# JoostK - Joost Koehoorn
|
||||
# josephperrott - Joey Perrott
|
||||
# juleskremer - Jules Kremer
|
||||
# kapunahelewong - Kapunahele Wong
|
||||
# kara - Kara Erickson
|
||||
# kyliau - Keen Yee Liau
|
||||
# manughub - Manu Murthy
|
||||
# matsko - Matias Niemela
|
||||
# mgechev - Minko Gechev
|
||||
# mhevery - Miško Hevery
|
||||
# michaelprentice - Michael Prentice
|
||||
# mmalerba - Miles Malerba
|
||||
# petebacondarwin - Pete Bacon Darwin
|
||||
# pkozlowski-opensource - Pawel Kozlowski
|
||||
# robwormald - Rob Wormald
|
||||
# StephenFluin - Stephen Fluin
|
||||
# See reviewer list under `required-minimum-review` group. Team member names and
|
||||
# usernames are managed there.
|
||||
|
||||
|
||||
####################################################################################
|
||||
@ -100,8 +67,16 @@ version: 3
|
||||
# Meta field that goes unused by PullApprove to allow for defining aliases to be
|
||||
# used throughout the config.
|
||||
meta:
|
||||
1: &can-be-global-approved "\"global-approvers\" not in groups.approved"
|
||||
2: &can-be-global-docs-approved "\"global-docs-approvers\" not in groups.approved"
|
||||
can-be-global-approved: &can-be-global-approved "\"global-approvers\" not in groups.approved"
|
||||
can-be-global-docs-approved: &can-be-global-docs-approved "\"global-docs-approvers\" not in groups.approved"
|
||||
defaults: &defaults
|
||||
reviews:
|
||||
# Authors provide their approval implicitly, this approval allows for a reviewer
|
||||
# from a group not to need a review specifically for an area of the repository
|
||||
# they own. This is coupled with the `required-minimum-review` group which requires
|
||||
# that all PRs are reviewed by at least one team member who is not the author of
|
||||
# the PR.
|
||||
author_value: 1
|
||||
|
||||
# turn on 'draft' support
|
||||
# https://docs.pullapprove.com/config/github-api-version/
|
||||
@ -121,6 +96,55 @@ pullapprove_conditions:
|
||||
|
||||
|
||||
groups:
|
||||
# =========================================================
|
||||
# Require review on all PRs
|
||||
#
|
||||
# All PRs require at least one review. This rule will not
|
||||
# request any reviewers, however will require that at least
|
||||
# one review is provided before the group is satisfied.
|
||||
# =========================================================
|
||||
required-minimum-review:
|
||||
reviews:
|
||||
request: 0 # Do not request any reviews from the reviewer group
|
||||
required: 1 # Require that all PRs have approval from at least one of the users in the group
|
||||
author_value: 0 # The author of the PR cannot provide an approval for themself
|
||||
reviewers:
|
||||
users:
|
||||
- aikidave # Dave Shevitz
|
||||
- alan-agius4 # Alan Agius
|
||||
- alxhub # Alex Rickabaugh
|
||||
- AndrewKushnir # Andrew Kushnir
|
||||
- andrewseguin # Andrew Seguin
|
||||
- atscott # Andrew Scott
|
||||
- ayazhafiz # Ayaz Hafiz
|
||||
- clydin # Charles Lyding
|
||||
- crisbeto # Kristiyan Kostadinov
|
||||
- dennispbrown # Denny Brown
|
||||
- devversion # Paul Gschwendtner
|
||||
- dgp1130 # Doug Parker
|
||||
- filipesilva # Filipe Silva
|
||||
- gkalpak # Georgios Kalpakas
|
||||
- gregmagolan # Greg Magolan
|
||||
- IgorMinar # Igor Minar
|
||||
- jbogarthyde # Judy Bogart
|
||||
- jelbourn # Jeremy Elbourn
|
||||
- JiaLiPassion # Jia Li
|
||||
- JoostK # Joost Koehoorn
|
||||
- josephperrott # Joey Perrott
|
||||
- juleskremer # Jules Kremer
|
||||
- kapunahelewong # Kapunahele Wong
|
||||
- kara # Kara Erickson
|
||||
- kyliau # Keen Yee Liau
|
||||
- manughub # Manu Murthy
|
||||
- matsko # Matias Niemela
|
||||
- mgechev # Minko Gechev
|
||||
- mhevery # Miško Hevery
|
||||
- michaelprentice # Michael Prentice
|
||||
- mmalerba # Miles Malerba
|
||||
- petebacondarwin # Pete Bacon Darwin
|
||||
- pkozlowski-opensource # Pawel Kozlowski
|
||||
- StephenFluin # Stephen Fluin
|
||||
|
||||
# =========================================================
|
||||
# Global Approvers
|
||||
#
|
||||
@ -161,6 +185,7 @@ groups:
|
||||
# Framework: Animations
|
||||
# =========================================================
|
||||
fw-animations:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -185,6 +210,7 @@ groups:
|
||||
# Framework: Compiler
|
||||
# =========================================================
|
||||
fw-compiler:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -209,6 +235,7 @@ groups:
|
||||
# Framework: Compiler / ngcc
|
||||
# =========================================================
|
||||
fw-ngcc:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -225,6 +252,7 @@ groups:
|
||||
# Framework: Migrations
|
||||
# =========================================================
|
||||
fw-migrations:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -240,6 +268,7 @@ groups:
|
||||
# Framework: Core
|
||||
# =========================================================
|
||||
fw-core:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -359,6 +388,7 @@ groups:
|
||||
# Framework: Http
|
||||
# =========================================================
|
||||
fw-http:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -380,6 +410,7 @@ groups:
|
||||
# Framework: Elements
|
||||
# =========================================================
|
||||
fw-elements:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -400,6 +431,7 @@ groups:
|
||||
# Framework: Forms
|
||||
# =========================================================
|
||||
fw-forms:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -432,6 +464,7 @@ groups:
|
||||
# Framework: i18n
|
||||
# =========================================================
|
||||
fw-i18n:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -465,6 +498,7 @@ groups:
|
||||
# Framework: Platform Server
|
||||
# =========================================================
|
||||
fw-platform-server:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -484,6 +518,7 @@ groups:
|
||||
# Framework: Router
|
||||
# =========================================================
|
||||
fw-router:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -506,6 +541,7 @@ groups:
|
||||
# Framework: Service Worker
|
||||
# =========================================================
|
||||
fw-service-worker:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -533,6 +569,7 @@ groups:
|
||||
# Framework: Upgrade
|
||||
# =========================================================
|
||||
fw-upgrade:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -563,6 +600,7 @@ groups:
|
||||
# Framework: Testing
|
||||
# =========================================================
|
||||
fw-testing:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -584,6 +622,7 @@ groups:
|
||||
# Framework: Benchmarks
|
||||
# =========================================================
|
||||
fw-benchmarks:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -600,6 +639,7 @@ groups:
|
||||
# Framework: Playground
|
||||
# =========================================================
|
||||
fw-playground:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -617,6 +657,7 @@ groups:
|
||||
# Framework: Security
|
||||
# =========================================================
|
||||
fw-security:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -646,6 +687,7 @@ groups:
|
||||
# Bazel
|
||||
# =========================================================
|
||||
bazel:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -664,6 +706,7 @@ groups:
|
||||
# Language Service
|
||||
# =========================================================
|
||||
language-service:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -683,6 +726,7 @@ groups:
|
||||
# zone.js
|
||||
# =========================================================
|
||||
zone-js:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -701,6 +745,7 @@ groups:
|
||||
# Benchpress
|
||||
# =========================================================
|
||||
benchpress:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -718,6 +763,7 @@ groups:
|
||||
# Integration Tests
|
||||
# =========================================================
|
||||
integration-tests:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -735,6 +781,7 @@ groups:
|
||||
# Docs: Gettings Started & Tutorial
|
||||
# =========================================================
|
||||
docs-getting-started-and-tutorial:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -767,6 +814,7 @@ groups:
|
||||
# Docs: Marketing
|
||||
# =========================================================
|
||||
docs-marketing:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -789,6 +837,7 @@ groups:
|
||||
# Docs: Observables
|
||||
# =========================================================
|
||||
docs-observables:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -814,6 +863,7 @@ groups:
|
||||
# Docs: Packaging, Tooling, Releasing
|
||||
# =========================================================
|
||||
docs-packaging-and-releasing:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -833,7 +883,7 @@ groups:
|
||||
'aio/content/guide/migration-localize.md',
|
||||
'aio/content/guide/migration-module-with-providers.md',
|
||||
'aio/content/guide/static-query-migration.md',
|
||||
'aio/content/guide/updating-to-version-9.md',
|
||||
'aio/content/guide/updating-to-version-10.md',
|
||||
'aio/content/guide/ivy-compatibility.md',
|
||||
'aio/content/guide/ivy-compatibility-examples.md'
|
||||
])
|
||||
@ -873,6 +923,7 @@ groups:
|
||||
# Docs: CLI
|
||||
# =========================================================
|
||||
docs-cli:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -889,8 +940,12 @@ groups:
|
||||
'aio/content/images/guide/deployment/**',
|
||||
'aio/content/guide/file-structure.md',
|
||||
'aio/content/guide/ivy.md',
|
||||
'aio/content/guide/strict-mode.md',
|
||||
'aio/content/guide/web-worker.md',
|
||||
'aio/content/guide/workspace-config.md',
|
||||
'aio/content/guide/migration-solution-style-tsconfig.md',
|
||||
'aio/content/guide/migration-update-module-and-target-compiler-options.md',
|
||||
'aio/content/guide/migration-update-libraries-tslib.md',
|
||||
])
|
||||
reviewers:
|
||||
users:
|
||||
@ -903,6 +958,7 @@ groups:
|
||||
# Docs: CLI Libraries
|
||||
# =========================================================
|
||||
docs-libraries:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -923,6 +979,7 @@ groups:
|
||||
# Docs: Schematics
|
||||
# =========================================================
|
||||
docs-schematics:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -945,6 +1002,7 @@ groups:
|
||||
# Docs-infra
|
||||
# =========================================================
|
||||
docs-infra:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- *can-be-global-docs-approved
|
||||
@ -974,6 +1032,7 @@ groups:
|
||||
# Dev-infra
|
||||
# =========================================================
|
||||
dev-infra:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -1038,6 +1097,7 @@ groups:
|
||||
# Public API
|
||||
# =========================================================
|
||||
public-api:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -1066,6 +1126,7 @@ groups:
|
||||
# Size tracking
|
||||
# ================================================
|
||||
size-tracking:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -1088,6 +1149,7 @@ groups:
|
||||
# Circular dependencies
|
||||
# ================================================
|
||||
circular-dependencies:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -1110,6 +1172,7 @@ groups:
|
||||
# Code Ownership
|
||||
# =========================================================
|
||||
code-ownership:
|
||||
<<: *defaults
|
||||
conditions:
|
||||
- *can-be-global-approved
|
||||
- >
|
||||
@ -1125,6 +1188,7 @@ groups:
|
||||
# Catch all for if no groups match the code change
|
||||
# ====================================================
|
||||
fallback:
|
||||
<<: *defaults
|
||||
# A group is considered to be `active` for a PR if at least one of group's
|
||||
# conditions matches the PR.
|
||||
#
|
||||
|
27
CHANGELOG.md
27
CHANGELOG.md
@ -1,3 +1,30 @@
|
||||
<a name="10.0.0"></a>
|
||||
# [10.0.0](https://github.com/angular/angular/compare/10.0.0-rc.6...10.0.0) (2020-06-24)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **forms:** optimize internal method _anyControls in FormGroup ([#32534](https://github.com/angular/angular/issues/32534)) ([6c7467a](https://github.com/angular/angular/commit/6c7467a))
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<a name="10.0.0"></a>
|
||||
# [10.0.0](https://github.com/angular/angular/compare/10.0.0-next.0...10.0.0) (2020-06-24)
|
||||
|
||||
|
||||
### Release Highlights & Update instructions
|
||||
To learn about the release highlights and our CLI-powered automated update workflow for your projects please check out the [v10 release announcement](https://blog.angular.io/TODO).
|
||||
|
||||
|
||||
#### Dependency updates
|
||||
@angular/compiler-cli now requires:
|
||||
- TypeScript 3.9
|
||||
|
||||
TODO: concat all the 10.0.0-next.* & -rc.* release notes, and group them by area/package just like in https://github.com/angular/angular/blob/master/CHANGELOG.md#900-2020-02-06 but consider listing features before bugfixes because people care about feature in major releases more than about bug fixes.
|
||||
-->
|
||||
|
||||
|
||||
<a name="10.0.0-rc.6"></a>
|
||||
# [10.0.0-rc.6](https://github.com/angular/angular/compare/10.0.0-rc.5...10.0.0-rc.6) (2020-06-15)
|
||||
|
||||
|
@ -22,7 +22,7 @@ Do not open issues for general support questions as we want to keep GitHub issue
|
||||
Stack Overflow is a much better place to ask questions since:
|
||||
|
||||
- there are thousands of people willing to help on Stack Overflow
|
||||
- questions and answers stay available for public viewing so your question / answer might help someone else
|
||||
- questions and answers stay available for public viewing so your question/answer might help someone else
|
||||
- Stack Overflow's voting system assures that the best answers are prominently visible.
|
||||
|
||||
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
|
||||
@ -57,7 +57,7 @@ We want to fix all the issues as soon as possible, but before fixing a bug we ne
|
||||
|
||||
A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem.
|
||||
|
||||
We will be insisting on a minimal reproduction scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience, users often find coding problems themselves while preparing a minimal reproduction. We understand that sometimes it might be hard to extract essential bits of code from a larger codebase but we really need to isolate the problem before we can fix it.
|
||||
We will be insisting on a minimal reproduction scenario in order to save maintainers' time and ultimately be able to fix more bugs. Interestingly, from our experience, users often find coding problems themselves while preparing a minimal reproduction. We understand that sometimes it might be hard to extract essential bits of code from a larger codebase but we really need to isolate the problem before we can fix it.
|
||||
|
||||
Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, we are going to close an issue that doesn't have enough info to be reproduced.
|
||||
|
||||
@ -70,7 +70,7 @@ Before you submit your Pull Request (PR) consider the following guidelines:
|
||||
1. Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR
|
||||
that relates to your submission. You don't want to duplicate effort.
|
||||
1. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add.
|
||||
Discussing the design up front helps to ensure that we're ready to accept your work.
|
||||
Discussing the design upfront helps to ensure that we're ready to accept your work.
|
||||
1. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
|
||||
We cannot accept code without this. Make sure you sign with the primary email address of the Git identity that has been granted access to the Angular repository.
|
||||
1. Fork the angular/angular repo.
|
||||
@ -85,8 +85,7 @@ Before you submit your Pull Request (PR) consider the following guidelines:
|
||||
1. Run the full Angular test suite, as described in the [developer documentation][dev-doc],
|
||||
and ensure that all tests pass.
|
||||
1. Commit your changes using a descriptive commit message that follows our
|
||||
[commit message conventions](#commit). Adherence to these conventions
|
||||
is necessary because release notes are automatically generated from these messages.
|
||||
[commit message conventions](#commit). Adherence to these conventions is necessary because release notes are automatically generated from these messages.
|
||||
|
||||
```shell
|
||||
git commit -a
|
||||
@ -181,13 +180,13 @@ Samples: (even more [samples](https://github.com/angular/angular/commits/master)
|
||||
docs(changelog): update changelog to beta.5
|
||||
```
|
||||
```
|
||||
fix(release): need to depend on latest rxjs and zone.js
|
||||
fix(release): need to depend on the latest rxjs and zone.js
|
||||
|
||||
The version in our package.json gets copied to the one we publish, and users need the latest of these.
|
||||
```
|
||||
|
||||
### Revert
|
||||
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
||||
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
||||
|
||||
### Type
|
||||
Must be one of the following:
|
||||
@ -282,7 +281,7 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise
|
||||
* https://help.github.com/articles/about-commit-email-addresses/
|
||||
* https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/
|
||||
|
||||
Note that if you have more than one Git identity, it is important to verify that you are logged in with the same ID with which you signed the CLA, before you commit changes. If not, your PR will fail the CLA check.
|
||||
Note that if you have more than one Git identity, it is important to verify that you are logged in with the same ID with which you signed the CLA before you commit changes. If not, your PR will fail the CLA check.
|
||||
|
||||
<hr>
|
||||
|
||||
|
10
aio/content/examples/i18n/stackblitz.json
Normal file
10
aio/content/examples/i18n/stackblitz.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"description": "i18n",
|
||||
"files":[
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js",
|
||||
"!**/*.[0-9].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["Angular", "i18n", "internationalization"]
|
||||
}
|
@ -490,6 +490,56 @@ If you rely on the behavior that the same object instance should cause change de
|
||||
- Clone the resulting value so that it has a new identity.
|
||||
- Explicitly call [`ChangeDetectorRef.detectChanges()`](api/core/ChangeDetectorRef#detectchanges) to force the update.
|
||||
|
||||
{@a deprecated-cli-flags}
|
||||
## Deprecated CLI APIs and Options
|
||||
|
||||
This section contains a complete list all of the currently deprecated CLI flags.
|
||||
|
||||
### @angular-devkit/build-angular
|
||||
|
||||
| API/Option | May be removed in | Notes |
|
||||
| ------------------------------- | ----------------- |-------------------------------------------------------------------------------- |
|
||||
| `i18nFile` | <!--v9--> v11 | Specified in the project locale configuration in version 9 and later. |
|
||||
| `i18nFormat` | <!--v9--> v11 | Format is now automatically detected. |
|
||||
| `i18nLocale` | <!--v9--> v11 | New [localization option](/guide/i18n#localize-config) in version 9 and later. |
|
||||
| `lazyModules` | <!--v9--> v11 | Used with deprecated SystemJsNgModuleLoader. |
|
||||
| `rebaseRootRelativeCssUrls` | <!--v8--> v11 | Intended only to assist with specific migration issues. |
|
||||
| `scripts[].lazy` | <!--v8--> v11 | Renamed to `scripts[].inject`. |
|
||||
| `styles[].lazy` | <!--v8--> v11 | Renamed to `styles[].inject`. |
|
||||
| `i18nFormat` | <!--v9--> v11 | Renamed to `format` to simplify the user experience. |
|
||||
| `i18nLocale` | <!--v9--> v11 | Redundant with project’s source locale. |
|
||||
| `scripts[].lazy` | <!--v8--> v11 | Renamed to `scripts[].inject`. |
|
||||
| `styles[].lazy` | <!--v8--> v11 | Renamed to `styles[].inject`. |
|
||||
| `i18nFile` | <!--v9--> v11 | Specified in the project locale configuration in version 9 and later. |
|
||||
| `i18nFormat` | <!--v9--> v11 | Format is now automatically detected. |
|
||||
| `i18nLocale` | <!--v9--> v11 | New [localization option](/guide/i18n#localize-config) in version 9 and later. |
|
||||
| `lazyModules` | <!--v9--> v11 | Used with deprecated SystemJsNgModuleLoader. |
|
||||
|
||||
### @angular-devkit/core
|
||||
|
||||
| API/Option | May be removed in | Notes |
|
||||
| ------------------------------- | ----------------- |-------------------------------------------------------------------------------- |
|
||||
| `ModuleNotFoundException` | <!--v8--> v10 | Not used within projects. Used with Tooling API only. Not Yarn PnP compatible and not used in the Angular CLI. Use Node.js [require.resolve](https://nodejs.org/api/modules.html#modules_require_resolve_request_options).|
|
||||
| `resolve` | <!--v8--> v10 | Not used within projects. Used with Tooling API only. Not Yarn PnP compatible and not used in the Angular CLI. Use Node.js [require.resolve](https://nodejs.org/api/modules.html#modules_require_resolve_request_options).|
|
||||
| `setResolveHook` | <!--v8--> v10 | Not used within projects. Used with Tooling API only. Not Yarn PnP compatible and not used in the Angular CLI. Use Node.js [require.resolve](https://nodejs.org/api/modules.html#modules_require_resolve_request_options).|
|
||||
| `ResolveOptions` | <!--v8--> v10 | Not used within projects. Used with Tooling API only. Not Yarn PnP compatible and not used in the Angular CLI. Use Node.js [require.resolve](https://nodejs.org/api/modules.html#modules_require_resolve_request_options).|
|
||||
| `terminal` | <!--v8--> v10 | Unused implementation of terminal codes (color). |
|
||||
| `isObservable` | <!--v8--> v10 | Not used within projects. Used with Tooling API only. Use `isObservable` function from the `rxjs` package.|
|
||||
|
||||
### @ngtools/webpack
|
||||
|
||||
| API/Option | May be removed in | Notes |
|
||||
| ------------------------------- | ----------------- |-------------------------------------------------------------------------------- |
|
||||
| `discoverLazyRoutes` | <!--v9--> TBD | Used with deprecated SystemJsNgModuleLoader. |
|
||||
| `additionalLazyModules` | <!--v9--> TBD | Used with deprecated SystemJsNgModuleLoader. |
|
||||
| `additionalLazyModuleResources` | <!--v9--> TBD | Used with deprecated SystemJsNgModuleLoader. |
|
||||
|
||||
### @schematics/angular
|
||||
|
||||
| API/Option | May be removed in | Notes |
|
||||
| ------------------------------- | ----------------- |-------------------------------------------------------------------------------- |
|
||||
| `entryComponent` | <!--v9--> TBD | No longer needed with Ivy. |
|
||||
|
||||
{@a removed}
|
||||
## Removed APIs
|
||||
|
||||
|
@ -78,6 +78,12 @@ Files at the top level of `src/` support testing and running your application. S
|
||||
| `styles.sass` | Lists CSS files that supply styles for a project. The extension reflects the style preprocessor you have configured for the project. |
|
||||
| `test.ts` | The main entry point for your unit tests, with some Angular-specific configuration. You don't typically need to edit this file. |
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
If you create an application using Angular's strict mode, you will also have an additional `package.json` file in the `src/app` directory. For more information, see [Strict mode](/guide/strict-mode).
|
||||
|
||||
</div>
|
||||
|
||||
{@a app-src}
|
||||
|
||||
Inside the `src/` folder, the `app/` folder contains your project's logic and data.
|
||||
@ -90,6 +96,7 @@ Angular components, templates, and styles go here.
|
||||
| `app/app.component.css` | Defines the base CSS stylesheet for the root `AppComponent`. |
|
||||
| `app/app.component.spec.ts` | Defines a unit test for the root `AppComponent`. |
|
||||
| `app/app.module.ts` | Defines the root module, named `AppModule`, that tells Angular how to assemble the application. Initially declares only the `AppComponent`. As you add more components to the app, they must be declared here. |
|
||||
| `app/package.json` | This file is generated only in applications created using `--strict` mode. This file is not used by package managers. It is used to tell the tools and bundlers whether the code under this directory is free of non-local [side-effects](guide/strict-mode#side-effect). |
|
||||
|
||||
### Application configuration files
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,18 +2,18 @@
|
||||
|
||||
The Angular team has worked hard to ensure Ivy is as backwards-compatible with the previous rendering engine ("View Engine") as possible.
|
||||
However, in rare cases, minor changes were necessary to ensure that the Angular's behavior was predictable and consistent, correcting issues in the View Engine implementation.
|
||||
In order to smooth the transition, we have provided [automated migrations](guide/updating-to-version-9#migrations) wherever possible so your application and library code is migrated automatically by the CLI.
|
||||
In order to smooth the transition, we have provided [automated migrations](guide/updating-to-version-10#migrations) wherever possible so your application and library code is migrated automatically by the CLI.
|
||||
That said, some applications will likely need to apply some manual updates.
|
||||
|
||||
{@a debugging}
|
||||
## How to debug errors with Ivy
|
||||
|
||||
In version 9, [a few deprecated APIs have been removed](guide/updating-to-version-9#removals) and there are a [few breaking changes](guide/updating-to-version-9#breaking-changes) unrelated to Ivy.
|
||||
In version 10, [a few deprecated APIs have been removed](guide/updating-to-version-10#removals) and there are a [few breaking changes](guide/updating-to-version-10#breaking-changes) unrelated to Ivy.
|
||||
If you're seeing errors after updating to version 9, you'll first want to rule those changes out.
|
||||
|
||||
To do so, temporarily [turn off Ivy](guide/ivy#opting-out-of-angular-ivy) in your `tsconfig.base.json` and re-start your app.
|
||||
|
||||
If you're still seeing the errors, they are not specific to Ivy. In this case, you may want to consult the [general version 9 guide](guide/updating-to-version-9). If you've opted into any of the stricter type-checking settings that are new with v9, you may also want to check out the [template type-checking guide](guide/template-typecheck).
|
||||
If you're still seeing the errors, they are not specific to Ivy. In this case, you may want to consult the [general version 10 guide](guide/updating-to-version-10). If you've opted into any of the new, stricter type-checking settings, you may also want to check out the [template type-checking guide](guide/template-typecheck).
|
||||
|
||||
If the errors are gone, switch back to Ivy by removing the changes to the `tsconfig.base.json` and review the list of expected changes below.
|
||||
|
||||
|
54
aio/content/guide/migration-solution-style-tsconfig.md
Normal file
54
aio/content/guide/migration-solution-style-tsconfig.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Solution-style `tsconfig.json` migration
|
||||
|
||||
## What does this migration do?
|
||||
|
||||
This migration adds support to existing projects for TypeScript's new ["solution-style" tsconfig feature](https://devblogs.microsoft.com/typescript/announcing-typescript-3-9/#solution-style-tsconfig).
|
||||
|
||||
Support is added by making two changes:
|
||||
1. Renaming the workspace-level `tsconfig.json` to `tsconfig.base.json`.
|
||||
All project [TypeScript configuration files](guide/typescript-configuration) will extend from this base which contains the common options used throughout the workspace.
|
||||
|
||||
2. Adding the solution `tsconfig.json` file at the root of the workspace.
|
||||
This `tsconfig.json` file will only contain references to project-level TypeScript configuration files and is only used by editors/IDEs.
|
||||
|
||||
As an example, the solution `tsconfig.json` for a new project is as follows:
|
||||
```json
|
||||
// This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
|
||||
// It is not intended to be used to perform a compilation.
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
},
|
||||
{
|
||||
"path": "./e2e/tsconfig.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Why is this migration necessary?
|
||||
|
||||
Solution-style `tsconfig.json` files provide an improved editing experience and fix several long-standing defects when editing files in an IDE.
|
||||
IDEs that leverage the TypeScript language service (for example, [Visual Studio Code](https://code.visualstudio.com)), will only use TypeScript configuration files that are named `tsconfig.json`.
|
||||
In complex projects, there may be more than one compilation unit and each of these units may have different settings and options.
|
||||
|
||||
With the Angular CLI, a project will have application code that will target a browser.
|
||||
It will also have unit tests that should not be included within the built application and that also need additional type information present (`jasmine` in this case).
|
||||
Both parts of the project also share some but not all of the code within the project.
|
||||
As a result, two separate TypeScript configuration files (`tsconfig.app.json` and `tsconfig.spec.json`) are needed to ensure that each part of the application is configured properly and that the right types are used for each part.
|
||||
Also if web workers are used within a project, an additional tsconfig (`tsconfig.worker.json`) is needed.
|
||||
Web workers use similar but incompatible types to the main browser application.
|
||||
This requires the additional configuration file to ensure that the web worker files use the appropriate types and will build successfully.
|
||||
|
||||
While the Angular build system knows about all of these TypeScript configuration files, an IDE using TypeScript's language service does not.
|
||||
Because of this, an IDE will not be able to properly analyze the code from each part of the project and may generate false errors or make suggestions that are incorrect for certain files.
|
||||
By leveraging the new solution-style tsconfig, the IDE can now be aware of the configuration of each part of a project.
|
||||
This allows each file to be treated appropriately based on its tsconfig.
|
||||
IDE features such as error/warning reporting and auto-suggestion will operate more effectively as well.
|
||||
|
||||
The TypeScript 3.9 release [blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-3-9/#solution-style-tsconfig) also contains some additional information regarding this new feature.
|
52
aio/content/guide/migration-update-libraries-tslib.md
Normal file
52
aio/content/guide/migration-update-libraries-tslib.md
Normal file
@ -0,0 +1,52 @@
|
||||
# `tslib` direct dependency migration
|
||||
|
||||
## What does this migration do?
|
||||
|
||||
If you have any libraries within your workspace, this migration will convert `tslib` peer dependencies to direct dependencies for the libraries.
|
||||
TypeScript uses the `tslib` package to provide common helper functions used in compiled TypeScript code.
|
||||
The `tslib` version is also updated to `2.0.0` to support TypeScript 3.9.
|
||||
|
||||
Before:
|
||||
```json
|
||||
{
|
||||
"name": "my-lib",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^9.0.0",
|
||||
"@angular/core": "^9.0.0",
|
||||
"tslib": "^1.12.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After:
|
||||
```json
|
||||
{
|
||||
"name": "my-lib",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^9.0.0",
|
||||
"@angular/core": "^9.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Why is this migration necessary?
|
||||
|
||||
The [`tslib`](https://github.com/Microsoft/tslib) is a runtime library for Typescript.
|
||||
The version of this library is bound to the version of the TypeScript compiler used to compile a library.
|
||||
Peer dependencies do not accurately represent this relationship between the runtime and the compiler.
|
||||
If `tslib` remained declared as a library peer dependency, it would be possible for some Angular workspaces to get into a state where the workspace could not satisfy `tslib` peer dependency requirements for multiple libraries, resulting in build-time or run-time errors.
|
||||
|
||||
As of TypeScript 3.9 (used by Angular v10), `tslib` version of 2.x is required to build new applications.
|
||||
However, older libraries built with previous version of TypeScript and already published to npm might need `tslib` 1.x.
|
||||
This migration makes it possible for code depending on incompatible versions of the `tslib` runtime library to remain interoperable.
|
||||
|
||||
|
||||
## Do I still need `tslib` as a dependency in my workspace `package.json`?
|
||||
|
||||
Yes.
|
||||
The `tslib` dependency declared in the `package.json` file of the workspace is used to build applications within this workspace, as well as run unit tests for workspace libraries, and is required.
|
@ -0,0 +1,33 @@
|
||||
# Update `module` and `target` compiler options migration
|
||||
|
||||
## What does this migration do?
|
||||
|
||||
This migration adjusts the [`target`](https://www.typescriptlang.org/v2/en/tsconfig#target) and [`module`](https://www.typescriptlang.org/v2/en/tsconfig#module) settings within the [TypeScript configuration files](guide/typescript-configuration) for the workspace.
|
||||
The changes to each option vary based on the builder or command that uses the TypeScript configuration file.
|
||||
Unless otherwise noted, changes are only made if the existing value was not changed since the project was created.
|
||||
This process helps ensure that intentional changes to the options are kept in place.
|
||||
|
||||
TypeScript Configuration File(s) | Changed Property | Existing Value | New Value
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
`<workspace base>/tsconfig.base.json` | `"module"` | `"esnext"` | `"es2020"`
|
||||
Used in `browser` builder options (`ng build` for applications) | `"module"` | `"esnext"` | `"es2020"`
|
||||
Used in `ng-packgr` builder options (`ng build` for libraries) | `"module"` | `"esnext"` | `"es2020"`
|
||||
Used in `karma` builder options (`ng test` for applications) | `"module"` | `"esnext"` | `"es2020"`
|
||||
Used in `server` builder options (universal) | `"module"` | `"commonjs"` | _removed_
|
||||
Used in `server` builder options (universal) | `"target"` | _any_ | `"es2016"`
|
||||
Used in `protractor` builder options (`ng e2e` for applications) | `"target"` | `"es5"` | `"es2018"`
|
||||
|
||||
## Why is this migration necessary?
|
||||
|
||||
This migration provides improvements to the long-term supportability of projects by updating the projects to use recommended best practice compilation options.
|
||||
|
||||
For the functionality that executes on Node.js, such as Universal and Protractor, the new settings provide performance and troubleshooting benefits as well.
|
||||
The minimum Node.js version for the Angular CLI (v10.13) supports features in ES2018 and earlier.
|
||||
By targeting later ES versions, the compiler transforms less code and can use newer features directly.
|
||||
Since zone.js does not support native `async` and `await`, the universal builds still target ES2016.
|
||||
|
||||
## Why `"es2020"` instead of `"esnext"`?
|
||||
|
||||
In TypeScript 3.9, the behavior of the TypeScript compiler controlled by `module` is the same with both `"esnext"` and `"es2020"` values.
|
||||
This behavior can change in the future, because the `"esnext"` option could evolve in a backwards incompatible ways, resulting in build-time or run-time errors during a TypeScript update.
|
||||
As a result, code can become unstable. Using the `"es2020"` option mitigates this risk.
|
@ -118,7 +118,6 @@ Package name | Description
|
||||
[**@angular‑devkit/<br />build‑angular**](https://github.com/angular/angular-cli/) | The Angular build tools.
|
||||
[**@angular/cli**](https://github.com/angular/angular-cli/) | The Angular CLI tools.
|
||||
**@angular/<br />compiler‑cli** | The Angular compiler, which is invoked by the Angular CLI's `ng build` and `ng serve` commands.
|
||||
**@angular/<br />language‑service** | The [Angular language service](guide/language-service) analyzes component templates and provides type and error information that TypeScript-aware editors can use to improve the developer's experience. For example, see the [Angular language service extension for VS Code](https://marketplace.visualstudio.com/items?itemName=Angular.ng-template).
|
||||
**@types/... ** | TypeScript definition files for 3rd party libraries such as Jasmine and Node.js.
|
||||
[**codelyzer**](https://www.npmjs.com/package/codelyzer) | A linter for Angular apps whose rules conform to the Angular [style guide](guide/styleguide).
|
||||
**jasmine/... ** | Packages to support the [Jasmine](https://jasmine.github.io/) test library.
|
||||
@ -135,3 +134,4 @@ Package name | Description
|
||||
|
||||
* [Building and serving](guide/build) describes how packages come together to create a development build.
|
||||
* [Deployment](guide/deployment) describes how packages come together to create a production build.
|
||||
|
@ -25,49 +25,48 @@ To use the Angular framework, you should be familiar with the following:
|
||||
|
||||
Knowledge of [TypeScript](https://www.typescriptlang.org/) is helpful, but not required.
|
||||
|
||||
To install Angular on your local system, you need the following:
|
||||
|
||||
{@a nodejs}
|
||||
### Node.js
|
||||
|
||||
Make sure your development environment includes `Node.js®` and an npm package manager.
|
||||
* **Node.js**
|
||||
|
||||
Angular requires a [current, active LTS, or maintenance LTS](https://nodejs.org/about/releases) version of Node.js.
|
||||
|
||||
Angular requires a [current, active LTS, or maintenance LTS](https://nodejs.org/about/releases/) version of `Node.js`. See the `engines` key for the specific version requirements in our [package.json](https://unpkg.com/@angular/cli/package.json).
|
||||
<div class="alert is-helpful">
|
||||
|
||||
* To check your version, run `node -v` in a terminal/console window.
|
||||
For information about specific version requirements, see the `engines` key in the [package.json](https://unpkg.com/@angular/cli/package.json) file.
|
||||
|
||||
* To get `Node.js`, go to [nodejs.org](https://nodejs.org "Nodejs.org").
|
||||
</div>
|
||||
|
||||
For more information on installing Node.js, see [nodejs.org](http://nodejs.org "Nodejs.org").
|
||||
If you are unsure what version of Node.js runs on your system, run `node -v` in a terminal window.
|
||||
|
||||
{@a npm}
|
||||
### npm package manager
|
||||
|
||||
Angular, the Angular CLI, and Angular apps depend on features and functionality provided by libraries that are available as [npm packages](https://docs.npmjs.com/getting-started/what-is-npm). To download and install npm packages, you must have an npm package manager.
|
||||
* **npm package manager**
|
||||
|
||||
This setup guide uses the [npm client](https://docs.npmjs.com/cli/install) command line interface, which is installed with `Node.js` by default.
|
||||
|
||||
To check that you have the npm client installed, run `npm -v` in a terminal/console window.
|
||||
Angular, the Angular CLI, and Angular applications depend on [npm packages](https://docs.npmjs.com/getting-started/what-is-npm) for many features and functions.
|
||||
To download and install npm packages, you need an npm package manager.
|
||||
This guide uses the [npm client](https://docs.npmjs.com/cli/install) command line interface, which is installed with `Node.js` by default.
|
||||
To check that you have the npm client installed, run `npm -v` in a terminal window.
|
||||
|
||||
|
||||
{@a install-cli}
|
||||
|
||||
## Step 1: Install the Angular CLI
|
||||
## Install the Angular CLI
|
||||
|
||||
You use the Angular CLI
|
||||
to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
||||
|
||||
Install the Angular CLI globally.
|
||||
|
||||
To install the CLI using `npm`, open a terminal/console window and enter the following command:
|
||||
You use the Angular CLI to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
||||
|
||||
To install the Angular CLI, open a terminal window and run the following command:
|
||||
|
||||
<code-example language="sh" class="code-shell">
|
||||
npm install -g @angular/cli
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
|
||||
{@a create-proj}
|
||||
|
||||
## Step 2: Create a workspace and initial application
|
||||
## Create a workspace and initial application
|
||||
|
||||
You develop apps in the context of an Angular [**workspace**](guide/glossary#workspace).
|
||||
|
||||
@ -86,16 +85,22 @@ The Angular CLI installs the necessary Angular npm packages and other dependenci
|
||||
|
||||
The CLI creates a new workspace and a simple Welcome app, ready to run.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
You also have the option to use Angular's strict mode, which can help you write better, more maintainable code.
|
||||
For more information, see [Strict mode](/guide/strict-mode).
|
||||
|
||||
</div>
|
||||
|
||||
{@a serve}
|
||||
|
||||
## Step 3: Run the application
|
||||
## Run the application
|
||||
|
||||
The Angular CLI includes a server, so that you can easily build and serve your app locally.
|
||||
The Angular CLI includes a server, so that you can build and serve your app locally.
|
||||
|
||||
1. Go to the workspace folder (`my-app`).
|
||||
1. Navigate to the workspace folder, such as `my-app`.
|
||||
|
||||
1. Launch the server by using the CLI command `ng serve`, with the `--open` option.
|
||||
1. Run the following command:
|
||||
|
||||
<code-example language="sh" class="code-shell">
|
||||
cd my-app
|
||||
@ -108,7 +113,7 @@ and rebuilds the app as you make changes to those files.
|
||||
The `--open` (or just `-o`) option automatically opens your browser
|
||||
to `http://localhost:4200/`.
|
||||
|
||||
You will see:
|
||||
If your installation and setup was successful, you should see a page similar to the following.
|
||||
|
||||
|
||||
<div class="lightbox">
|
||||
|
46
aio/content/guide/strict-mode.md
Normal file
46
aio/content/guide/strict-mode.md
Normal file
@ -0,0 +1,46 @@
|
||||
# Strict mode
|
||||
|
||||
When you create a new workspace or a project you have an option to create them in a strict mode using the `--strict` flag.
|
||||
|
||||
Enabling this flag initializes your new workspace or project with a few new settings that improve maintainability, help you catch bugs ahead of time, and allow the CLI to perform advanced optimizations on your application.
|
||||
Additionally, applications that use these stricter settings are easier to statically analyze, which can help the `ng update` command refactor code more safely and precisely when you are updating to future versions of Angular.
|
||||
|
||||
Specifically, the `strict` flag does the following:
|
||||
|
||||
* Enables [`strict` mode in TypeScript](https://www.staging-typescript.org/tsconfig#strict), as well as other strictness flags recommended by the TypeScript team. Specifically, `forceConsistentCasingInFileNames`, `noImplicitReturns`, `noFallthroughCasesInSwitch`.
|
||||
* Turns on strict Angular compiler flags [`strictTemplates`](guide/angular-compiler-options#stricttemplates) and [`strictInjectionParameters`](guide/angular-compiler-options#strictinjectionparameters)
|
||||
* [Bundle size budgets](guide/build#configuring-size-budgets) have been reduced by ~75%
|
||||
* Turns on [`no-any` tslint rule](https://palantir.github.io/tslint/rules/no-any/) to prevent declarations of type `any`
|
||||
* [Marks your application as side-effect free](https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free) to enable more advanced tree-shaking
|
||||
|
||||
You can apply these settings at the workspace and project level.
|
||||
|
||||
To create a new workspace and application using the strict mode, run the following command:
|
||||
|
||||
<code-example language="sh" class="code-shell">
|
||||
|
||||
ng new [project-name] --strict
|
||||
|
||||
</code-example>
|
||||
|
||||
To create a new application in the strict mode within an existing non-strict workspace, run the following command:
|
||||
|
||||
<code-example language="sh" class="code-shell">
|
||||
|
||||
ng generate application [project-name] --strict
|
||||
|
||||
</code-example>
|
||||
|
||||
{@a side-effect}
|
||||
|
||||
### Non-local side effects in applications
|
||||
|
||||
When you create projects and workspaces using the `strict` mode, you'll notice an additional `package.json` file, located in `src/app/` directory.
|
||||
This file informs tools and bundlers that the code under this directory is free of non-local side effects. Non-local side effects in the application code are not common and using them is not considered a good coding pattern.
|
||||
More importantly, code with these types of side effects cannot be optimized, resulting in increased bundle sizes and applications that load more slowly.
|
||||
|
||||
If you need more information, the following links may be helpful.
|
||||
|
||||
* [Tree-shaking](https://webpack.js.org/guides/tree-shaking/)
|
||||
* [Dealing with side effects and pure functions in JavaScript](https://dev.to/vonheikemen/dealing-with-side-effects-and-pure-functions-in-javascript-16mg)
|
||||
* [How to deal with dirty side effects in your pure function JavaScript](https://jrsinclair.com/articles/2018/how-to-deal-with-dirty-side-effects-in-your-pure-functional-javascript/)
|
@ -79,6 +79,10 @@ The initial `tsconfig.base.json` for an Angular workspace typically looks like t
|
||||
}
|
||||
</code-example>
|
||||
|
||||
### Strict mode
|
||||
|
||||
When you create new workspaces and projects, you have the option to use Angular's strict mode, which can help you write better, more maintainable code.
|
||||
For more information, see [Strict mode](/guide/strict-mode).
|
||||
|
||||
{@a noImplicitAny}
|
||||
|
||||
|
82
aio/content/guide/updating-to-version-10.md
Normal file
82
aio/content/guide/updating-to-version-10.md
Normal file
@ -0,0 +1,82 @@
|
||||
# Updating to Angular version 10
|
||||
|
||||
This guide contains information related to updating to version 10 of Angular.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
For information on upgrading to Angular version 9, see [Updating to Angular version 9](https://v9.angular.io/guide/updating-to-version-9).
|
||||
|
||||
</div>
|
||||
|
||||
## Updating CLI Apps
|
||||
|
||||
For step-by-step instructions on how to update to the latest Angular release (and leverage our automated migration tools to do so), use the interactive update guide at [update.angular.io](https://update.angular.io).
|
||||
|
||||
If you're curious about the specific migrations being run by the CLI, see the [automated migrations section](#migrations) for details on what code is changing and why.
|
||||
|
||||
## Changes and Deprecations in Version 10
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
For information about Angular's deprecation and removal practices, see [Angular Release Practices](guide/releases#deprecation-practices "Angular Release Practices: Deprecation practices").
|
||||
|
||||
</div>
|
||||
|
||||
{@a breaking-changes}
|
||||
### New Breaking Changes
|
||||
|
||||
* Typescript 3.6, 3.7, and 3.8 are no longer supported. Please update to Typescript 3.9.
|
||||
* Input fields of type `number` fire the `valueChanges` event only once per value change (as opposed to twice in some cases). See [PR 36087](https://github.com/angular/angular/pull/36087).
|
||||
* The `minLength` and `maxLength` validators only validate values that have a numeric `length` property. See [PR 36157](https://github.com/angular/angular/pull/36157).
|
||||
* Templates with unknown property bindings or unknown element names now log errors instead of warnings. See [PR 36399](https://github.com/angular/angular/pull/36399).
|
||||
* `UrlMatcher` can now return `null` values. See [PR 36402](https://github.com/angular/angular/pull/36402).
|
||||
* Transplanted views now refresh at insertion point only. See PR 35968](https://github.com/angular/angular/pull/35968).
|
||||
* Formatting times with the `b` or `B` format codes now supports time periods that cross midnight. See [PR 36611](https://github.com/angular/angular/pull/36611).
|
||||
* Navigation is canceled for routes with at least one empty resolver. See [PR 24621](https://github.com/angular/angular/pull/24621).
|
||||
|
||||
{@a deprecations}
|
||||
### New Deprecations
|
||||
|
||||
| Area | API or Feature | May be removed in |
|
||||
| ----------------------------- | --------------------------------------------------------------------------- | ----------------- |
|
||||
| `@angular/core` | [`WrappedValue`](guide/deprecations#wrapped-value) | <!--v10--> v12 |
|
||||
| browser support | [`IE 9, 10, and IE Mobile`](guide/deprecations#ie-9-10-and-ie-mobile-support) | <!--v10--> v11 |
|
||||
|
||||
|
||||
{@a removals}
|
||||
### New Removals of Deprecated APIs
|
||||
|
||||
The following APIs have been removed starting with version 10.0.0*:
|
||||
|
||||
| Package | API | Replacement | Notes |
|
||||
| ---------------- | -------------- | ----------- | ----- |
|
||||
| `@angular/core` | Undecorated base classes that use Angular features | Add Angular decorator | See [migration guide](guide/migration-undecorated-classes) for more info |
|
||||
| `@angular/core` | `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | See [migration guide](guide/migration-module-with-providers) for more info |
|
||||
| `@angular/core` | Style Sanitization | no action needed | See [style sanitization API removal](/guide/deprecations#style-sanitization) for more info
|
||||
| `@angular/bazel` | [`Bazel builder and schematics`](guide/deprecations#bazelbuilder) | `bazelbuild/rules_nodejs` | [More info](https://github.com/angular/angular/tree/10.0.x/packages/bazel/src/schematics) |
|
||||
|
||||
|
||||
*To see APIs removed in version 9, check out this guide on the [version 9 docs site](https://v9.angular.io/guide/deprecations#removed).
|
||||
|
||||
{@a ivy}
|
||||
|
||||
## Ivy features and compatibility
|
||||
|
||||
Since version 9, Angular Ivy is the default rendering engine. If you haven't heard of Ivy, you can read more about it in the [Angular Ivy guide](guide/ivy).
|
||||
|
||||
* Among other features, Ivy introduces more comprehensive type-checking within templates. For details, see [Template Type-checking](guide/template-typecheck).
|
||||
|
||||
* For general guidance on debugging and a list of minor changes associated with Ivy, see the [Ivy compatibility guide](guide/ivy-compatibility).
|
||||
|
||||
* For help with opting out of Ivy, see the instructions [here](guide/ivy#opting-out-of-angular-ivy).
|
||||
|
||||
{@a migrations}
|
||||
## Automated Migrations for Version 10
|
||||
|
||||
Read about the migrations the CLI handles for you automatically:
|
||||
|
||||
* [Migrating missing `@Directive()`/`@Component()` decorators](guide/migration-undecorated-classes)
|
||||
* [Migrating `ModuleWithProviders`](guide/migration-module-with-providers)
|
||||
* [Solution-style `tsconfig.json` migration](guide/migration-solution-style-tsconfig)
|
||||
* [`tslib` direct dependency migration](guide/migration-update-libraries-tslib)
|
||||
* [Update `module` and `target` compiler options migration](guide/migration-update-module-and-target-compiler-options)
|
@ -1,90 +0,0 @@
|
||||
# Updating to Angular version 9
|
||||
|
||||
This guide contains information related to updating to version 9 of Angular.
|
||||
|
||||
## Updating CLI Apps
|
||||
|
||||
For step-by-step instructions on how to update to the latest Angular release (and leverage our automated migration tools to do so), use the interactive update guide at [update.angular.io](https://update.angular.io).
|
||||
|
||||
If you're curious about the specific migrations being run by the CLI, see the [automated migrations section](#migrations) for details on what code is changing and why.
|
||||
|
||||
## Changes and Deprecations in Version 9
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
For information about Angular's deprecation and removal practices, see [Angular Release Practices](guide/releases#deprecation-practices "Angular Release Practices: Deprecation practices").
|
||||
|
||||
</div>
|
||||
|
||||
{@a breaking-changes}
|
||||
### New Breaking Changes
|
||||
|
||||
- Angular now compiles with Ivy by default. See the [Ivy compatibility section](#ivy).
|
||||
|
||||
- CLI apps compile in [AOT mode](/guide/aot-compiler) by default (which includes template type-checking).
|
||||
Users who only built with JIT before may see new type errors.
|
||||
See our [template type-checking guide](guide/template-typecheck) for more information and debugging tips.
|
||||
|
||||
- Typescript 3.4 and 3.5 are no longer supported. Please update to Typescript 3.7.
|
||||
|
||||
- `tslib` is now listed as a peer dependency rather than a direct dependency. If you are not using the CLI, you must manually install `tslib`, using `yarn add tslib` or `npm install tslib --save`.
|
||||
|
||||
{@a deprecations}
|
||||
### New Deprecations
|
||||
|
||||
| API | Replacement | Notes |
|
||||
| ------------------------------------------------------------------------| ------------------------------------ | ----- |
|
||||
| [`entryComponents`](api/core/NgModule#entryComponents) | none | See [`entryComponents`](guide/deprecations#entryComponents) |
|
||||
| [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation)| `{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}` | From v11 the default code will be extracted from the locale data given by `LOCAL_ID`, rather than `USD`. |
|
||||
| [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](guide/deprecations#entryComponents) |
|
||||
| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | |
|
||||
| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | |
|
||||
| `esm5` and `fesm5` distribution in `@angular/*` npm packages | `esm2015` and `fesm2015` entrypoints | See [`esm5` and `fesm5`](guide/deprecations#esm5-fesm5) |
|
||||
| [`TestBed.get`](api/core/testing/TestBed#get) | [`TestBed.inject`](api/core/testing/TestBed#inject) | Same behavior, but type safe. |
|
||||
|
||||
|
||||
{@a removals}
|
||||
### New Removals of Deprecated APIs
|
||||
|
||||
| Package | API | Replacement | Notes |
|
||||
| ------- | -------------- | ----------- | ----- |
|
||||
| `@angular/core` | [`Renderer`](https://v8.angular.io/api/core/Renderer) | [`Renderer2`](api/core/Renderer2) | [Migration guide.](guide/migration-renderer) |
|
||||
| `@angular/core` | [`RootRenderer`](https://v8.angular.io/api/core/RootRenderer) | [`RendererFactory2`](api/core/RendererFactory2) | none |
|
||||
| `@angular/core` | [`RenderComponentType`](https://v8.angular.io/api/core/RenderComponentType) | [`RendererType2`](api/core/RendererType2) | none |
|
||||
| `@angular/core` | [`WtfScopeFn`](https://v8.angular.io/api/core/WtfScopeFn) | none | v8 | See [Web Tracing Framework](#wtf) |
|
||||
| `@angular/core` | [`wtfCreateScope`](https://v8.angular.io/api/core/wtfCreateScope) | none | v8 | See [Web Tracing Framework](guide/deprecations#wtf) |
|
||||
| `@angular/core` | [`wtfStartTimeRange`](https://v8.angular.io/api/core/wtfStartTimeRange) | none | v8 | See [Web Tracing Framework](guide/deprecations#wtf) |
|
||||
| `@angular/core` | [`wtfEndTimeRange`](https://v8.angular.io/api/core/wtfEndTimeRange) | none | v8 | See [Web Tracing Framework](guide/deprecations#wtf) |
|
||||
| `@angular/core` | [`wtfLeave`](https://v8.angular.io/api/core/wtfLeave) | none | v8 | See [Web Tracing Framework](guide/deprecations#wtf) |
|
||||
| `@angular/common` | `DeprecatedI18NPipesModule` | [`CommonModule`](api/common/CommonModule#pipes) | none |
|
||||
| `@angular/common` | `DeprecatedCurrencyPipe` | [`CurrencyPipe`](api/common/CurrencyPipe) | none |
|
||||
| `@angular/common` | `DeprecatedDatePipe` | [`DatePipe`](api/common/DatePipe) | none |
|
||||
| `@angular/common` | `DeprecatedDecimalPipe` | [`DecimalPipe`](api/common/DecimalPipe) | none |
|
||||
| `@angular/common` | `DeprecatedPercentPipe` | [`PercentPipe`](api/common/PercentPipe) | none |
|
||||
| `@angular/forms` | [`NgFormSelectorWarning`](https://v8.angular.io/api/forms/NgFormSelectorWarning) | none |
|
||||
| `@angular/forms` | `ngForm` element selector | `ng-form` element selector | none |
|
||||
| `@angular/service-worker` | `versionedFiles` | `files` | In the service worker configuration file `ngsw-config.json`, replace `versionedFiles` with `files`. See [Service Worker Configuration](guide/service-worker-config#assetgroups). |
|
||||
|
||||
{@a ivy}
|
||||
|
||||
## Ivy features and compatibility
|
||||
|
||||
In Version 9, Angular Ivy is the default rendering engine. If you haven't heard of Ivy, you can read more about it in the [Angular Ivy guide](guide/ivy).
|
||||
|
||||
* Among other features, Ivy introduces more comprehensive type-checking within templates. For details, see [Template Type-checking](guide/template-typecheck).
|
||||
|
||||
* For general guidance on debugging and a list of minor changes associated with Ivy, see the [Ivy compatibility guide](guide/ivy-compatibility).
|
||||
|
||||
* For help with opting out of Ivy, see the instructions [here](guide/ivy#opting-out-of-angular-ivy).
|
||||
|
||||
{@a migrations}
|
||||
## Automated Migrations for Version 9
|
||||
|
||||
Read about the migrations the CLI handles for you automatically:
|
||||
|
||||
- [Migrating from `Renderer` to `Renderer2`](guide/migration-renderer)
|
||||
- [Migrating missing `@Directive()`/`@Component()` decorators](guide/migration-undecorated-classes)
|
||||
- [Migrating missing `@Injectable()` decorators and incomplete provider definitions](guide/migration-injectable)
|
||||
- [Migrating dynamic queries](guide/migration-dynamic-flag)
|
||||
- [Migrating to the new `$localize` i18n support](guide/migration-localize)
|
||||
- [Migrating `ModuleWithProviders`](guide/migration-module-with-providers)
|
@ -41,6 +41,11 @@ When you create a library project with `ng generate library`, the library projec
|
||||
|
||||
</div>
|
||||
|
||||
## Strict mode
|
||||
|
||||
When you create new workspaces and projects, you have the option to use Angular's strict mode, which can help you write better, more maintainable code.
|
||||
For more information, see [Strict mode](/guide/strict-mode).
|
||||
|
||||
## Project configuration options
|
||||
|
||||
The following top-level configuration properties are available for each project, under `projects:<project_name>`.
|
||||
|
@ -13,11 +13,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><a href="https://ngvikings.org/" title="ngVikings">ngVikings</a></th>
|
||||
<td>Oslo, Norway</td>
|
||||
<td>May 25-26 conference, 27 workshops, 2020</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -31,6 +26,12 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- ng-vikings 2020 -->
|
||||
<tr>
|
||||
<th><a href="https://ngvikings.org/" title="ngVikings">ngVikings</a></th>
|
||||
<td>Oslo, Norway</td>
|
||||
<td>May 25-26 conference, 27 workshops, 2020</td>
|
||||
</tr>
|
||||
<!-- ng-conf 2020 -->
|
||||
<tr>
|
||||
<th><a href="https://ng-conf.org/" title="ng-conf">ng-conf</a></th>
|
||||
|
@ -675,6 +675,11 @@
|
||||
"url": "guide/browser-support",
|
||||
"title": "Browser Support",
|
||||
"tooltip": "Browser support and polyfills guide."
|
||||
},
|
||||
{
|
||||
"url": "guide/strict-mode",
|
||||
"title": "Strict mode",
|
||||
"tooltip": "Reference documentation for Angular's strict mode."
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -762,13 +767,13 @@
|
||||
"tooltip": "Angular versioning, release, support, and deprecation policies and practices."
|
||||
},
|
||||
{
|
||||
"title": "Updating to Version 9",
|
||||
"tooltip": "Support for updating your application from version 8 to 9.",
|
||||
"title": "Updating to Version 10",
|
||||
"tooltip": "Support for updating your application from version 9 to 10.",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/updating-to-version-9",
|
||||
"url": "guide/updating-to-version-10",
|
||||
"title": "Overview",
|
||||
"tooltip": "Everything you need to know for updating your application from version 8 to 9."
|
||||
"tooltip": "Everything you need to know for updating your application from version 9 to 10."
|
||||
},
|
||||
{
|
||||
"url": "guide/ivy-compatibility",
|
||||
@ -776,29 +781,9 @@
|
||||
"tooltip": "Details to help you make sure your application is compatible with Ivy."
|
||||
},
|
||||
{
|
||||
"title": "Optional Migrations",
|
||||
"tooltip": "Optional migration details regarding updating to version 9.",
|
||||
"title": "Migrations",
|
||||
"tooltip": "Migration details regarding updating to version 10.",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/migration-renderer",
|
||||
"title": "Renderer to Renderer2",
|
||||
"tooltip": "Migration from the deprecated Renderer API to the newer Renderer2 API."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-dynamic-flag",
|
||||
"title": "Dynamic Queries Flag",
|
||||
"tooltip": "Migration to remove unnecessary `static: false` flag from @ViewChild and @ContentChild queries."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-injectable",
|
||||
"title": "Missing @Injectable() Decorators",
|
||||
"tooltip": "Migration to add missing @Injectable() decorators and incomplete provider definitions."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-localize",
|
||||
"title": "$localize Global Import",
|
||||
"tooltip": "Migration to add an import statement for @angular/localize to polyfills.ts."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-module-with-providers",
|
||||
"title": "Missing ModuleWithProviders Generic",
|
||||
@ -808,6 +793,26 @@
|
||||
"url": "guide/migration-undecorated-classes",
|
||||
"title": "Missing @Directive() Decorators",
|
||||
"tooltip": "Migration to add missing @Directive()/@Component() decorators."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-injectable",
|
||||
"title": "Missing @Injectable() Decorators",
|
||||
"tooltip": "Migration to add missing @Injectable() decorators and incomplete provider definitions."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-solution-style-tsconfig",
|
||||
"title": "Solution-style `tsconfig.json`",
|
||||
"tooltip": "Migration to create a solution-style `tsconfig.json`."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-update-libraries-tslib",
|
||||
"title": "`tslib` direct dependency",
|
||||
"tooltip": "Migration to a direct dependency on the `tslib` npm package."
|
||||
},
|
||||
{
|
||||
"url": "guide/migration-update-module-and-target-compiler-options",
|
||||
"title": "`module` and `target` compiler options",
|
||||
"tooltip": "Migration to update `module` and `target` compiler options."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -401,7 +401,10 @@ describe('DocViewerComponent', () => {
|
||||
expect(loadElementsSpy.calls.argsFor(1)).toEqual([docViewer.nextViewContainer]);
|
||||
});
|
||||
|
||||
it('should unsubscribe from the previous "embed" observable when unsubscribed from', () => {
|
||||
// This test sometimes incorrectly fails on CI.
|
||||
// Reported in https://github.com/angular/angular/issues/37629.
|
||||
// Investigated in https://github.com/angular/angular/pull/37637.
|
||||
xit('should unsubscribe from the previous "embed" observable when unsubscribed from', () => {
|
||||
const obs = new ObservableWithSubscriptionSpies();
|
||||
loadElementsSpy.and.returnValue(obs);
|
||||
|
||||
@ -436,7 +439,10 @@ describe('DocViewerComponent', () => {
|
||||
expect(swapViewsSpy).toHaveBeenCalledWith(addTitleAndTocSpy);
|
||||
});
|
||||
|
||||
it('should unsubscribe from the previous "swap" observable when unsubscribed from', () => {
|
||||
// This test sometimes incorrectly fails on CI.
|
||||
// Reported in https://github.com/angular/angular/issues/37629.
|
||||
// Investigated in https://github.com/angular/angular/pull/37637.
|
||||
xit('should unsubscribe from the previous "swap" observable when unsubscribed from', () => {
|
||||
const obs = new ObservableWithSubscriptionSpies();
|
||||
swapViewsSpy.and.returnValue(obs);
|
||||
|
||||
|
@ -23,10 +23,7 @@ const DEFAULT_CLI_EXAMPLE_PORT = 4200;
|
||||
const DEFAULT_CLI_SPECS_CONCURRENCY = 1;
|
||||
const IGNORED_EXAMPLES = [];
|
||||
|
||||
const fixmeIvyExamples = [
|
||||
// fixmeIvy('unknown') app fails at runtime due to missing external service (goog is undefined)
|
||||
'i18n',
|
||||
];
|
||||
const fixmeIvyExamples = [];
|
||||
|
||||
if (!argv.viewengine) {
|
||||
IGNORED_EXAMPLES.push(...fixmeIvyExamples);
|
||||
@ -72,8 +69,10 @@ function runE2e() {
|
||||
const outputFile = path.join(AIO_PATH, './protractor-results.txt');
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => findAndRunE2eTests(argv.filter, outputFile, argv.shard,
|
||||
argv.cliSpecsConcurrency || DEFAULT_CLI_SPECS_CONCURRENCY, argv.retry || 1))
|
||||
.then(
|
||||
() => findAndRunE2eTests(
|
||||
argv.filter, outputFile, argv.shard,
|
||||
argv.cliSpecsConcurrency || DEFAULT_CLI_SPECS_CONCURRENCY, argv.retry || 1))
|
||||
.then((status) => {
|
||||
reportStatus(status, outputFile);
|
||||
if (status.failed.length > 0) {
|
||||
@ -226,8 +225,12 @@ function runProtractorSystemJS(prepPromise, appDir, appRunSpawnInfo, outputFile)
|
||||
});
|
||||
})
|
||||
.then(
|
||||
function() { return finish(appRunSpawnInfo.proc.pid, true); },
|
||||
function() { return finish(appRunSpawnInfo.proc.pid, false); });
|
||||
function() {
|
||||
return finish(appRunSpawnInfo.proc.pid, true);
|
||||
},
|
||||
function() {
|
||||
return finish(appRunSpawnInfo.proc.pid, false);
|
||||
});
|
||||
}
|
||||
|
||||
function finish(spawnProcId, ok) {
|
||||
@ -263,15 +266,15 @@ function runE2eTestsCLI(appDir, outputFile, bufferOutput, port) {
|
||||
// `--no-webdriver-update` is needed to preserve the ChromeDriver version already installed.
|
||||
const config = loadExampleConfig(appDir);
|
||||
const testCommands = config.tests || [{
|
||||
cmd: 'yarn',
|
||||
args: [
|
||||
'e2e',
|
||||
'--prod',
|
||||
'--protractor-config=e2e/protractor-puppeteer.conf.js',
|
||||
'--no-webdriver-update',
|
||||
'--port={PORT}',
|
||||
],
|
||||
}];
|
||||
cmd: 'yarn',
|
||||
args: [
|
||||
'e2e',
|
||||
'--prod',
|
||||
'--protractor-config=e2e/protractor-puppeteer.conf.js',
|
||||
'--no-webdriver-update',
|
||||
'--port={PORT}',
|
||||
],
|
||||
}];
|
||||
let bufferedOutput = `\n\n============== AIO example output for: ${appDir}\n\n`;
|
||||
|
||||
const e2eSpawnPromise = testCommands.reduce((prevSpawnPromise, {cmd, args}) => {
|
||||
@ -281,26 +284,30 @@ function runE2eTestsCLI(appDir, outputFile, bufferOutput, port) {
|
||||
args = args.map(a => a.replace('{PORT}', port || DEFAULT_CLI_EXAMPLE_PORT));
|
||||
|
||||
return prevSpawnPromise.then(() => {
|
||||
const currSpawn = spawnExt(cmd, args, {cwd: appDir}, false,
|
||||
bufferOutput ? msg => bufferedOutput += msg : undefined);
|
||||
const currSpawn = spawnExt(
|
||||
cmd, args, {cwd: appDir}, false, bufferOutput ? msg => bufferedOutput += msg : undefined);
|
||||
return currSpawn.promise.then(
|
||||
() => Promise.resolve(finish(currSpawn.proc.pid, true)),
|
||||
() => Promise.reject(finish(currSpawn.proc.pid, false)));
|
||||
});
|
||||
}, Promise.resolve());
|
||||
|
||||
return e2eSpawnPromise.then(() => {
|
||||
fs.appendFileSync(outputFile, `Passed: ${appDir}\n\n`);
|
||||
return true;
|
||||
}, () => {
|
||||
fs.appendFileSync(outputFile, `Failed: ${appDir}\n\n`);
|
||||
return false;
|
||||
}).then(passed => {
|
||||
if (bufferOutput) {
|
||||
process.stdout.write(bufferedOutput);
|
||||
}
|
||||
return passed;
|
||||
});
|
||||
return e2eSpawnPromise
|
||||
.then(
|
||||
() => {
|
||||
fs.appendFileSync(outputFile, `Passed: ${appDir}\n\n`);
|
||||
return true;
|
||||
},
|
||||
() => {
|
||||
fs.appendFileSync(outputFile, `Failed: ${appDir}\n\n`);
|
||||
return false;
|
||||
})
|
||||
.then(passed => {
|
||||
if (bufferOutput) {
|
||||
process.stdout.write(bufferedOutput);
|
||||
}
|
||||
return passed;
|
||||
});
|
||||
}
|
||||
|
||||
// Report final status.
|
||||
@ -309,23 +316,31 @@ function reportStatus(status, outputFile) {
|
||||
|
||||
log.push('Suites ignored due to legacy guides:');
|
||||
IGNORED_EXAMPLES.filter(example => !fixmeIvyExamples.find(ex => ex.startsWith(example)))
|
||||
.forEach(function(val) { log.push(' ' + val); });
|
||||
.forEach(function(val) {
|
||||
log.push(' ' + val);
|
||||
});
|
||||
|
||||
if (!argv.viewengine) {
|
||||
log.push('');
|
||||
log.push('Suites ignored due to breakage with Ivy:');
|
||||
fixmeIvyExamples.forEach(function(val) { log.push(' ' + val); });
|
||||
fixmeIvyExamples.forEach(function(val) {
|
||||
log.push(' ' + val);
|
||||
});
|
||||
}
|
||||
|
||||
log.push('');
|
||||
log.push('Suites passed:');
|
||||
status.passed.forEach(function(val) { log.push(' ' + val); });
|
||||
status.passed.forEach(function(val) {
|
||||
log.push(' ' + val);
|
||||
});
|
||||
|
||||
if (status.failed.length == 0) {
|
||||
log.push('All tests passed');
|
||||
} else {
|
||||
log.push('Suites failed:');
|
||||
status.failed.forEach(function(val) { log.push(' ' + val); });
|
||||
status.failed.forEach(function(val) {
|
||||
log.push(' ' + val);
|
||||
});
|
||||
}
|
||||
log.push('\nElapsed time: ' + status.elapsedTime + ' seconds');
|
||||
log = log.join('\n');
|
||||
@ -334,8 +349,8 @@ function reportStatus(status, outputFile) {
|
||||
}
|
||||
|
||||
// Returns both a promise and the spawned process so that it can be killed if needed.
|
||||
function spawnExt(command, args, options, ignoreClose = false,
|
||||
printMessage = msg => process.stdout.write(msg)) {
|
||||
function spawnExt(
|
||||
command, args, options, ignoreClose = false, printMessage = msg => process.stdout.write(msg)) {
|
||||
let proc;
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
let descr = command + ' ' + args.join(' ');
|
||||
@ -370,13 +385,19 @@ function getE2eSpecs(basePath, filter) {
|
||||
let specs = {};
|
||||
|
||||
return getE2eSpecsFor(basePath, SJS_SPEC_FILENAME, filter)
|
||||
.then(sjsPaths => { specs.systemjs = sjsPaths; })
|
||||
.then(sjsPaths => {
|
||||
specs.systemjs = sjsPaths;
|
||||
})
|
||||
.then(() => {
|
||||
return getE2eSpecsFor(basePath, CLI_SPEC_FILENAME, filter).then(cliPaths => {
|
||||
return cliPaths.map(p => { return p.replace(`${CLI_SPEC_FILENAME}`, ''); });
|
||||
return cliPaths.map(p => {
|
||||
return p.replace(`${CLI_SPEC_FILENAME}`, '');
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(cliPaths => { specs.cli = cliPaths; })
|
||||
.then(cliPaths => {
|
||||
specs.cli = cliPaths;
|
||||
})
|
||||
.then(() => specs);
|
||||
}
|
||||
|
||||
|
@ -9,10 +9,18 @@
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"prefix": "app",
|
||||
"i18n": {
|
||||
"sourceLocale": "en-US",
|
||||
"locales": {
|
||||
"fr": "src/locale/messages.fr.xlf"
|
||||
}
|
||||
},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"localize": true,
|
||||
"aot": true,
|
||||
"outputPath": "dist",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
@ -57,35 +65,10 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"production-fr": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"outputPath": "dist/my-project-fr/",
|
||||
"i18nFile": "src/locale/messages.fr.xlf",
|
||||
"i18nFormat": "xlf",
|
||||
"i18nLocale": "fr",
|
||||
"i18nMissingTranslation": "error"
|
||||
},
|
||||
"fr": {
|
||||
"aot": true,
|
||||
"outputPath": "dist/my-project-fr/",
|
||||
"i18nFile": "src/locale/messages.fr.xlf",
|
||||
"i18nFormat": "xlf",
|
||||
"i18nLocale": "fr",
|
||||
"i18nMissingTranslation": "error"
|
||||
"localize": [
|
||||
"fr"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -20,6 +20,7 @@
|
||||
"@angular/compiler": "~9.1.4",
|
||||
"@angular/core": "~9.1.4",
|
||||
"@angular/forms": "~9.1.4",
|
||||
"@angular/localize": "^9.1.4",
|
||||
"@angular/platform-browser": "~9.1.4",
|
||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||
"@angular/router": "~9.1.4",
|
||||
|
68
aio/tools/examples/shared/boilerplate/i18n/polyfills.ts
Normal file
68
aio/tools/examples/shared/boilerplate/i18n/polyfills.ts
Normal file
@ -0,0 +1,68 @@
|
||||
/***************************************************************************************************
|
||||
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
|
||||
*/
|
||||
import '@angular/localize/init';
|
||||
/**
|
||||
* This file includes polyfills needed by Angular and is loaded before the app.
|
||||
* You can add your own extra polyfills to this file.
|
||||
*
|
||||
* This file is divided into 2 sections:
|
||||
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
||||
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
||||
* file.
|
||||
*
|
||||
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||||
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||||
*
|
||||
* Learn more in https://angular.io/guide/browser-support
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
|
||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
|
||||
/**
|
||||
* Web Animations `@angular/platform-browser/animations`
|
||||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||
*/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||
* because those flags need to be set before `zone.js` being loaded, and webpack
|
||||
* will put import in the top of bundle, so user need to create a separate file
|
||||
* in this directory (for example: zone-flags.ts), and put the following flags
|
||||
* into that file, and then add the following code before importing zone.js.
|
||||
* import './zone-flags';
|
||||
*
|
||||
* The flags allowed in zone-flags.ts are listed here.
|
||||
*
|
||||
* The following flags will work for all browsers.
|
||||
*
|
||||
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch
|
||||
* requestAnimationFrame
|
||||
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch
|
||||
* specified eventNames
|
||||
*
|
||||
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||
*
|
||||
* (window as any).__Zone_enable_cross_context_check = true;
|
||||
*
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
@ -26,6 +26,7 @@
|
||||
"@angular/core": "~9.1.4",
|
||||
"@angular/elements": "~9.1.4",
|
||||
"@angular/forms": "~9.1.4",
|
||||
"@angular/localize": "~9.1.4",
|
||||
"@angular/platform-browser": "~9.1.4",
|
||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||
"@angular/platform-server": "~9.1.4",
|
||||
|
@ -215,6 +215,15 @@
|
||||
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-9.1.4.tgz#2fa2c444e5a5a6036d5ca43d2887826df17d0553"
|
||||
integrity sha512-eyVxxiegdb4ESdFGfkuDN+YfUbOVHRQLjIl6ACFJQDNHzVXzbmuqpyr5hIJANIVady103/7+dqRxxJo1DdIdTQ==
|
||||
|
||||
"@angular/localize@~9.1.4":
|
||||
version "9.1.11"
|
||||
resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-9.1.11.tgz#25921d794836fb7a07d284c1ac0ed06c10e77d50"
|
||||
integrity sha512-CrR7RniwJIK3+QKH8nHl35KDAHZn1mp1QAd5vujTWKw6YRLfio7SjM9qIfzw5y4WZuUitTsqKlQT/m/NK146Ag==
|
||||
dependencies:
|
||||
"@babel/core" "7.8.3"
|
||||
glob "7.1.2"
|
||||
yargs "15.3.0"
|
||||
|
||||
"@angular/platform-browser-dynamic@~9.1.4":
|
||||
version "9.1.4"
|
||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-9.1.4.tgz#bf1cde9156bd29eeeef932b683b0c993614f75d5"
|
||||
@ -254,6 +263,13 @@
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.0.0"
|
||||
|
||||
"@babel/code-frame@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.1.tgz#d5481c5095daa1c57e16e54c6f9198443afb49ff"
|
||||
integrity sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.10.1"
|
||||
|
||||
"@babel/code-frame@^7.5.5":
|
||||
version "7.5.5"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d"
|
||||
@ -277,6 +293,27 @@
|
||||
invariant "^2.2.4"
|
||||
semver "^5.5.0"
|
||||
|
||||
"@babel/core@7.8.3":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.3.tgz#30b0ebb4dd1585de6923a0b4d179e0b9f5d82941"
|
||||
integrity sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.8.3"
|
||||
"@babel/generator" "^7.8.3"
|
||||
"@babel/helpers" "^7.8.3"
|
||||
"@babel/parser" "^7.8.3"
|
||||
"@babel/template" "^7.8.3"
|
||||
"@babel/traverse" "^7.8.3"
|
||||
"@babel/types" "^7.8.3"
|
||||
convert-source-map "^1.7.0"
|
||||
debug "^4.1.0"
|
||||
gensync "^1.0.0-beta.1"
|
||||
json5 "^2.1.0"
|
||||
lodash "^4.17.13"
|
||||
resolve "^1.3.2"
|
||||
semver "^5.4.1"
|
||||
source-map "^0.5.0"
|
||||
|
||||
"@babel/core@7.9.0":
|
||||
version "7.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e"
|
||||
@ -330,6 +367,16 @@
|
||||
lodash "^4.17.13"
|
||||
source-map "^0.5.0"
|
||||
|
||||
"@babel/generator@^7.10.1", "@babel/generator@^7.8.3":
|
||||
version "7.10.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.10.2.tgz#0fa5b5b2389db8bfdfcc3492b551ee20f5dd69a9"
|
||||
integrity sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==
|
||||
dependencies:
|
||||
"@babel/types" "^7.10.2"
|
||||
jsesc "^2.5.1"
|
||||
lodash "^4.17.13"
|
||||
source-map "^0.5.0"
|
||||
|
||||
"@babel/generator@^7.4.0", "@babel/generator@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.4.tgz#db651e2840ca9aa66f327dcec1dc5f5fa9611369"
|
||||
@ -420,6 +467,15 @@
|
||||
"@babel/traverse" "^7.8.3"
|
||||
"@babel/types" "^7.8.3"
|
||||
|
||||
"@babel/helper-function-name@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz#92bd63829bfc9215aca9d9defa85f56b539454f4"
|
||||
integrity sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==
|
||||
dependencies:
|
||||
"@babel/helper-get-function-arity" "^7.10.1"
|
||||
"@babel/template" "^7.10.1"
|
||||
"@babel/types" "^7.10.1"
|
||||
|
||||
"@babel/helper-function-name@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz#ab6e041e7135d436d8f0a3eca15de5b67a341a2e"
|
||||
@ -447,6 +503,13 @@
|
||||
"@babel/template" "^7.8.3"
|
||||
"@babel/types" "^7.9.5"
|
||||
|
||||
"@babel/helper-get-function-arity@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz#7303390a81ba7cb59613895a192b93850e373f7d"
|
||||
integrity sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==
|
||||
dependencies:
|
||||
"@babel/types" "^7.10.1"
|
||||
|
||||
"@babel/helper-get-function-arity@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0"
|
||||
@ -558,6 +621,13 @@
|
||||
"@babel/template" "^7.8.3"
|
||||
"@babel/types" "^7.8.3"
|
||||
|
||||
"@babel/helper-split-export-declaration@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz#c6f4be1cbc15e3a868e4c64a17d5d31d754da35f"
|
||||
integrity sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==
|
||||
dependencies:
|
||||
"@babel/types" "^7.10.1"
|
||||
|
||||
"@babel/helper-split-export-declaration@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8"
|
||||
@ -572,6 +642,11 @@
|
||||
dependencies:
|
||||
"@babel/types" "^7.8.3"
|
||||
|
||||
"@babel/helper-validator-identifier@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz#5770b0c1a826c4f53f5ede5e153163e0318e94b5"
|
||||
integrity sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==
|
||||
|
||||
"@babel/helper-validator-identifier@^7.9.5":
|
||||
version "7.9.5"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80"
|
||||
@ -587,6 +662,15 @@
|
||||
"@babel/traverse" "^7.8.3"
|
||||
"@babel/types" "^7.8.3"
|
||||
|
||||
"@babel/helpers@^7.8.3":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.10.1.tgz#a6827b7cb975c9d9cef5fd61d919f60d8844a973"
|
||||
integrity sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==
|
||||
dependencies:
|
||||
"@babel/template" "^7.10.1"
|
||||
"@babel/traverse" "^7.10.1"
|
||||
"@babel/types" "^7.10.1"
|
||||
|
||||
"@babel/helpers@^7.8.4":
|
||||
version "7.8.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73"
|
||||
@ -613,6 +697,15 @@
|
||||
esutils "^2.0.2"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/highlight@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.1.tgz#841d098ba613ba1a427a2b383d79e35552c38ae0"
|
||||
integrity sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==
|
||||
dependencies:
|
||||
"@babel/helper-validator-identifier" "^7.10.1"
|
||||
chalk "^2.0.0"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/highlight@^7.8.3":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797"
|
||||
@ -622,6 +715,11 @@
|
||||
esutils "^2.0.2"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/parser@^7.10.1":
|
||||
version "7.10.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.10.2.tgz#871807f10442b92ff97e4783b9b54f6a0ca812d0"
|
||||
integrity sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==
|
||||
|
||||
"@babel/parser@^7.4.3", "@babel/parser@^7.7.4":
|
||||
version "7.7.5"
|
||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.5.tgz#cbf45321619ac12d83363fcf9c94bb67fa646d71"
|
||||
@ -1126,6 +1224,15 @@
|
||||
"@babel/parser" "^7.8.6"
|
||||
"@babel/types" "^7.8.6"
|
||||
|
||||
"@babel/template@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.1.tgz#e167154a94cb5f14b28dc58f5356d2162f539811"
|
||||
integrity sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.10.1"
|
||||
"@babel/parser" "^7.10.1"
|
||||
"@babel/types" "^7.10.1"
|
||||
|
||||
"@babel/template@^7.4.0", "@babel/template@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b"
|
||||
@ -1144,6 +1251,21 @@
|
||||
"@babel/parser" "^7.8.3"
|
||||
"@babel/types" "^7.8.3"
|
||||
|
||||
"@babel/traverse@^7.10.1":
|
||||
version "7.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.10.1.tgz#bbcef3031e4152a6c0b50147f4958df54ca0dd27"
|
||||
integrity sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.10.1"
|
||||
"@babel/generator" "^7.10.1"
|
||||
"@babel/helper-function-name" "^7.10.1"
|
||||
"@babel/helper-split-export-declaration" "^7.10.1"
|
||||
"@babel/parser" "^7.10.1"
|
||||
"@babel/types" "^7.10.1"
|
||||
debug "^4.1.0"
|
||||
globals "^11.1.0"
|
||||
lodash "^4.17.13"
|
||||
|
||||
"@babel/traverse@^7.4.3", "@babel/traverse@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558"
|
||||
@ -1189,6 +1311,15 @@
|
||||
globals "^11.1.0"
|
||||
lodash "^4.17.13"
|
||||
|
||||
"@babel/types@^7.10.1", "@babel/types@^7.10.2":
|
||||
version "7.10.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.2.tgz#30283be31cad0dbf6fb00bd40641ca0ea675172d"
|
||||
integrity sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==
|
||||
dependencies:
|
||||
"@babel/helper-validator-identifier" "^7.10.1"
|
||||
lodash "^4.17.13"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@babel/types@^7.4.0", "@babel/types@^7.7.4":
|
||||
version "7.7.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193"
|
||||
@ -5265,10 +5396,10 @@ glob-parent@~5.1.0:
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob@7.1.6, glob@^7.1.4:
|
||||
version "7.1.6"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
|
||||
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
||||
glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
@ -5277,9 +5408,10 @@ glob@7.1.6, glob@^7.1.4:
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
glob@7.1.6, glob@^7.1.4:
|
||||
version "7.1.6"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
|
||||
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
|
@ -31,5 +31,5 @@ export interface PullApproveConfig {
|
||||
}
|
||||
|
||||
export function parsePullApproveYaml(rawYaml: string): PullApproveConfig {
|
||||
return parseYaml(rawYaml) as PullApproveConfig;
|
||||
return parseYaml(rawYaml, {merge: true}) as PullApproveConfig;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ node ./scripts/build/build-packages-dist.js
|
||||
|
||||
## Running Tests Locally
|
||||
|
||||
Bazel is used as the primary tool for building and testing Angular. Building and testing is
|
||||
Bazel is used as the primary tool for building and testing Angular. Building and testing are
|
||||
incremental with Bazel, and it's possible to only run tests for an individual package instead
|
||||
of for all packages. Read more about this in the [BAZEL.md](./BAZEL.md) document.
|
||||
|
||||
@ -190,7 +190,7 @@ a. Any transitive dependencies of the copied packages will not be automatically
|
||||
b. The packages need to be copied over every time `npm/yarn install` is run.
|
||||
c. Some package managers (such as `pnpm` or `yarn pnp`) might not work correctly.
|
||||
|
||||
### Publishing to GitHub repos
|
||||
### Publishing to GitHub Repos
|
||||
You can also manually publish `*-builds` snapshots just like our CircleCI build does for upstream
|
||||
builds. Before being able to publish the packages, you need to build them locally by running the
|
||||
`./scripts/build/build-packages-dist.js` script.
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "angular-srcs",
|
||||
"version": "10.0.0-rc.6",
|
||||
"version": "10.0.0",
|
||||
"private": true,
|
||||
"description": "Angular - a web framework for modern web apps",
|
||||
"homepage": "https://github.com/angular/angular",
|
||||
|
@ -140,7 +140,7 @@ export interface ContentChildrenDecorator {
|
||||
*
|
||||
* * **selector** - The directive type or the name used for querying.
|
||||
* * **descendants** - True to include all descendants, otherwise include only direct children.
|
||||
* * **read** - True to read a different token from the queried elements.
|
||||
* * **read** - Used to read a different token from the queried elements.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
@ -204,7 +204,7 @@ export interface ContentChildDecorator {
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - The directive type or the name used for querying.
|
||||
* * **read** - True to read a different token from the queried element.
|
||||
* * **read** - Used to read a different token from the queried element.
|
||||
* * **static** - True to resolve query results before change detection runs,
|
||||
* false to resolve after change detection. Defaults to false.
|
||||
*
|
||||
@ -263,7 +263,7 @@ export interface ViewChildrenDecorator {
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - The directive type or the name used for querying.
|
||||
* * **read** - True to read a different token from the queried elements.
|
||||
* * **read** - Used to read a different token from the queried elements.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
@ -317,7 +317,7 @@ export interface ViewChildDecorator {
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - The directive type or the name used for querying.
|
||||
* * **read** - True to read a different token from the queried elements.
|
||||
* * **read** - Used to read a different token from the queried elements.
|
||||
* * **static** - True to resolve query results before change detection runs,
|
||||
* false to resolve after change detection. Defaults to false.
|
||||
*
|
||||
|
@ -1593,11 +1593,13 @@ export class FormGroup extends AbstractControl {
|
||||
|
||||
/** @internal */
|
||||
_anyControls(condition: Function): boolean {
|
||||
let res = false;
|
||||
this._forEachChild((control: AbstractControl, name: string) => {
|
||||
res = res || (this.contains(name) && condition(control));
|
||||
});
|
||||
return res;
|
||||
for (const controlName of Object.keys(this.controls)) {
|
||||
const control = this.controls[controlName];
|
||||
if (this.contains(controlName) && condition(control)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
@ -52,7 +52,7 @@ import {UrlTree} from '../url_tree';
|
||||
* link to user component
|
||||
* </a>
|
||||
* ```
|
||||
* RouterLink will use these to generate this link: `/user/bob#education?debug=true`.
|
||||
* RouterLink will use these to generate this link: `/user/bob?debug=true#education`.
|
||||
*
|
||||
* (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the
|
||||
* directive to preserve the current query params and fragment:
|
||||
|
@ -1127,20 +1127,11 @@ export class Router {
|
||||
extras: NavigationExtras,
|
||||
priorPromise?: {resolve: any, reject: any, promise: Promise<boolean>}): Promise<boolean> {
|
||||
const lastNavigation = this.getTransition();
|
||||
// * Imperative navigations (router.navigate) might trigger additional navigations to the same
|
||||
// URL via a popstate event and the locationChangeListener. We should skip these duplicate
|
||||
// navs.
|
||||
// * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If
|
||||
// the user follows that with a navigation using the back/forward button or manual URL change,
|
||||
// the destination may be the same as the previous imperative attempt. We should not skip
|
||||
// these navigations because it's a separate case from the one above -- it's not a duplicate
|
||||
// navigation.
|
||||
// Note that imperative navs might only trigger a popstate in tests because the
|
||||
// SpyLocation triggers it on replaceState. Real browsers don't; see #27059.
|
||||
const navigationToSameUrl = lastNavigation.urlAfterRedirects.toString() === rawUrl.toString();
|
||||
const browserNavPrecededByRouterNav =
|
||||
lastNavigation && source !== 'imperative' && lastNavigation.source === 'imperative';
|
||||
if (browserNavPrecededByRouterNav && navigationToSameUrl) {
|
||||
// If the user triggers a navigation imperatively (e.g., by using navigateByUrl),
|
||||
// and that navigation results in 'replaceState' that leads to the same URL,
|
||||
// we should skip those.
|
||||
if (lastNavigation && source !== 'imperative' && lastNavigation.source === 'imperative' &&
|
||||
lastNavigation.rawUrl.toString() === rawUrl.toString()) {
|
||||
return Promise.resolve(true); // return value is not used
|
||||
}
|
||||
|
||||
|
@ -2539,161 +2539,6 @@ describe('Integration', () => {
|
||||
})));
|
||||
});
|
||||
|
||||
describe('should not break the history', () => {
|
||||
@Injectable({providedIn: 'root'})
|
||||
class MyGuard implements CanDeactivate<any> {
|
||||
allow: boolean = true;
|
||||
canDeactivate(): boolean {
|
||||
return this.allow;
|
||||
}
|
||||
}
|
||||
|
||||
@Component({selector: 'parent', template: '<router-outlet></router-outlet>'})
|
||||
class Parent {
|
||||
}
|
||||
|
||||
@Component({selector: 'home', template: 'home'})
|
||||
class Home {
|
||||
}
|
||||
|
||||
@Component({selector: 'child1', template: 'child1'})
|
||||
class Child1 {
|
||||
}
|
||||
|
||||
@Component({selector: 'child2', template: 'child2'})
|
||||
class Child2 {
|
||||
}
|
||||
|
||||
@Component({selector: 'child3', template: 'child3'})
|
||||
class Child3 {
|
||||
}
|
||||
|
||||
@Component({selector: 'child4', template: 'child4'})
|
||||
class Child4 {
|
||||
}
|
||||
|
||||
@Component({selector: 'child5', template: 'child5'})
|
||||
class Child5 {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [Parent, Home, Child1, Child2, Child3, Child4, Child5],
|
||||
entryComponents: [Child1, Child2, Child3, Child4, Child5],
|
||||
imports: [RouterModule]
|
||||
})
|
||||
class TestModule {
|
||||
}
|
||||
|
||||
let fixture: ComponentFixture<unknown>;
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({imports: [TestModule]});
|
||||
const router = TestBed.get(Router);
|
||||
const location = TestBed.get(Location);
|
||||
fixture = createRoot(router, Parent);
|
||||
|
||||
router.resetConfig([
|
||||
{path: '', component: Home},
|
||||
{path: 'first', component: Child1},
|
||||
{path: 'second', component: Child2},
|
||||
{path: 'third', component: Child3, canDeactivate: [MyGuard]},
|
||||
{path: 'fourth', component: Child4},
|
||||
{path: 'fifth', component: Child5},
|
||||
]);
|
||||
|
||||
// Create a navigation history of pages 1-5, and go back to 3 so that there is both
|
||||
// back and forward history.
|
||||
router.navigateByUrl('/first');
|
||||
advance(fixture);
|
||||
router.navigateByUrl('/second');
|
||||
advance(fixture);
|
||||
router.navigateByUrl('/third');
|
||||
advance(fixture);
|
||||
router.navigateByUrl('/fourth');
|
||||
advance(fixture);
|
||||
router.navigateByUrl('/fifth');
|
||||
advance(fixture);
|
||||
location.back();
|
||||
advance(fixture);
|
||||
location.back();
|
||||
advance(fixture);
|
||||
}));
|
||||
|
||||
// TODO(https://github.com/angular/angular/issues/13586)
|
||||
// A fix to this requires much more design
|
||||
xit('when navigate back using Back button', fakeAsync(() => {
|
||||
const location = TestBed.get(Location);
|
||||
expect(location.path()).toEqual('/third');
|
||||
|
||||
TestBed.get(MyGuard).allow = false;
|
||||
location.back();
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/third');
|
||||
expect(fixture.nativeElement).toHaveText('child3');
|
||||
|
||||
TestBed.get(MyGuard).allow = true;
|
||||
location.back();
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/second');
|
||||
expect(fixture.nativeElement).toHaveText('child2');
|
||||
}));
|
||||
|
||||
it('when navigate back imperatively', fakeAsync(() => {
|
||||
const router = TestBed.get(Router);
|
||||
const location = TestBed.get(Location);
|
||||
expect(location.path()).toEqual('/third');
|
||||
|
||||
TestBed.get(MyGuard).allow = false;
|
||||
router.navigateByUrl('/second');
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/third');
|
||||
expect(fixture.nativeElement).toHaveText('child3');
|
||||
|
||||
TestBed.get(MyGuard).allow = true;
|
||||
location.back();
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/second');
|
||||
expect(fixture.nativeElement).toHaveText('child2');
|
||||
}));
|
||||
|
||||
// TODO(https://github.com/angular/angular/issues/13586)
|
||||
// A fix to this requires much more design
|
||||
xit('when navigate back using Foward button', fakeAsync(() => {
|
||||
const location = TestBed.get(Location);
|
||||
expect(location.path()).toEqual('/third');
|
||||
|
||||
TestBed.get(MyGuard).allow = false;
|
||||
location.forward();
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/third');
|
||||
expect(fixture.nativeElement).toHaveText('child3');
|
||||
|
||||
TestBed.get(MyGuard).allow = true;
|
||||
location.forward();
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/fourth');
|
||||
expect(fixture.nativeElement).toHaveText('child4');
|
||||
}));
|
||||
|
||||
it('when navigate forward imperatively', fakeAsync(() => {
|
||||
const router = TestBed.get(Router);
|
||||
const location = TestBed.get(Location);
|
||||
expect(location.path()).toEqual('/third');
|
||||
|
||||
TestBed.get(MyGuard).allow = false;
|
||||
router.navigateByUrl('/fourth');
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/third');
|
||||
expect(fixture.nativeElement).toHaveText('child3');
|
||||
|
||||
TestBed.get(MyGuard).allow = true;
|
||||
location.forward();
|
||||
advance(fixture);
|
||||
expect(location.path()).toEqual('/fourth');
|
||||
expect(fixture.nativeElement).toHaveText('child4');
|
||||
}));
|
||||
});
|
||||
|
||||
describe('should redirect when guard returns UrlTree', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({
|
||||
providers: [
|
||||
|
Reference in New Issue
Block a user