Compare commits
379 Commits
zone.js-0.
...
9.0.0-next
Author | SHA1 | Date | |
---|---|---|---|
4b037abda4 | |||
c849a30db4 | |||
5d8eb74634 | |||
7cc4225eb9 | |||
f6e88cd659 | |||
bdbf0c94b1 | |||
01e0f58dd6 | |||
f0bdf2a1ae | |||
641c5c1c1e | |||
a383a5a165 | |||
cfa09b84dd | |||
e213080c0b | |||
04d4fea3e8 | |||
89434e09c2 | |||
1a7c79746d | |||
c207ad80fd | |||
970b58b13f | |||
1ed3531049 | |||
a20fcbbe06 | |||
d0b3688a23 | |||
e8f9ba4b6c | |||
f5bec3ff50 | |||
9a55eaf10d | |||
8cdfcc5489 | |||
fe5caca884 | |||
a7f61e63fa | |||
c024d89448 | |||
fa79f51645 | |||
b21397bde9 | |||
b34bdf5c42 | |||
260217a800 | |||
c8b065524e | |||
60f963986f | |||
c507e4907d | |||
afc6ab5442 | |||
c56c2416a9 | |||
d498314850 | |||
8dc3f3647c | |||
67d80f9ae8 | |||
43619fc847 | |||
ad13520b24 | |||
350ea47def | |||
8c388e3730 | |||
9bbe67f286 | |||
ab30b2ad01 | |||
ba5e07efc7 | |||
df8e6750a1 | |||
1537791f06 | |||
77c382ccba | |||
8a47b48912 | |||
f7471eea3c | |||
4161d19374 | |||
375897801b | |||
03cbce8c66 | |||
288e5d894d | |||
b48dd52494 | |||
7fb3cc07de | |||
3af99a7b4a | |||
b4d3468088 | |||
266c267b62 | |||
d5101dff3b | |||
63dff9c888 | |||
7742a99cee | |||
5635505f2e | |||
cc288aec3d | |||
2d96576a10 | |||
a9864471a4 | |||
47a4edb817 | |||
3aba7ebe6a | |||
2b28b91fd9 | |||
18ce58c2bc | |||
852afb312a | |||
d4703d9316 | |||
1bb9ce5d8c | |||
97fc45f32a | |||
4b1251106e | |||
a1e91b00d2 | |||
fac066ea9f | |||
85864ed9f7 | |||
581b837e88 | |||
60a056d5dc | |||
543631f2b3 | |||
d0f3539e6e | |||
e5636a322c | |||
b094936d72 | |||
f3e4cb491e | |||
cb5701f8d9 | |||
c0680602f9 | |||
30dabdf8fc | |||
ede5786d1e | |||
46caf88b2c | |||
98420c27de | |||
a8131365c5 | |||
3e52e32dce | |||
0a09fb1432 | |||
2f6062f632 | |||
066b281979 | |||
125ef0a0ec | |||
65aaffcfe4 | |||
ac11a0be15 | |||
e3f42818e9 | |||
ef2047555a | |||
d953c1cee3 | |||
7c7fcd7ab8 | |||
c885178d5f | |||
14feb56139 | |||
f209aacbfa | |||
55eaa5fb6d | |||
70cf8ed05d | |||
c7c7f9fbe8 | |||
1cb62346e4 | |||
f57c17de2c | |||
0874bf42b6 | |||
3a4839c97e | |||
82abbecddf | |||
e63a7b0532 | |||
e3422e0aed | |||
860b5d0efa | |||
9bc9685911 | |||
cf4b944865 | |||
28c8b03797 | |||
24127a2492 | |||
bceeeba405 | |||
7bcd42e7be | |||
4908a5cffc | |||
c3f9893d81 | |||
25f31f2a14 | |||
e563d77128 | |||
e79ba194b4 | |||
ae9960be53 | |||
c7f4d500db | |||
e188c9703c | |||
b9fbd9bb03 | |||
a58a5fd7bb | |||
9bb5f05cb9 | |||
3693d7ad23 | |||
c624b14e8e | |||
3dd614db61 | |||
d443a28743 | |||
21bb74d16f | |||
1d1ab37546 | |||
a00824c986 | |||
d5aca7ef51 | |||
47cc92f004 | |||
e21e01ca22 | |||
6d11154652 | |||
6b245a39ee | |||
4f7c971ee7 | |||
0677cf0cbe | |||
904a2018e0 | |||
b6fa9299e5 | |||
21edc6a82e | |||
a367b90a82 | |||
a84b5ef81b | |||
5c94833b8f | |||
b85ac03136 | |||
7fed0faa44 | |||
02a567e46f | |||
0b009f06a9 | |||
e8c09e3b57 | |||
53bfa7c6d6 | |||
53f33c1cec | |||
10629600c5 | |||
4d549f69f8 | |||
de8ebbdfd0 | |||
0287b234ea | |||
bfc26bcd8c | |||
daac386f4d | |||
0db1b5d8f1 | |||
8e1a725462 | |||
424ab48672 | |||
62f4140634 | |||
64770571b2 | |||
c957dfc167 | |||
10ea3a9f4d | |||
ec4381dd40 | |||
2b64031ddc | |||
388578fec9 | |||
dd6070a49b | |||
3dbc4ab572 | |||
cfed0c0cf1 | |||
bb3c684b98 | |||
f8b995dbf9 | |||
639b732024 | |||
5da5ca5c23 | |||
0b1bf14cd8 | |||
d1cc7a0b26 | |||
431ddb9a45 | |||
7c2cd97e60 | |||
c2868de25a | |||
994264c0ba | |||
4bbf16e654 | |||
ae142a6827 | |||
e85ec23037 | |||
172bb76964 | |||
adb4f7c7cb | |||
5f76de1d71 | |||
71ada483bf | |||
abb44f7db0 | |||
43163523f6 | |||
ee486233e9 | |||
4c3b791ff3 | |||
964d72610f | |||
02bab8cf90 | |||
69ce1c2d41 | |||
6a0b1d58ba | |||
373d9660d0 | |||
1c6516199e | |||
3cf2005a93 | |||
2e4d17f3a9 | |||
40b28742a9 | |||
253a1125bf | |||
f41c41fd50 | |||
33fab26930 | |||
be665d8de1 | |||
c422c7210f | |||
f6a1de6b31 | |||
5a562d8a0a | |||
d6bbc4d76d | |||
4055150910 | |||
4d436800de | |||
0660903784 | |||
984d23f687 | |||
8af85d812d | |||
843881120a | |||
9e6c677135 | |||
9808d91c62 | |||
7a75f7805c | |||
cda205deb4 | |||
466f5c67d6 | |||
b9dfe66028 | |||
4d96cf5197 | |||
024c31da25 | |||
5064dc75ac | |||
bef27f2a28 | |||
628b0c1154 | |||
e4d5102b17 | |||
b25f925311 | |||
7d4c9e4b67 | |||
a5f39aeda6 | |||
a91ab15525 | |||
a95f860a96 | |||
6215636bc6 | |||
3cd8a2b907 | |||
ebcf79d7f3 | |||
a91a55a6d2 | |||
48487cb70e | |||
c68371ed14 | |||
9406104c0a | |||
c0194e0115 | |||
914900a561 | |||
4ea3e7e000 | |||
6eb9c2fab0 | |||
7b9414565e | |||
37de490e23 | |||
753080133b | |||
9a37e827e2 | |||
3df54be9e4 | |||
c0d5684078 | |||
2b289250d8 | |||
ddd02044ea | |||
c198a27a3c | |||
4f37487b1c | |||
0ddf0c4895 | |||
fd6ed1713d | |||
eb5412d76f | |||
7533338362 | |||
9896d438c0 | |||
684579b338 | |||
695f322dc1 | |||
f90c7a9df0 | |||
f2466cf4ee | |||
bed680cff8 | |||
a647298412 | |||
2abbe98e33 | |||
7613f13e54 | |||
4b8cdd4b57 | |||
17e289c39f | |||
2913340af7 | |||
f8c27d42ed | |||
17bb633031 | |||
9106271f2c | |||
48a3741d5a | |||
9d1f43f3ba | |||
6f98107d5e | |||
a8e2ee1343 | |||
e906a4f0d8 | |||
b5b33d12d6 | |||
22d3cabc10 | |||
a06043b703 | |||
4689ea2727 | |||
939529ce5d | |||
46304a4f83 | |||
f7eebd0227 | |||
8af2cc1efe | |||
e5a89e047c | |||
29d3b68554 | |||
93d27eefd5 | |||
ed70f73794 | |||
ef12e10e59 | |||
2954d1b5ca | |||
3077c9a1f8 | |||
9537b2ff84 | |||
961d663fbe | |||
57e15fc08b | |||
b70746a113 | |||
0709ed4c2b | |||
fa699f65d7 | |||
18bc4eda9f | |||
f542649b2b | |||
a574e462c9 | |||
65cafa0eec | |||
18aa173d39 | |||
bc8eb8508b | |||
7db269ba6a | |||
8e5567d964 | |||
541ce98432 | |||
e7e3f5d952 | |||
382d3ed1d2 | |||
a07de82f79 | |||
2e84f4e0cd | |||
a5b12db7d6 | |||
8b94d6a402 | |||
96cbcd6da4 | |||
2a6e6c02ed | |||
fa4e17082c | |||
ebb27727e4 | |||
046532b661 | |||
7b9891d7cd | |||
a2183ddb7a | |||
3122f3415a | |||
aaf29c8099 | |||
32e2f4daef | |||
a7c71d1a57 | |||
f2d47c96c4 | |||
184d270725 | |||
a610d12266 | |||
d0d875a3fe | |||
e8b8f6d09b | |||
9e9179e915 | |||
c1ae6124c8 | |||
b3b5c66414 | |||
82b97280f3 | |||
ecffbda664 | |||
adc39752f3 | |||
584b42343f | |||
8e7a0d4ff9 | |||
4db959260b | |||
76503e65c8 | |||
eac993dfce | |||
975917bafd | |||
185b3dd08e | |||
78659ec0b0 | |||
a9ec3db91a | |||
561ec6a5be | |||
c0317d40c9 | |||
a4bc0db474 | |||
430124a051 | |||
e08391b333 | |||
a77d0e22bf | |||
4f42eb4e77 | |||
f216724c2c | |||
5c9a8961da | |||
3479fddf68 | |||
5bebac42f9 | |||
cbcbe23fd1 | |||
fc6f48185c | |||
80f290e301 | |||
5e5be43acd | |||
0386c964b5 | |||
f5c605b608 | |||
14dba72aee | |||
5f0d5e9ccf | |||
5296c04f61 | |||
40a0666651 | |||
4da805243a | |||
14ae50b4c3 | |||
397d0ba9a3 | |||
859ebdd836 |
23
.bazelrc
23
.bazelrc
@ -36,22 +36,6 @@ build --incompatible_strict_action_env
|
|||||||
run --incompatible_strict_action_env
|
run --incompatible_strict_action_env
|
||||||
test --incompatible_strict_action_env
|
test --incompatible_strict_action_env
|
||||||
|
|
||||||
###############################
|
|
||||||
# Saucelabs support #
|
|
||||||
# Turn on these settings with #
|
|
||||||
# --config=saucelabs #
|
|
||||||
###############################
|
|
||||||
|
|
||||||
# Expose SauceLabs environment to actions
|
|
||||||
# These environment variables are needed by
|
|
||||||
# web_test_karma to run on Saucelabs
|
|
||||||
test:saucelabs --action_env=SAUCE_USERNAME
|
|
||||||
test:saucelabs --action_env=SAUCE_ACCESS_KEY
|
|
||||||
test:saucelabs --action_env=SAUCE_READY_FILE
|
|
||||||
test:saucelabs --action_env=SAUCE_PID_FILE
|
|
||||||
test:saucelabs --action_env=SAUCE_TUNNEL_IDENTIFIER
|
|
||||||
test:saucelabs --define=KARMA_WEB_TEST_MODE=SL_REQUIRED
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Release support #
|
# Release support #
|
||||||
# Turn on these settings with #
|
# Turn on these settings with #
|
||||||
@ -78,7 +62,7 @@ test --test_output=errors
|
|||||||
# Settings for CircleCI #
|
# Settings for CircleCI #
|
||||||
################################
|
################################
|
||||||
|
|
||||||
# Bazel flags for CircleCI are in /.circleci/bazel.rc
|
# Bazel flags for CircleCI are in /.circleci/bazel.linux.rc and /.circleci/bazel.windows.rc
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# Temporary Settings for Ivy #
|
# Temporary Settings for Ivy #
|
||||||
@ -162,6 +146,11 @@ build --incompatible_list_based_execution_strategy_selection=false
|
|||||||
test --incompatible_list_based_execution_strategy_selection=false
|
test --incompatible_list_based_execution_strategy_selection=false
|
||||||
run --incompatible_list_based_execution_strategy_selection=false
|
run --incompatible_list_based_execution_strategy_selection=false
|
||||||
|
|
||||||
|
# Use workers for tsc and ngc when building locally.
|
||||||
|
# This config is overwritten on CI to as the worker strategy causes flakes on CI.
|
||||||
|
build --strategy=AngularTemplateCompile=worker
|
||||||
|
build --strategy=TypeScriptCompile=worker
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
# User bazel configuration
|
# User bazel configuration
|
||||||
# NOTE: This needs to be the *last* entry in the config.
|
# NOTE: This needs to be the *last* entry in the config.
|
||||||
|
26
.circleci/bazel.common.rc
Normal file
26
.circleci/bazel.common.rc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Settings in this file should be OS agnostic. Use the bazel.<OS>.rc files for OS specific settings.
|
||||||
|
|
||||||
|
# Don't be spammy in the logs
|
||||||
|
build --noshow_progress
|
||||||
|
|
||||||
|
# Print all the options that apply to the build.
|
||||||
|
# This helps us diagnose which options override others
|
||||||
|
# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc)
|
||||||
|
build --announce_rc
|
||||||
|
|
||||||
|
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
||||||
|
test --flaky_test_attempts=2
|
||||||
|
|
||||||
|
# More details on failures
|
||||||
|
build --verbose_failures=true
|
||||||
|
|
||||||
|
# We have seen some flakiness in using TS workers on CircleCI
|
||||||
|
# https://angular-team.slack.com/archives/C07DT5M6V/p1562693245183400
|
||||||
|
# > failures like `ERROR: /home/circleci/ng/packages/core/test/BUILD.bazel:5:1:
|
||||||
|
# > Compiling TypeScript (devmode) //packages/core/test:test_lib failed: Worker process did not return a WorkResponse:`
|
||||||
|
# > I saw that issue a couple times today.
|
||||||
|
# > Example job: https://circleci.com/gh/angular/angular/385517
|
||||||
|
# We expect that TypeScript compilations will parallelize wider than the number of local cores anyway
|
||||||
|
# so we should saturate remote workers with TS compilations
|
||||||
|
build --strategy=AngularTemplateCompile=local
|
||||||
|
build --strategy=TypeScriptCompile=local
|
17
.circleci/bazel.linux.rc
Normal file
17
.circleci/bazel.linux.rc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# These options are enabled when running on CI
|
||||||
|
# We do this by copying this file to /etc/bazel.bazelrc at the start of the build.
|
||||||
|
# See documentation in /docs/BAZEL.md
|
||||||
|
|
||||||
|
# Import config items common to both Linux and Windows setups.
|
||||||
|
# https://docs.bazel.build/versions/master/guide.html#bazelrc-syntax-and-semantics
|
||||||
|
import %workspace%/.circleci/bazel.common.rc
|
||||||
|
|
||||||
|
# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
|
||||||
|
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
|
||||||
|
build --repository_cache=/home/circleci/bazel_repository_cache
|
||||||
|
|
||||||
|
# Workaround https://github.com/bazelbuild/bazel/issues/3645
|
||||||
|
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
||||||
|
# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class
|
||||||
|
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
|
||||||
|
build --local_resources=14336,8.0,1.0
|
@ -1,41 +0,0 @@
|
|||||||
# These options are enabled when running on CI
|
|
||||||
# We do this by copying this file to /etc/bazel.bazelrc at the start of the build.
|
|
||||||
# See documentation in /docs/BAZEL.md
|
|
||||||
|
|
||||||
# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
|
|
||||||
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
|
|
||||||
build --repository_cache=/home/circleci/bazel_repository_cache
|
|
||||||
|
|
||||||
# Don't be spammy in the logs
|
|
||||||
# TODO(gmagolan): Hide progress again once build performance improves
|
|
||||||
# Presently, CircleCI can timeout during bazel test ... with the following
|
|
||||||
# error: Too long with no output (exceeded 10m0s)
|
|
||||||
# build --noshow_progress
|
|
||||||
|
|
||||||
# Print all the options that apply to the build.
|
|
||||||
# This helps us diagnose which options override others
|
|
||||||
# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc)
|
|
||||||
build --announce_rc
|
|
||||||
|
|
||||||
# Workaround https://github.com/bazelbuild/bazel/issues/3645
|
|
||||||
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
|
||||||
# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class
|
|
||||||
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
|
|
||||||
build --local_resources=14336,8.0,1.0
|
|
||||||
|
|
||||||
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
|
||||||
test --flaky_test_attempts=2
|
|
||||||
|
|
||||||
# More details on failures
|
|
||||||
build --verbose_failures=true
|
|
||||||
|
|
||||||
# We have seen some flakiness in using TS workers on CircleCI
|
|
||||||
# https://angular-team.slack.com/archives/C07DT5M6V/p1562693245183400
|
|
||||||
# > failures like `ERROR: /home/circleci/ng/packages/core/test/BUILD.bazel:5:1:
|
|
||||||
# > Compiling TypeScript (devmode) //packages/core/test:test_lib failed: Worker process did not return a WorkResponse:`
|
|
||||||
# > I saw that issue a couple times today.
|
|
||||||
# > Example job: https://circleci.com/gh/angular/angular/385517
|
|
||||||
# We expect that TypeScript compilations will parallelize wider than the number of local cores anyway
|
|
||||||
# so we should saturate remote workers with TS compilations
|
|
||||||
build --strategy=TypeScriptCompile=standalone
|
|
||||||
build --strategy=AngularTemplateCompile=standalone
|
|
11
.circleci/bazel.windows.rc
Normal file
11
.circleci/bazel.windows.rc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# These options are enabled when running on CI
|
||||||
|
# We do this by copying this file to $env:ProgramData\bazel.bazelrc at the start of the build.
|
||||||
|
# See documentation in /docs/BAZEL.md
|
||||||
|
|
||||||
|
# Import config items common to both Linux and Windows setups.
|
||||||
|
# https://docs.bazel.build/versions/master/guide.html#bazelrc-syntax-and-semantics
|
||||||
|
import %workspace%/.circleci/bazel.common.rc
|
||||||
|
|
||||||
|
# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
|
||||||
|
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
|
||||||
|
build --repository_cache=C:/Users/circleci/bazel_repository_cache
|
@ -27,6 +27,7 @@ var_2: &browsers_docker_image circleci/node:10.16-browsers
|
|||||||
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
|
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
|
||||||
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
|
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
|
||||||
var_3: &cache_key v3-angular-node-10.16-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
var_3: &cache_key v3-angular-node-10.16-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
|
var_3_win: &cache_key_win v4-angular-win-node-12.0-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
|
|
||||||
# Initializes the CI environment by setting up common environment variables.
|
# Initializes the CI environment by setting up common environment variables.
|
||||||
var_4: &init_environment
|
var_4: &init_environment
|
||||||
@ -35,7 +36,7 @@ var_4: &init_environment
|
|||||||
# Overwrite the yarn installed in the docker container with our own version.
|
# Overwrite the yarn installed in the docker container with our own version.
|
||||||
command: |
|
command: |
|
||||||
./.circleci/env.sh
|
./.circleci/env.sh
|
||||||
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.13.0/bin/yarn.js)
|
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js)
|
||||||
sudo chmod a+x $ourYarn
|
sudo chmod a+x $ourYarn
|
||||||
sudo ln -fs $ourYarn /usr/local/bin/yarn
|
sudo ln -fs $ourYarn /usr/local/bin/yarn
|
||||||
echo "Yarn version: $(yarn --version)"
|
echo "Yarn version: $(yarn --version)"
|
||||||
@ -48,6 +49,12 @@ var_4: &init_environment
|
|||||||
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
|
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
|
||||||
git config --global gc.auto 0 || true
|
git config --global gc.auto 0 || true
|
||||||
|
|
||||||
|
var_4_win: &init_environment_win
|
||||||
|
run:
|
||||||
|
# Install Bazel pre-requisites that aren't in the preconfigured CircleCI Windows VM.
|
||||||
|
name: Setup windows node environment
|
||||||
|
command: ./.circleci/windows-env.ps1
|
||||||
|
|
||||||
|
|
||||||
var_5: &setup_bazel_remote_execution
|
var_5: &setup_bazel_remote_execution
|
||||||
run:
|
run:
|
||||||
@ -65,6 +72,24 @@ var_6: &job_defaults
|
|||||||
working_directory: ~/ng
|
working_directory: ~/ng
|
||||||
docker:
|
docker:
|
||||||
- image: *default_docker_image
|
- image: *default_docker_image
|
||||||
|
var_6_win: &job_defaults_win
|
||||||
|
working_directory: ~/ng
|
||||||
|
resource_class: windows.medium
|
||||||
|
# CircleCI windows VMs do have the GitBash shell available:
|
||||||
|
# https://github.com/CircleCI-Public/windows-preview-docs#shells
|
||||||
|
# But in this specific case we really should not use it because Bazel must not be ran from
|
||||||
|
# GitBash. These issues discuss why:
|
||||||
|
# https://github.com/bazelbuild/bazel/issues/5751
|
||||||
|
# https://github.com/bazelbuild/bazel/issues/5724#issuecomment-410194038
|
||||||
|
# https://github.com/bazelbuild/bazel/issues/6339#issuecomment-441600879
|
||||||
|
shell: powershell.exe -ExecutionPolicy Bypass
|
||||||
|
machine:
|
||||||
|
# Preview image that includes the following:
|
||||||
|
# - Visual Studio 2019 build tools
|
||||||
|
# - Node 12
|
||||||
|
# - yarn 1.17
|
||||||
|
# - Python 3 3.7.4
|
||||||
|
image: windows-server-2019-vs2019:201908-02
|
||||||
|
|
||||||
# After checkout, rebase on top of target branch.
|
# After checkout, rebase on top of target branch.
|
||||||
var_7: &post_checkout
|
var_7: &post_checkout
|
||||||
@ -80,6 +105,17 @@ var_7: &post_checkout
|
|||||||
else
|
else
|
||||||
echo "This build is not over a PR, nothing to do."
|
echo "This build is not over a PR, nothing to do."
|
||||||
fi
|
fi
|
||||||
|
var_7_win: &post_checkout_win
|
||||||
|
run:
|
||||||
|
name: Rebase PR on target branch
|
||||||
|
command: >
|
||||||
|
if (Test-Path env:CIRCLE_PR_NUMBER) {
|
||||||
|
git config user.name "angular-ci"
|
||||||
|
git config user.email "angular-ci"
|
||||||
|
node tools\rebase-pr.js angular/angular-cli $env:CIRCLE_PR_NUMBER
|
||||||
|
} else {
|
||||||
|
echo "This build is not over a PR, nothing to do."
|
||||||
|
}
|
||||||
|
|
||||||
var_8: &yarn_install
|
var_8: &yarn_install
|
||||||
run:
|
run:
|
||||||
@ -95,7 +131,12 @@ var_8: &yarn_install
|
|||||||
var_9: &setup_circleci_bazel_config
|
var_9: &setup_circleci_bazel_config
|
||||||
run:
|
run:
|
||||||
name: Setting up CircleCI bazel configuration
|
name: Setting up CircleCI bazel configuration
|
||||||
command: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
command: sudo cp .circleci/bazel.linux.rc $HOME/.bazelrc
|
||||||
|
|
||||||
|
var_9_win: &setup_circleci_bazel_config_win
|
||||||
|
run:
|
||||||
|
name: Setting up CircleCI bazel configuration
|
||||||
|
command: copy .circleci\bazel.windows.rc $env:USERPROFILE\.bazelrc
|
||||||
|
|
||||||
var_10: &restore_cache
|
var_10: &restore_cache
|
||||||
restore_cache:
|
restore_cache:
|
||||||
@ -103,6 +144,12 @@ var_10: &restore_cache
|
|||||||
- *cache_key
|
- *cache_key
|
||||||
# This fallback should be the cache_key without variables.
|
# This fallback should be the cache_key without variables.
|
||||||
- v3-angular-node-10.16-
|
- v3-angular-node-10.16-
|
||||||
|
var_10_win: &restore_cache_win
|
||||||
|
restore_cache:
|
||||||
|
keys:
|
||||||
|
- *cache_key_win
|
||||||
|
# This fallback should be the cache_key without variables.
|
||||||
|
- v4-angular-win-node-12.0-
|
||||||
|
|
||||||
# Branch filter that can be specified for jobs that should only run on publish branches
|
# Branch filter that can be specified for jobs that should only run on publish branches
|
||||||
# (e.g. master or the patch branch)
|
# (e.g. master or the patch branch)
|
||||||
@ -143,7 +190,7 @@ var_14: ¬ify_dev_infra_on_fail
|
|||||||
|
|
||||||
# Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys,
|
# Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys,
|
||||||
# also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable.
|
# also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable.
|
||||||
var_15: &material_unit_tests_cache_key v4-angular-material-701302dc482d7e4b77990b24e3b5ab330bbf1aa5
|
var_15: &material_unit_tests_cache_key v4-angular-material-18b9ef3f5529f0fa8f034944681486447af7b879
|
||||||
var_16: &material_unit_tests_cache_key_short v4-angular-material
|
var_16: &material_unit_tests_cache_key_short v4-angular-material
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
@ -197,14 +244,9 @@ jobs:
|
|||||||
- *setup_circleci_bazel_config
|
- *setup_circleci_bazel_config
|
||||||
# Setup remote execution and run RBE-compatible tests.
|
# Setup remote execution and run RBE-compatible tests.
|
||||||
- *setup_bazel_remote_execution
|
- *setup_bazel_remote_execution
|
||||||
- run: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
|
- run:
|
||||||
- run: mkdir ~/testlogs
|
command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
|
||||||
- run: cp -Lr dist/testlogs/* ~/testlogs
|
no_output_timeout: 20m
|
||||||
- store_test_results:
|
|
||||||
# Bazel always writes test.xml files under this directory
|
|
||||||
path: ~/testlogs
|
|
||||||
- store_artifacts:
|
|
||||||
path: ~/testlogs
|
|
||||||
|
|
||||||
# Temporary job to test what will happen when we flip the Ivy flag to true
|
# Temporary job to test what will happen when we flip the Ivy flag to true
|
||||||
test_ivy_aot:
|
test_ivy_aot:
|
||||||
@ -219,7 +261,9 @@ jobs:
|
|||||||
# We need to explicitly specify the --symlink_prefix option because otherwise we would
|
# We need to explicitly specify the --symlink_prefix option because otherwise we would
|
||||||
# not be able to easily find the output bin directory when uploading artifacts for size
|
# not be able to easily find the output bin directory when uploading artifacts for size
|
||||||
# measurements.
|
# measurements.
|
||||||
- run: yarn test-ivy-aot //... --symlink_prefix=dist/
|
- run:
|
||||||
|
command: yarn test-ivy-aot //... --symlink_prefix=dist/
|
||||||
|
no_output_timeout: 20m
|
||||||
|
|
||||||
# Publish bundle artifacts which will be used to calculate the size change. **Note**: Make
|
# Publish bundle artifacts which will be used to calculate the size change. **Note**: Make
|
||||||
# sure that the size plugin from the Angular robot fetches the artifacts from this CircleCI
|
# sure that the size plugin from the Angular robot fetches the artifacts from this CircleCI
|
||||||
@ -256,23 +300,20 @@ jobs:
|
|||||||
- *init_environment
|
- *init_environment
|
||||||
- *setup_circleci_bazel_config
|
- *setup_circleci_bazel_config
|
||||||
- run:
|
- run:
|
||||||
name: Preparing environment for running tests on Saucelabs.
|
name: Run Bazel tests in saucelabs
|
||||||
command: setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
|
|
||||||
- run:
|
|
||||||
name: Starting Saucelabs tunnel
|
|
||||||
command: ./scripts/saucelabs/start-tunnel.sh
|
|
||||||
background: true
|
|
||||||
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
|
|
||||||
# too early without Saucelabs not being ready.
|
|
||||||
- run: ./scripts/saucelabs/wait-for-tunnel.sh
|
|
||||||
# All web tests are contained within a single //:test_web_all target for Saucelabs
|
# All web tests are contained within a single //:test_web_all target for Saucelabs
|
||||||
# as running each set of tests as a separate target will attempt to acquire too
|
# as running each set of tests as a separate target will attempt to acquire too
|
||||||
# many browsers on Saucelabs (7 per target currently) and some tests will always
|
# many browsers on Saucelabs (7 per target currently) and some tests will always
|
||||||
# fail to acquire browsers. For example:
|
# fail to acquire browsers. For example:
|
||||||
# 14 02 2019 19:52:33.170:WARN [launcher]: chrome beta on SauceLabs have not captured in 180000 ms, killing.
|
# 14 02 2019 19:52:33.170:WARN [launcher]: chrome beta on SauceLabs have not captured in 180000 ms, killing.
|
||||||
# //packages/forms/test:web_test_sauce TIMEOUT in 315.0s
|
# //packages/forms/test:web_test_sauce TIMEOUT in 315.0s
|
||||||
- run: yarn bazel test --config=saucelabs //:test_web_all
|
command: |
|
||||||
- run: ./scripts/saucelabs/stop-tunnel.sh
|
./scripts/saucelabs/run-bazel-via-tunnel.sh \
|
||||||
|
--tunnel-id angular-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX} \
|
||||||
|
--username $SAUCE_USERNAME \
|
||||||
|
--key $(echo $SAUCE_ACCESS_KEY | rev) \
|
||||||
|
yarn bazel test //:test_web_all
|
||||||
|
no_output_timeout: 20m
|
||||||
- *notify_dev_infra_on_fail
|
- *notify_dev_infra_on_fail
|
||||||
|
|
||||||
test_aio:
|
test_aio:
|
||||||
@ -321,7 +362,7 @@ jobs:
|
|||||||
- *attach_workspace
|
- *attach_workspace
|
||||||
- *init_environment
|
- *init_environment
|
||||||
# Build aio (with local Angular packages)
|
# Build aio (with local Angular packages)
|
||||||
- run: yarn --cwd aio build-local --progress=false
|
- run: yarn --cwd aio build-local-ci
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
- run: yarn --cwd aio test --progress=false --watch=false
|
- run: yarn --cwd aio test --progress=false --watch=false
|
||||||
# Run e2e tests
|
# Run e2e tests
|
||||||
@ -340,7 +381,7 @@ jobs:
|
|||||||
- *attach_workspace
|
- *attach_workspace
|
||||||
- *init_environment
|
- *init_environment
|
||||||
# Build aio with Ivy (using local Angular packages)
|
# Build aio with Ivy (using local Angular packages)
|
||||||
- run: yarn --cwd aio build-with-ivy --progress=false
|
- run: yarn --cwd aio build-with-ivy-ci
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
- run: yarn --cwd aio test --progress=false --watch=false
|
- run: yarn --cwd aio test --progress=false --watch=false
|
||||||
# Run e2e tests
|
# Run e2e tests
|
||||||
@ -669,11 +710,63 @@ jobs:
|
|||||||
cp dist/bin/packages/zone.js/npm_package/dist/zone-patch-electron.js ./packages/zone.js/test/extra/ &&
|
cp dist/bin/packages/zone.js/npm_package/dist/zone-patch-electron.js ./packages/zone.js/test/extra/ &&
|
||||||
yarn --cwd packages/zone.js electrontest
|
yarn --cwd packages/zone.js electrontest
|
||||||
|
|
||||||
|
# Windows jobs
|
||||||
|
# Docs: https://circleci.com/docs/2.0/hello-world-windows/
|
||||||
|
# Skipping workspace for now because it fails to extract on windows.
|
||||||
|
# TODO: when CircleCI fixes it, split this single job into install/test ones.
|
||||||
|
# Notes:
|
||||||
|
# - windows needs its own cache key because binaries in node_modules are different.
|
||||||
|
# - windows might need its own workspace for the same reason.
|
||||||
|
test_win:
|
||||||
|
<<: *job_defaults_win
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- *init_environment_win
|
||||||
|
- *post_checkout_win
|
||||||
|
# TODO: windows cache restoration is currently failing. Re-enable when it's fixed.
|
||||||
|
# Example failure: https://circleci.com/gh/angular/angular/423738
|
||||||
|
# - *restore_cache_win
|
||||||
|
- *setup_circleci_bazel_config_win
|
||||||
|
- run: yarn install --frozen-lockfile --non-interactive
|
||||||
|
# Install @bazel/bazel globally and use that for the first run.
|
||||||
|
# Workaround for https://github.com/bazelbuild/rules_nodejs/issues/894
|
||||||
|
- run: yarn global add @bazel/bazel@$env:BAZEL_VERSION
|
||||||
|
- run: bazel info
|
||||||
|
# Ran into a command parsing problem where `-browser:chromium-local` was converted to
|
||||||
|
# `-browser: chromium-local` (a space was added) in https://circleci.com/gh/angular/angular/357511.
|
||||||
|
# Probably a powershell command parsing thing. This way there's no problem.
|
||||||
|
- run:
|
||||||
|
command: yarn circleci-win-ve
|
||||||
|
no_output_timeout: 45m
|
||||||
|
# - save_cache:
|
||||||
|
# key: *cache_key_win
|
||||||
|
# paths:
|
||||||
|
# - "node_modules"
|
||||||
|
# - "C:/Users/circleci/bazel_repository_cache"
|
||||||
|
test_ivy_aot_win:
|
||||||
|
<<: *job_defaults_win
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- *init_environment_win
|
||||||
|
- *post_checkout_win
|
||||||
|
# - *restore_cache_win
|
||||||
|
- *setup_circleci_bazel_config_win
|
||||||
|
- run: yarn install --frozen-lockfile --non-interactive
|
||||||
|
- run: yarn global add @bazel/bazel@$env:BAZEL_VERSION
|
||||||
|
- run: bazel info
|
||||||
|
- run:
|
||||||
|
command: yarn circleci-win-ivy
|
||||||
|
no_output_timeout: 45m
|
||||||
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
default_workflow:
|
default_workflow:
|
||||||
jobs:
|
jobs:
|
||||||
- setup
|
- setup:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore: g3
|
||||||
- lint:
|
- lint:
|
||||||
requires:
|
requires:
|
||||||
- setup
|
- setup
|
||||||
@ -766,6 +859,25 @@ workflows:
|
|||||||
- test_zonejs:
|
- test_zonejs:
|
||||||
requires:
|
requires:
|
||||||
- setup
|
- setup
|
||||||
|
# Windows jobs very slow so we run it on non-PRs only for now.
|
||||||
|
# TODO: remove the filter when CircleCI makes Windows FS faster.
|
||||||
|
# The Windows jobs are only run after their non-windows counterparts finish successfully.
|
||||||
|
# This isn't strictly necessary as there is no artifact dependency, but helps economize
|
||||||
|
# CI resources by not attempting to build when we know should fail.
|
||||||
|
- test_win:
|
||||||
|
requires:
|
||||||
|
- test
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- /pull\/.*/
|
||||||
|
- test_ivy_aot_win:
|
||||||
|
requires:
|
||||||
|
- test_ivy_aot
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- /pull\/.*/
|
||||||
|
|
||||||
aio_monitoring:
|
aio_monitoring:
|
||||||
jobs:
|
jobs:
|
||||||
@ -784,9 +896,3 @@ workflows:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# - don't build the g3 branch
|
|
||||||
# - verify that we are bootstrapping with the right yarn version coming from the docker image
|
|
||||||
# - check local chrome version pulled from docker image
|
|
||||||
# - remove /tools/ngcontainer
|
|
||||||
|
@ -61,6 +61,7 @@ else
|
|||||||
setPublicVar SAUCE_USERNAME "angular-ci";
|
setPublicVar SAUCE_USERNAME "angular-ci";
|
||||||
setSecretVar SAUCE_ACCESS_KEY "9b988f434ff8-fbca-8aa4-4ae3-35442987";
|
setSecretVar SAUCE_ACCESS_KEY "9b988f434ff8-fbca-8aa4-4ae3-35442987";
|
||||||
fi
|
fi
|
||||||
|
# TODO(josephperrott): Remove environment variables once all saucelabs tests are via bazel method.
|
||||||
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
|
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
|
||||||
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
|
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
|
||||||
setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock
|
setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock
|
||||||
@ -79,7 +80,7 @@ setPublicVar MATERIAL_REPO_TMP_DIR "/tmp/material2"
|
|||||||
setPublicVar MATERIAL_REPO_URL "https://github.com/angular/material2.git"
|
setPublicVar MATERIAL_REPO_URL "https://github.com/angular/material2.git"
|
||||||
setPublicVar MATERIAL_REPO_BRANCH "master"
|
setPublicVar MATERIAL_REPO_BRANCH "master"
|
||||||
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI "config.yml".
|
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI "config.yml".
|
||||||
setPublicVar MATERIAL_REPO_COMMIT "701302dc482d7e4b77990b24e3b5ab330bbf1aa5"
|
setPublicVar MATERIAL_REPO_COMMIT "18b9ef3f5529f0fa8f034944681486447af7b879"
|
||||||
|
|
||||||
# Source `$BASH_ENV` to make the variables available immediately.
|
# Source `$BASH_ENV` to make the variables available immediately.
|
||||||
source $BASH_ENV;
|
source $BASH_ENV;
|
||||||
|
47
.circleci/windows-env.ps1
Normal file
47
.circleci/windows-env.ps1
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Install Bazel pre-reqs on Windows
|
||||||
|
# https://docs.bazel.build/versions/master/install-windows.html
|
||||||
|
# https://docs.bazel.build/versions/master/windows.html
|
||||||
|
# Install MSYS2 and packages
|
||||||
|
choco install msys2 --version 20180531.0.0 --no-progress --package-parameters "/NoUpdate"
|
||||||
|
C:\tools\msys64\usr\bin\bash.exe -l -c "pacman --needed --noconfirm -S zip unzip patch diffutils git"
|
||||||
|
|
||||||
|
# Add PATH modifications to the Powershell profile. This is the win equivalent of .bash_profile.
|
||||||
|
# https://docs.microsoft.com/en-us/previous-versions//bb613488(v=vs.85)
|
||||||
|
new-item -path $profile -itemtype file -force
|
||||||
|
# Paths for nodejs, npm, yarn, and msys2. Use single quotes to prevent interpolation.
|
||||||
|
# Add before the original path to use msys2 instead of the installed gitbash.
|
||||||
|
Add-Content $profile '$Env:path = "${Env:ProgramFiles}\nodejs\;C:\Users\circleci\AppData\Roaming\npm\;${Env:ProgramFiles(x86)}\Yarn\bin\;C:\Users\circleci\AppData\Local\Yarn\bin\;C:\tools\msys64\usr\bin\;" + $Env:path'
|
||||||
|
# Environment variables for Bazel
|
||||||
|
Add-Content $profile '$Env:BAZEL_SH = "C:\tools\msys64\usr\bin\bash.exe"'
|
||||||
|
|
||||||
|
# Get the bazel version devdep and store it in a global var for use in the circleci job.
|
||||||
|
$bazelVersion = & ${Env:ProgramFiles}\nodejs\node.exe -e "console.log(require('./package.json').devDependencies['@bazel/bazel'])"
|
||||||
|
# This is a tricky situation: we want $bazelVersion to be evaluated but not $Env:BAZEL_VERSION.
|
||||||
|
# Formatting works https://stackoverflow.com/questions/32127583/expand-variable-inside-single-quotes
|
||||||
|
$bazelVersionGlobalVar = '$Env:BAZEL_VERSION = "{0}"' -f $bazelVersion
|
||||||
|
Add-Content $profile $bazelVersionGlobalVar
|
||||||
|
|
||||||
|
# Remove the CircleCI checkout SSH override, because it breaks cloning repositories through Bazel.
|
||||||
|
# See https://circleci.com/gh/angular/angular/401454 for an example.
|
||||||
|
# TODO: is this really needed? Maybe there's a better way. It doesn't happen on Linux or on Codefresh.
|
||||||
|
git config --global --unset url.ssh://git@github.com.insteadOf
|
||||||
|
|
||||||
|
# Print node and yarn versions.
|
||||||
|
echo "Node version:"
|
||||||
|
node -v
|
||||||
|
echo "Yarn version:"
|
||||||
|
yarn -v
|
||||||
|
|
||||||
|
|
||||||
|
# These Bazel prereqs aren't needed because the CircleCI image already includes them.
|
||||||
|
# choco install nodejs --version 10.16.0 --no-progress
|
||||||
|
# choco install yarn --version 1.16.0 --no-progress
|
||||||
|
# choco install vcredist2015 --version 14.0.24215.20170201
|
||||||
|
|
||||||
|
# We don't need VS Build Tools for the tested bazel targets.
|
||||||
|
# If it's needed again, uncomment these lines.
|
||||||
|
# VS Build Tools are needed for Bazel C++ targets (like com_google_protobuf)
|
||||||
|
# choco install visualstudio2019buildtools --version 16.1.2.0 --no-progress --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.Component.VC.Runtime.UCRTSDK --add Microsoft.VisualStudio.Component.Windows10SDK.17763"
|
||||||
|
# Add-Content $profile '$Env:BAZEL_VC = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\VC\"'
|
||||||
|
# Python is needed for Bazel Python targets
|
||||||
|
# choco install python --version 3.5.1 --no-progress
|
@ -1,126 +0,0 @@
|
|||||||
# escape=`
|
|
||||||
|
|
||||||
ARG core=mcr.microsoft.com/windows/servercore:1809
|
|
||||||
ARG target=mcr.microsoft.com/powershell:windowsservercore-1809
|
|
||||||
|
|
||||||
FROM $core as download
|
|
||||||
|
|
||||||
ARG node_version=10.13.0
|
|
||||||
ARG yarn_version=1.13.0
|
|
||||||
|
|
||||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
|
||||||
|
|
||||||
ENV GPG_VERSION 2.3.4
|
|
||||||
|
|
||||||
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; `
|
|
||||||
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
|
|
||||||
|
|
||||||
RUN @( `
|
|
||||||
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', `
|
|
||||||
'FD3A5288F042B6850C66B31F09FE44734EB7990E', `
|
|
||||||
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', `
|
|
||||||
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', `
|
|
||||||
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', `
|
|
||||||
'B9AE9905FFD7803F25714661B63B535A4C206CA9', `
|
|
||||||
'77984A986EBC2AA786BC0F66B01FBB92821C587A', `
|
|
||||||
'8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600', `
|
|
||||||
'4ED778F539E3634C779C87C6D7062848A1AB005C', `
|
|
||||||
'A48C2BEE680E841632CD4E44F07496B3EB3C1762', `
|
|
||||||
'B9E2F5981AA6E0CD28160D9FF13993A75599653C' `
|
|
||||||
) | foreach { `
|
|
||||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; `
|
|
||||||
}
|
|
||||||
|
|
||||||
ENV NODE_VERSION=$node_version
|
|
||||||
|
|
||||||
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; `
|
|
||||||
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
|
|
||||||
|
|
||||||
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; `
|
|
||||||
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; `
|
|
||||||
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; `
|
|
||||||
Expand-Archive node.zip -DestinationPath C:\ ; `
|
|
||||||
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
|
|
||||||
|
|
||||||
ENV YARN_VERSION=$yarn_version
|
|
||||||
|
|
||||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
|
|
||||||
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; `
|
|
||||||
$sig = Get-AuthenticodeSignature yarn.msi ; `
|
|
||||||
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; `
|
|
||||||
Write-Output $sig.SignerCertificate.Thumbprint ; `
|
|
||||||
if (@( `
|
|
||||||
'7E253367F8A102A91D04829E37F3410F14B68A5F', `
|
|
||||||
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' `
|
|
||||||
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; `
|
|
||||||
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
|
|
||||||
|
|
||||||
ENV GIT_VERSION 2.20.1
|
|
||||||
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/MinGit-${GIT_VERSION}-busybox-64-bit.zip
|
|
||||||
ENV GIT_SHA256 9817ab455d9cbd0b09d8664b4afbe4bbf78d18b556b3541d09238501a749486c
|
|
||||||
|
|
||||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
|
|
||||||
Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; `
|
|
||||||
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; `
|
|
||||||
Expand-Archive git.zip -DestinationPath C:\git; `
|
|
||||||
Remove-Item git.zip
|
|
||||||
|
|
||||||
FROM $target as baseimage
|
|
||||||
|
|
||||||
ENV NPM_CONFIG_LOGLEVEL info
|
|
||||||
|
|
||||||
COPY --from=download /nodejs /nodejs
|
|
||||||
COPY --from=download [ "/Program Files (x86)/yarn", "/yarn" ]
|
|
||||||
COPY --from=download /git /git
|
|
||||||
|
|
||||||
ARG SETX=/M
|
|
||||||
RUN setx %SETX% PATH "%PATH%;C:\nodejs;C:\yarn\bin;C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin"
|
|
||||||
|
|
||||||
CMD [ "node.exe" ]
|
|
||||||
|
|
||||||
FROM baseimage
|
|
||||||
|
|
||||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
|
||||||
|
|
||||||
# Install Bazel prereqs on Windows (https://docs.bazel.build/versions/master/install-windows.html)
|
|
||||||
|
|
||||||
# Install MSYS2
|
|
||||||
RUN Invoke-WebRequest -UseBasicParsing 'https://www.7-zip.org/a/7z1805-x64.exe' -OutFile 7z.exe; `
|
|
||||||
Start-Process -FilePath 'C:\\7z.exe' -ArgumentList '/S', '/D=C:\\7zip0' -NoNewWindow -Wait; `
|
|
||||||
Invoke-WebRequest -UseBasicParsing 'http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20180531.tar.xz' -OutFile msys2.tar.xz; `
|
|
||||||
Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'e', 'msys2.tar.xz' -Wait; `
|
|
||||||
Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'x', 'msys2.tar', '-oC:\\' -Wait; `
|
|
||||||
Remove-Item msys2.tar.xz; `
|
|
||||||
Remove-Item msys2.tar; `
|
|
||||||
Remove-Item 7z.exe; `
|
|
||||||
Remove-Item -Recurse 7zip; `
|
|
||||||
[Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\msys64\usr\bin', [System.EnvironmentVariableTarget]::Machine); `
|
|
||||||
[Environment]::SetEnvironmentVariable('BAZEL_SH', 'C:\msys64\usr\bin\bash.exe', [System.EnvironmentVariableTarget]::Machine)
|
|
||||||
|
|
||||||
# Install MSYS2 packages
|
|
||||||
RUN C:\msys64\usr\bin\bash.exe -l -c \"pacman --needed --noconfirm -S zip unzip patch diffutils git\"
|
|
||||||
|
|
||||||
# Install VS Build Tools (required to build C++ targets)
|
|
||||||
RUN Invoke-WebRequest -UseBasicParsing https://download.visualstudio.microsoft.com/download/pr/df649173-11e9-4af2-8eb7-0eb02ba8958a/cadb5bdac41e55bb8f6a6b7c45273370/vs_buildtools.exe -OutFile vs_BuildTools.exe; `
|
|
||||||
# Installer won't detect DOTNET_SKIP_FIRST_TIME_EXPERIENCE if ENV is used, must use setx /M
|
|
||||||
setx /M DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1; `
|
|
||||||
Start-Process vs_BuildTools.exe `
|
|
||||||
-ArgumentList `
|
|
||||||
'--add', 'Microsoft.VisualStudio.Workload.VCTools', `
|
|
||||||
'--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', `
|
|
||||||
'--add', 'Microsoft.Component.VC.Runtime.UCRTSDK', `
|
|
||||||
'--add', 'Microsoft.VisualStudio.Component.Windows10SDK.17763', `
|
|
||||||
'--quiet', '--norestart', '--nocache' `
|
|
||||||
-NoNewWindow -Wait; `
|
|
||||||
Remove-Item -Force vs_buildtools.exe; `
|
|
||||||
Remove-Item -Force -Recurse \"${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\"; `
|
|
||||||
Remove-Item -Force -Recurse ${Env:TEMP}\*; `
|
|
||||||
Remove-Item -Force -Recurse \"${Env:ProgramData}\Package Cache\"; `
|
|
||||||
[Environment]::SetEnvironmentVariable('BAZEL_VC', \"${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\VC\", [System.EnvironmentVariableTarget]::Machine)
|
|
||||||
|
|
||||||
# Install Python (required to build Python targets)
|
|
||||||
RUN Invoke-WebRequest -UseBasicParsing https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe -OutFile python-3.5.1.exe; `
|
|
||||||
Start-Process python-3.5.1.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait; `
|
|
||||||
Remove-Item -Force python-3.5.1.exe
|
|
||||||
|
|
||||||
CMD ["cmd.exe"]
|
|
@ -1,33 +0,0 @@
|
|||||||
# CodeFresh configuration
|
|
||||||
|
|
||||||
[](https://g.codefresh.io/public/accounts/angular/pipelines/angular/angular/angular)
|
|
||||||
|
|
||||||
This folder contains configuration for the [CodeFresh](<https://codefresh.io/>) based CI checks for this repository.
|
|
||||||
|
|
||||||
## The build pipeline
|
|
||||||
|
|
||||||
CodeFresh uses a several pipeline for each repository. The `codefresh.yml` file defines pipeline [build steps](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/) for this repository.
|
|
||||||
|
|
||||||
Run results can be seen in the GitHub checks interface and in the [public pipeline](https://g.codefresh.io/public/accounts/angular/pipelines/angular/angular/angular)
|
|
||||||
|
|
||||||
Although most configuration is done via `pipeline.yml`, some options are only available in the online [pipeline settings](https://g.codefresh.io/pipelines/angular/services?repoOwner=angular&repoName=angular&project=angular%2Fangular&context=github&serviceName=angular%2Fangular), which needs a login to access.
|
|
||||||
|
|
||||||
|
|
||||||
## Caretaker
|
|
||||||
|
|
||||||
CodeFresh status can be found at <http://status.codefresh.io/>.
|
|
||||||
|
|
||||||
Issues related to the CodeFresh setup should be escalated to the Tools Team via the current caretaker, followed by Alex Eagle and Filipe Silva.
|
|
||||||
|
|
||||||
## Rollout strategy
|
|
||||||
|
|
||||||
Currently it is only used for tests on Windows platforms, on the master branch, and without pushing user-facing reports. It's only possible to see current builds in the [public pipeline dashboard](https://g.codefresh.io/public/accounts/angular/pipelines/angular/angular/angular).
|
|
||||||
|
|
||||||
After a week or two of running like this, we should reassess how stable and reliable it is.
|
|
||||||
|
|
||||||
Next steps include:
|
|
||||||
- building PRs
|
|
||||||
- showing build status publicly
|
|
||||||
- blocking PRs that break the build
|
|
||||||
- expanding the test suite
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
# These options are enabled when running on CI
|
|
||||||
# We do this by copying this file to /etc/bazel.bazelrc at the start of the build.
|
|
||||||
# See documentation in /docs/BAZEL.md
|
|
||||||
|
|
||||||
# Save built files and downloaded repositories in a location that can be cached by CodeFresh and
|
|
||||||
# shared between builds. This helps speed up the analysis time significantly with Bazel managed node
|
|
||||||
# dependencies on the CI.
|
|
||||||
# https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/#caching-the-artifacts-of-your-build-system
|
|
||||||
build --repository_cache=C:/codefresh/volume/bazel_repository_cache
|
|
||||||
# Setting the output_base to a Docker volume is currently broken because of a Docker bug on Windows:
|
|
||||||
# https://github.com/moby/moby/issues/37024
|
|
||||||
# This affects Bazel because bazel_output_base\external\bazel_tools is an absolute path junction.
|
|
||||||
# When its fixed we can uncomment this line, and use a different output_base for Ivy tests (they
|
|
||||||
# use a separate compiler and destructively replace the cache).
|
|
||||||
# startup --output_base=C:/codefresh/volume/bazel_output_base
|
|
||||||
|
|
||||||
# Don't be spammy in the logs
|
|
||||||
# TODO(gmagolan): Hide progress again once build performance improves
|
|
||||||
# Presently, CircleCI can timeout during bazel test ... with the following
|
|
||||||
# error: Too long with no output (exceeded 10m0s)
|
|
||||||
build --noshow_progress
|
|
||||||
|
|
||||||
# Print all the options that apply to the build.
|
|
||||||
# This helps us diagnose which options override others
|
|
||||||
# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc)
|
|
||||||
build --announce_rc
|
|
||||||
|
|
||||||
# Workaround https://github.com/bazelbuild/bazel/issues/3645
|
|
||||||
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
|
||||||
# Limit Bazel to consuming resources that fit in CodeFresh VMs
|
|
||||||
# TODO(filipesilva): determine the correct memory limit
|
|
||||||
build --local_resources=10240,8.0,1.0
|
|
||||||
|
|
||||||
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
|
||||||
test --flaky_test_attempts=2
|
|
||||||
|
|
||||||
# More details on failures
|
|
||||||
build --verbose_failures=true
|
|
@ -1,28 +0,0 @@
|
|||||||
version: '1.0'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
BuildImage:
|
|
||||||
title: Build Docker image
|
|
||||||
type: build
|
|
||||||
image_name: node-bazel-windows
|
|
||||||
working_directory: ./.codefresh
|
|
||||||
no_cf_cache: true
|
|
||||||
build_arguments:
|
|
||||||
- node_version=10.13.0
|
|
||||||
- yarn_version=1.13.0
|
|
||||||
dockerfile: ./Dockerfile.win-1809
|
|
||||||
|
|
||||||
RunTests:
|
|
||||||
title: Run Bazel tests
|
|
||||||
image: ${{BuildImage}}
|
|
||||||
commands:
|
|
||||||
# Install dependencies
|
|
||||||
- yarn install --frozen-lockfile --non-interactive --network-timeout 100000 --no-progress
|
|
||||||
# Add Bazel CI config
|
|
||||||
- copy .codefresh\bazel.rc %ProgramData%\bazel.bazelrc
|
|
||||||
# Run tests
|
|
||||||
# At the moment 'browser:chromium-local' are broken in CI while locally they work
|
|
||||||
# VE
|
|
||||||
- yarn bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-browser:chromium-local //...
|
|
||||||
# Ivy
|
|
||||||
- yarn bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //...
|
|
84
.github/CODEOWNERS
vendored
84
.github/CODEOWNERS
vendored
@ -101,7 +101,6 @@
|
|||||||
#
|
#
|
||||||
# - brandonroberts
|
# - brandonroberts
|
||||||
# - gkalpak
|
# - gkalpak
|
||||||
# - jenniferfell
|
|
||||||
# - petebacondarwin
|
# - petebacondarwin
|
||||||
|
|
||||||
|
|
||||||
@ -349,10 +348,9 @@
|
|||||||
|
|
||||||
|
|
||||||
# ===========================================================
|
# ===========================================================
|
||||||
# @angular/fw-dev-infra
|
# @angular/dev-infra-framework
|
||||||
# ===========================================================
|
# ===========================================================
|
||||||
#
|
#
|
||||||
# - alexeagle
|
|
||||||
# - devversion
|
# - devversion
|
||||||
# - filipesilva
|
# - filipesilva
|
||||||
# - gkalpak
|
# - gkalpak
|
||||||
@ -419,6 +417,7 @@
|
|||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/packages/compiler/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/compiler/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/compiler/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/compiler-cli/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/compiler-cli/** @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/aot-compiler.md @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/aot-compiler.md @angular/fw-compiler @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
|
||||||
@ -454,8 +453,10 @@
|
|||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/packages/core/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/core/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/core/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/common/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/common/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/platform-browser/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/platform-browser/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/platform-browser/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/platform-browser-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/platform-browser-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/platform-webworker/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/platform-webworker/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/platform-webworker-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/platform-webworker-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -516,6 +517,8 @@
|
|||||||
|
|
||||||
/aio/content/guide/hierarchical-dependency-injection.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/hierarchical-dependency-injection.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/hierarchical-dependency-injection/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/hierarchical-dependency-injection/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/aio/content/examples/providers-viewproviders/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/aio/content/examples/resolution-modifiers/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
|
||||||
/aio/content/guide/lazy-loading-ngmodules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/lazy-loading-ngmodules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/lazy-loading-ngmodules/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/lazy-loading-ngmodules/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -550,8 +553,10 @@
|
|||||||
/aio/content/examples/attribute-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/attribute-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/two-way-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/two-way-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/built-in-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/built-in-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/aio/content/images/guide/built-in-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/template-reference-variables/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/template-reference-variables/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/inputs-outputs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/inputs-outputs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/aio/content/images/guide/inputs-outputs/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/template-expression-operators/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/template-expression-operators/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
|
||||||
|
|
||||||
@ -587,6 +592,7 @@
|
|||||||
|
|
||||||
/packages/common/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/common/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/packages/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/http.md @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/http.md @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/http/** @angular/fw-http @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -609,6 +615,7 @@
|
|||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/packages/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/forms.md @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/forms.md @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/forms/** @angular/fw-forms @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -652,6 +659,7 @@
|
|||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/packages/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/router.md @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/router.md @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/router/** @angular/fw-router @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -663,6 +671,7 @@
|
|||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/packages/service-worker/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/packages/service-worker/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/packages/examples/service-worker/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/service-worker-getting-started.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/service-worker-getting-started.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/service-worker-getting-started/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/service-worker-getting-started/** @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/app-shell.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/app-shell.md @angular/fw-service-worker @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -689,6 +698,7 @@
|
|||||||
/aio/content/examples/upgrade-phonecat-2-hybrid/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/upgrade-phonecat-2-hybrid/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/upgrade-phonecat-3-final/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/upgrade-phonecat-3-final/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/upgrade-performance.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/upgrade-performance.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/aio/content/guide/upgrade-setup.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/ajs-quick-reference.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/ajs-quick-reference.md @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/ajs-quick-reference/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/ajs-quick-reference/** @angular/fw-upgrade @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
|
||||||
@ -777,7 +787,6 @@ testing/** @angular/fw-test
|
|||||||
/aio/tools/** @angular/docs-infra @angular/framework-global-approvers
|
/aio/tools/** @angular/docs-infra @angular/framework-global-approvers
|
||||||
|
|
||||||
# Hidden docs
|
# Hidden docs
|
||||||
/aio/content/guide/change-log.md @angular/docs-infra @angular/framework-global-approvers
|
|
||||||
/aio/content/guide/docs-style-guide.md @angular/docs-infra @angular/framework-global-approvers
|
/aio/content/guide/docs-style-guide.md @angular/docs-infra @angular/framework-global-approvers
|
||||||
/aio/content/examples/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
|
/aio/content/examples/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
|
||||||
/aio/content/images/guide/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
|
/aio/content/images/guide/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
|
||||||
@ -790,9 +799,8 @@ testing/** @angular/fw-test
|
|||||||
# Docs: getting started & tutorial
|
# Docs: getting started & tutorial
|
||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/aio/content/guide/quickstart.md @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/setup-local.md @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/cli-quickstart/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/setup-local/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/cli-quickstart/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
|
||||||
/aio/content/tutorial/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/tutorial/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/toh/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/toh/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/toh-pt0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/toh-pt0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -804,8 +812,8 @@ testing/** @angular/fw-test
|
|||||||
/aio/content/examples/toh-pt6/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/toh-pt6/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/getting-started-v0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/getting-started-v0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/examples/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/start/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/getting-started/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/start/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
|
||||||
|
|
||||||
# ================================================
|
# ================================================
|
||||||
@ -831,11 +839,11 @@ testing/** @angular/fw-test
|
|||||||
/aio/content/guide/npm-packages.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/npm-packages.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/browser-support.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/browser-support.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/typescript-configuration.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/typescript-configuration.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/setup.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
|
||||||
/aio/content/examples/setup/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/examples/setup/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/build.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/build.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/images/guide/build/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/images/guide/build/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/deployment.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/deployment.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
|
/aio/content/images/guide/deployment/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/file-structure.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/file-structure.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/releases.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/releases.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
/aio/content/guide/updating.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
/aio/content/guide/updating.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
|
||||||
@ -881,34 +889,34 @@ testing/** @angular/fw-test
|
|||||||
# Build & CI Owners
|
# Build & CI Owners
|
||||||
# ================================================
|
# ================================================
|
||||||
|
|
||||||
/* @angular/fw-dev-infra
|
/* @angular/dev-infra-framework
|
||||||
/.buildkite/** @angular/fw-dev-infra
|
/.buildkite/** @angular/dev-infra-framework
|
||||||
/.circleci/** @angular/fw-dev-infra
|
/.circleci/** @angular/dev-infra-framework
|
||||||
/.codefresh/** @angular/fw-dev-infra
|
/.devcontainer/** @angular/dev-infra-framework
|
||||||
/.devcontainer/** @angular/fw-dev-infra
|
/.github/** @angular/dev-infra-framework
|
||||||
/.github/** @angular/fw-dev-infra
|
/.vscode/** @angular/dev-infra-framework
|
||||||
/.vscode/** @angular/fw-dev-infra
|
/docs/BAZEL.md @angular/dev-infra-framework
|
||||||
/docs/BAZEL.md @angular/fw-dev-infra
|
/packages/* @angular/dev-infra-framework
|
||||||
/packages/* @angular/fw-dev-infra
|
/packages/examples/test-utils/** @angular/dev-infra-framework
|
||||||
/scripts/** @angular/fw-dev-infra
|
/scripts/** @angular/dev-infra-framework
|
||||||
/third_party/** @angular/fw-dev-infra
|
/third_party/** @angular/dev-infra-framework
|
||||||
/tools/build/** @angular/fw-dev-infra
|
/tools/build/** @angular/dev-infra-framework
|
||||||
/tools/cjs-jasmine/** @angular/fw-dev-infra
|
/tools/cjs-jasmine/** @angular/dev-infra-framework
|
||||||
/tools/gulp-tasks/** @angular/fw-dev-infra
|
/tools/gulp-tasks/** @angular/dev-infra-framework
|
||||||
/tools/ngcontainer/** @angular/fw-dev-infra
|
/tools/ngcontainer/** @angular/dev-infra-framework
|
||||||
/tools/npm/** @angular/fw-dev-infra
|
/tools/npm/** @angular/dev-infra-framework
|
||||||
/tools/npm_workspace/** @angular/fw-dev-infra
|
/tools/npm_workspace/** @angular/dev-infra-framework
|
||||||
/tools/public_api_guard/** @angular/fw-dev-infra
|
/tools/public_api_guard/** @angular/dev-infra-framework
|
||||||
/tools/rxjs/** @angular/fw-dev-infra
|
/tools/rxjs/** @angular/dev-infra-framework
|
||||||
/tools/source-map-test/** @angular/fw-dev-infra
|
/tools/source-map-test/** @angular/dev-infra-framework
|
||||||
/tools/symbol-extractor/** @angular/fw-dev-infra
|
/tools/symbol-extractor/** @angular/dev-infra-framework
|
||||||
/tools/testing/** @angular/fw-dev-infra
|
/tools/testing/** @angular/dev-infra-framework
|
||||||
/tools/ts-api-guardian/** @angular/fw-dev-infra
|
/tools/ts-api-guardian/** @angular/dev-infra-framework
|
||||||
/tools/tslint/** @angular/fw-dev-infra
|
/tools/tslint/** @angular/dev-infra-framework
|
||||||
/tools/validate-commit-message/** @angular/fw-dev-infra
|
/tools/validate-commit-message/** @angular/dev-infra-framework
|
||||||
/tools/yarn/** @angular/fw-dev-infra
|
/tools/yarn/** @angular/dev-infra-framework
|
||||||
/tools/*
|
/tools/* @angular/dev-infra-framework
|
||||||
*.bzl @angular/fw-dev-infra
|
*.bzl @angular/dev-infra-framework
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -20,6 +20,8 @@ pubspec.lock
|
|||||||
*.swo
|
*.swo
|
||||||
modules/.settings
|
modules/.settings
|
||||||
modules/.vscode
|
modules/.vscode
|
||||||
|
.vimrc
|
||||||
|
.nvimrc
|
||||||
|
|
||||||
# Don't check in secret files
|
# Don't check in secret files
|
||||||
*secret.js
|
*secret.js
|
||||||
|
295
CHANGELOG.md
295
CHANGELOG.md
@ -1,25 +1,263 @@
|
|||||||
<a name="8.2.0-rc.0"></a>
|
<a name="9.0.0-next.5"></a>
|
||||||
# [8.2.0-rc.0](https://github.com/angular/angular/compare/8.2.0-next.2...8.2.0-rc.0) (2019-07-26)
|
# [9.0.0-next.5](https://github.com/angular/angular/compare/9.0.0-next.4...9.0.0-next.5) (2019-09-04)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **bazel:** increase memory limit of ngc under bazel from 2 to 4 GB ([#31784](https://github.com/angular/angular/issues/31784)) ([5a8eb92](https://github.com/angular/angular/commit/5a8eb92))
|
* **ivy:** add missing closure extern for \$localize ([#32460](https://github.com/angular/angular/issues/32460)) ([e8f9ba4](https://github.com/angular/angular/commit/e8f9ba4))
|
||||||
* **core:** allow Z variations of CSS transforms in sanitizer ([#29264](https://github.com/angular/angular/issues/29264)) ([78e7fdd](https://github.com/angular/angular/commit/78e7fdd))
|
* **ivy:** ensure binding ordering doesn't mess up when a `NO_CHANGE` value is encountered ([#32143](https://github.com/angular/angular/issues/32143)) ([7cc4225](https://github.com/angular/angular/commit/7cc4225))
|
||||||
* **elements:** handle falsy initial value ([#31604](https://github.com/angular/angular/issues/31604)) ([7151eae](https://github.com/angular/angular/commit/7151eae)), closes [angular/angular#30834](https://github.com/angular/angular/issues/30834)
|
* **ivy:** i18n - handle translated text containing HTML comments ([#32475](https://github.com/angular/angular/issues/32475)) ([5d8eb74](https://github.com/angular/angular/commit/5d8eb74))
|
||||||
* **platform-browser:** debug element query predicates not compatible with strictFunctionTypes ([#30993](https://github.com/angular/angular/issues/30993)) ([10a1e19](https://github.com/angular/angular/commit/10a1e19))
|
* **ivy:** ngcc - improve the "ngcc version changed" error message ([#32396](https://github.com/angular/angular/issues/32396)) ([d5101df](https://github.com/angular/angular/commit/d5101df))
|
||||||
|
* **ivy:** Prevent errors when querying for elements outside Angular context ([#32361](https://github.com/angular/angular/issues/32361)) ([260217a](https://github.com/angular/angular/commit/260217a))
|
||||||
|
* **language-service:** Create DirectiveKind enum ([#32376](https://github.com/angular/angular/issues/32376)) ([852afb3](https://github.com/angular/angular/commit/852afb3))
|
||||||
|
* **language-service:** Invalidate Reflector caches when program changes ([#32357](https://github.com/angular/angular/issues/32357)) ([97fc45f](https://github.com/angular/angular/commit/97fc45f))
|
||||||
|
* update all files/directories owned by DevInfra to new DevInfra Framework team alias ([#32247](https://github.com/angular/angular/issues/32247)) ([3758978](https://github.com/angular/angular/commit/3758978))
|
||||||
|
* **language-service:** re-add regressed templateUrl tests ([#32438](https://github.com/angular/angular/issues/32438)) ([1ed3531](https://github.com/angular/angular/commit/1ed3531)), closes [#32378](https://github.com/angular/angular/issues/32378)
|
||||||
|
* **language-service:** Use ts.CompletionEntry for completions ([#32375](https://github.com/angular/angular/issues/32375)) ([f6e88cd](https://github.com/angular/angular/commit/f6e88cd))
|
||||||
|
* **ngcc:** handle compilation diagnostics ([#31996](https://github.com/angular/angular/issues/31996)) ([f7471ee](https://github.com/angular/angular/commit/f7471ee)), closes [#31977](https://github.com/angular/angular/issues/31977)
|
||||||
|
* **common:** HttpParams fromObject accepts ReadonlyArray<string> ([#31072](https://github.com/angular/angular/issues/31072)) ([f5bec3f](https://github.com/angular/angular/commit/f5bec3f)), closes [#28452](https://github.com/angular/angular/issues/28452)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
* **bazel:** update to the latest `[@microsoft](https://github.com/microsoft)/api-extractor` ([#32185](https://github.com/angular/angular/issues/32185)) ([350ea47](https://github.com/angular/angular/commit/350ea47))
|
||||||
|
* **core:** Adds DI support for `providedIn: 'platform'|'any'` ([#32154](https://github.com/angular/angular/issues/32154)) ([77c382c](https://github.com/angular/angular/commit/77c382c))
|
||||||
|
* **core:** Introduce TestBed.inject to replace TestBed.get ([#32200](https://github.com/angular/angular/issues/32200)) ([3aba7eb](https://github.com/angular/angular/commit/3aba7eb)), closes [#26491](https://github.com/angular/angular/issues/26491) [#29905](https://github.com/angular/angular/issues/29905)
|
||||||
|
* **ivy:** implement `$localize()` global function ([#31609](https://github.com/angular/angular/issues/31609)) ([b21397b](https://github.com/angular/angular/commit/b21397b))
|
||||||
|
* **language-service:** add definitions for templateUrl ([#32238](https://github.com/angular/angular/issues/32238)) ([46caf88](https://github.com/angular/angular/commit/46caf88)), closes [angular/vscode-ng-language-service#111](https://github.com/angular/vscode-ng-language-service/issues/111)
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **core:** Make `PlatformLocation` tree-shakable ([#32154](https://github.com/angular/angular/issues/32154)) ([1537791](https://github.com/angular/angular/commit/1537791))
|
||||||
|
* **ivy:** add a micro benchmark for map-based style and class bindings ([#32401](https://github.com/angular/angular/issues/32401)) ([ba5e07e](https://github.com/angular/angular/commit/ba5e07e))
|
||||||
|
* **ivy:** add a micro benchmark for style and class bindings ([#32401](https://github.com/angular/angular/issues/32401)) ([df8e675](https://github.com/angular/angular/commit/df8e675))
|
||||||
|
* **ivy:** add element and text creation benchmark ([#32342](https://github.com/angular/angular/issues/32342)) ([85864ed](https://github.com/angular/angular/commit/85864ed))
|
||||||
|
* **ivy:** guard directive-related operations with a TNode flag ([#32445](https://github.com/angular/angular/issues/32445)) ([641c5c1](https://github.com/angular/angular/commit/641c5c1))
|
||||||
|
* **ivy:** properly initialise global state in the element_text_create benchmark ([#32397](https://github.com/angular/angular/issues/32397)) ([8dc3f36](https://github.com/angular/angular/commit/8dc3f36))
|
||||||
|
* **ivy:** remove renderStringify calls for text nodes creation ([#32342](https://github.com/angular/angular/issues/32342)) ([a1e91b0](https://github.com/angular/angular/commit/a1e91b0))
|
||||||
|
* **ivy:** remove repeated memory read / write in addComponentLogic ([#32339](https://github.com/angular/angular/issues/32339)) ([581b837](https://github.com/angular/angular/commit/581b837))
|
||||||
|
* **ivy:** run registerPostOrderHooks in the first template pass only ([#32342](https://github.com/angular/angular/issues/32342)) ([fac066e](https://github.com/angular/angular/commit/fac066e))
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* docs: create Issue and Pull Request markdown doc, explaining automatic locking policy ([#32405](https://github.com/angular/angular/issues/32405)) ([43619fc](https://github.com/angular/angular/commit/43619fc))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* **ivy:** This commit removes the public export of `hasBeenProcessed()`.
|
||||||
|
|
||||||
|
This was exported to be availble to the CLI integration but was never
|
||||||
|
used. The change to the function signature is a breaking change in itself
|
||||||
|
so we remove the function altogether to simplify and lower the public
|
||||||
|
API surface going forward.
|
||||||
|
* **core:** Injector.get now accepts abstract classes to return
|
||||||
|
type-safe values. Previous implementation returned `any` through the
|
||||||
|
deprecated implementation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="8.2.5"></a>
|
||||||
|
## [8.2.5](https://github.com/angular/angular/compare/8.2.4...8.2.5) (2019-09-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **common:** HttpParams fromObject accepts ReadonlyArray<string> ([#31072](https://github.com/angular/angular/issues/31072)) ([b3ea698](https://github.com/angular/angular/commit/b3ea698)), closes [#28452](https://github.com/angular/angular/issues/28452)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.0.0-next.4"></a>
|
||||||
|
# [9.0.0-next.4](https://github.com/angular/angular/compare/9.0.0-next.3...9.0.0-next.4) (2019-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ivy:** debug node names should match user declaration ([#32328](https://github.com/angular/angular/issues/32328)) ([14feb56](https://github.com/angular/angular/commit/14feb56))
|
||||||
|
* **ivy:** ngtsc throws if "flatModuleOutFile" is set to null ([#32235](https://github.com/angular/angular/issues/32235)) ([4f7c971](https://github.com/angular/angular/commit/4f7c971))
|
||||||
|
* **ivy:** reset binding index before executing a template in `refreshView` call ([#32201](https://github.com/angular/angular/issues/32201)) ([6b245a3](https://github.com/angular/angular/commit/6b245a3))
|
||||||
|
* **ngcc:** do not analyze dependencies for non Angular entry-points ([#32303](https://github.com/angular/angular/issues/32303)) ([e563d77](https://github.com/angular/angular/commit/e563d77)), closes [#32302](https://github.com/angular/angular/issues/32302)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **core:** add undecorated classes with decorated fields schematic ([#32130](https://github.com/angular/angular/issues/32130)) ([904a201](https://github.com/angular/angular/commit/904a201))
|
||||||
|
* **ivy:** use the schema registry to check DOM bindings ([#32171](https://github.com/angular/angular/issues/32171)) ([0677cf0](https://github.com/angular/angular/commit/0677cf0))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **ivy:** minimise writes to the lView[BINDING_INDEX] / binding root ([#32263](https://github.com/angular/angular/issues/32263)) ([e3422e0](https://github.com/angular/angular/commit/e3422e0))
|
||||||
|
* **ivy:** store binding metadata in the ngDevMode only ([#32317](https://github.com/angular/angular/issues/32317)) ([0874bf4](https://github.com/angular/angular/commit/0874bf4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="8.2.4"></a>
|
||||||
|
## [8.2.4](https://github.com/angular/angular/compare/8.2.3...8.2.4) (2019-08-28)
|
||||||
|
|
||||||
|
This release contains various API docs improvements.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.0.0-next.3"></a>
|
||||||
|
# [9.0.0-next.3](https://github.com/angular/angular/compare/9.0.0-next.2...9.0.0-next.3) (2019-08-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** pin `[@microsoft](https://github.com/microsoft)/api-extractor` ([#32187](https://github.com/angular/angular/issues/32187)) ([5da5ca5](https://github.com/angular/angular/commit/5da5ca5))
|
||||||
|
* **common:** update $locationShim to notify onChange listeners before emitting AngularJS events ([#32037](https://github.com/angular/angular/issues/32037)) ([5064dc7](https://github.com/angular/angular/commit/5064dc7))
|
||||||
|
* **compiler:** return enableIvy true when using `readConfiguration` ([#32234](https://github.com/angular/angular/issues/32234)) ([424ab48](https://github.com/angular/angular/commit/424ab48))
|
||||||
|
* **ivy:** get name directly from nativeNode ([#32198](https://github.com/angular/angular/issues/32198)) ([3dbc4ab](https://github.com/angular/angular/commit/3dbc4ab))
|
||||||
|
* **ivy:** handle empty bindings in template type checker ([#31594](https://github.com/angular/angular/issues/31594)) ([0db1b5d](https://github.com/angular/angular/commit/0db1b5d)), closes [#30076](https://github.com/angular/angular/issues/30076) [#30929](https://github.com/angular/angular/issues/30929)
|
||||||
|
* **ivy:** in ngcc, handle inline exports in commonjs code ([#32129](https://github.com/angular/angular/issues/32129)) ([02bab8c](https://github.com/angular/angular/commit/02bab8c))
|
||||||
|
* **ivy:** ngcc should only index .d.ts exports within the package ([#32129](https://github.com/angular/angular/issues/32129)) ([964d726](https://github.com/angular/angular/commit/964d726))
|
||||||
|
* **ivy:** ngTemplateOutlet error when switching between null and template value ([#32160](https://github.com/angular/angular/issues/32160)) ([c2868de](https://github.com/angular/angular/commit/c2868de)), closes [#32060](https://github.com/angular/angular/issues/32060)
|
||||||
|
* **ivy:** run template type-checking for all components ([#31952](https://github.com/angular/angular/issues/31952)) ([bfc26bc](https://github.com/angular/angular/commit/bfc26bc))
|
||||||
|
* **language-service:** Instantiate MetadataResolver once ([#32145](https://github.com/angular/angular/issues/32145)) ([6a0b1d5](https://github.com/angular/angular/commit/6a0b1d5))
|
||||||
|
* **language-service:** Remove 'context' used for module resolution ([#32015](https://github.com/angular/angular/issues/32015)) ([a91ab15](https://github.com/angular/angular/commit/a91ab15))
|
||||||
|
* **ngcc:** handle deep imports that already have an extension ([#32181](https://github.com/angular/angular/issues/32181)) ([4bbf16e](https://github.com/angular/angular/commit/4bbf16e)), closes [#32097](https://github.com/angular/angular/issues/32097)
|
||||||
|
* **ngcc:** ignore format properties that exist but are undefined ([#32205](https://github.com/angular/angular/issues/32205)) ([f8b995d](https://github.com/angular/angular/commit/f8b995d)), closes [#32052](https://github.com/angular/angular/issues/32052) [#32188](https://github.com/angular/angular/issues/32188)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **core:** add undecorated classes migration schematic ([#31650](https://github.com/angular/angular/issues/31650)) ([024c31d](https://github.com/angular/angular/commit/024c31d))
|
||||||
|
* **forms:** formControlName also accepts a number ([#30606](https://github.com/angular/angular/issues/30606)) ([628b0c1](https://github.com/angular/angular/commit/628b0c1))
|
||||||
|
* **compiler:** allow selector-less directives as base classes in View Engine ([#31379](https://github.com/angular/angular/issues/31379)) ([4055150](https://github.com/angular/angular/commit/4055150))
|
||||||
|
* **ivy:** support selector-less directive as base classes in Ivy ([#32125](https://github.com/angular/angular/issues/32125)) ([cfed0c0](https://github.com/angular/angular/commit/cfed0c0)), closes [#31379](https://github.com/angular/angular/issues/31379)
|
||||||
|
* **ivy:** make the Ivy compiler the default for ngc ([#32219](https://github.com/angular/angular/issues/32219)) ([ec4381d](https://github.com/angular/angular/commit/ec4381d))
|
||||||
|
* **ivy:** convert all ngtsc diagnostics to ts.Diagnostics ([#31952](https://github.com/angular/angular/issues/31952)) ([0287b23](https://github.com/angular/angular/commit/0287b23))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **core:** make sanitization tree-shakable in Ivy mode ([#31934](https://github.com/angular/angular/issues/31934)) ([2e4d17f](https://github.com/angular/angular/commit/2e4d17f))
|
||||||
|
* **ivy:** auto-call select(0) for non-empty views only ([#32131](https://github.com/angular/angular/issues/32131)) ([4d549f6](https://github.com/angular/angular/commit/4d549f6))
|
||||||
|
* **ivy:** avoid first template pass checks during view creation ([#32120](https://github.com/angular/angular/issues/32120)) ([4c3b791](https://github.com/angular/angular/commit/4c3b791))
|
||||||
|
* **ivy:** avoid for-of loops at runtime ([#32157](https://github.com/angular/angular/issues/32157)) ([abb44f7](https://github.com/angular/angular/commit/abb44f7))
|
||||||
|
* **ivy:** improve NaN checks in change detection ([#32212](https://github.com/angular/angular/issues/32212)) ([53bfa7c](https://github.com/angular/angular/commit/53bfa7c))
|
||||||
|
* **ivy:** interpolation micro-benchmark ([#32104](https://github.com/angular/angular/issues/32104)) ([be665d8](https://github.com/angular/angular/commit/be665d8))
|
||||||
|
* **ivy:** noop change detection micro-benchmark ([#32104](https://github.com/angular/angular/issues/32104)) ([c422c72](https://github.com/angular/angular/commit/c422c72))
|
||||||
|
* don't create holey arrays ([#32155](https://github.com/angular/angular/issues/32155)) ([6477057](https://github.com/angular/angular/commit/6477057))
|
||||||
|
* **ivy:** read selected index only when need in prop bindings ([#32212](https://github.com/angular/angular/issues/32212)) ([53f33c1](https://github.com/angular/angular/commit/53f33c1))
|
||||||
|
* **ivy:** split hooks processing into init and check phases ([#32131](https://github.com/angular/angular/issues/32131)) ([1062960](https://github.com/angular/angular/commit/1062960))
|
||||||
|
* **ivy:** split view processing into render (create) and refresh (update) pass ([#32020](https://github.com/angular/angular/issues/32020)) ([b9dfe66](https://github.com/angular/angular/commit/b9dfe66))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
Angular now compiles with Ivy by default ([#32219](https://github.com/angular/angular/issues/32219)) ([ec4381d](https://github.com/angular/angular/commit/ec4381d)).
|
||||||
|
|
||||||
|
If you aren't familiar with Ivy, read our [blog post about the Ivy preview](https://blog.angular.io/its-time-for-the-compatibility-opt-in-preview-of-ivy-38f3542a282f?gi=8bfeb44b05c) and see the list of changes [here](https://docs.google.com/document/d/1Dije0AsJ0PxL3NaeNPxpYDeapj30b_QC0xfeIvIIzgg/preview).
|
||||||
|
|
||||||
|
* **ivy:** make Hammer support tree-shakable. Previously, in Ivy applications, Hammer providers were included by default. With this commit, apps that want Hammer support must import `HammerModule`in their root module. ([#32203](https://github.com/angular/angular/issues/32203)) ([de8ebbd](https://github.com/angular/angular/commit/de8ebbd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="8.2.3"></a>
|
||||||
|
## [8.2.3](https://github.com/angular/angular/compare/8.2.2...8.2.3) (2019-08-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** pin `[@microsoft](https://github.com/microsoft)/api-extractor` ([#32187](https://github.com/angular/angular/issues/32187)) ([a7b9478](https://github.com/angular/angular/commit/a7b9478))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.0.0-next.2"></a>
|
||||||
|
# [9.0.0-next.2](https://github.com/angular/angular/compare/9.0.0-next.1...9.0.0-next.2) (2019-08-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** disable treeshaking when generating FESM and UMD bundles ([#32069](https://github.com/angular/angular/issues/32069)) ([4f37487](https://github.com/angular/angular/commit/4f37487))
|
||||||
|
* **compiler:** do not remove whitespace wrapping i18n expansions ([#31962](https://github.com/angular/angular/issues/31962)) ([0ddf0c4](https://github.com/angular/angular/commit/0ddf0c4))
|
||||||
|
* **ivy:** reuse compilation scope for incremental template changes. ([#31932](https://github.com/angular/angular/issues/31932)) ([eb5412d](https://github.com/angular/angular/commit/eb5412d)), closes [#31654](https://github.com/angular/angular/issues/31654)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **ivy:** don't read global state when interpolated values don't change ([#32093](https://github.com/angular/angular/issues/32093)) ([6eb9c2f](https://github.com/angular/angular/commit/6eb9c2f))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="8.2.2"></a>
|
||||||
|
## [8.2.2](https://github.com/angular/angular/compare/8.2.1...8.2.2) (2019-08-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** disable treeshaking when generating FESM and UMD bundles ([#32069](https://github.com/angular/angular/issues/32069)) ([3420d29](https://github.com/angular/angular/commit/3420d29))
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.0.0-next.1"></a>
|
||||||
|
# [9.0.0-next.1](https://github.com/angular/angular/compare/9.0.0-next.0...9.0.0-next.1) (2019-08-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **language-service:** getSourceFile() should only be called on TS files ([#31920](https://github.com/angular/angular/issues/31920)) ([e8b8f6d](https://github.com/angular/angular/commit/e8b8f6d))
|
||||||
|
* **language-service:** Make Definition and QuickInfo compatible with TS LS ([#31972](https://github.com/angular/angular/issues/31972)) ([a8e2ee1](https://github.com/angular/angular/commit/a8e2ee1))
|
||||||
|
* **upgrade:** compile downgraded components synchronously (if possible) ([#31840](https://github.com/angular/angular/issues/31840)) ([c1ae612](https://github.com/angular/angular/commit/c1ae612)), closes [#27217](https://github.com/angular/angular/issues/27217) [#30330](https://github.com/angular/angular/issues/30330)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="8.2.1"></a>
|
||||||
|
## [8.2.1](https://github.com/angular/angular/compare/8.2.0...8.2.1) (2019-08-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **upgrade:** compile downgraded components synchronously (if possible) ([#31840](https://github.com/angular/angular/issues/31840)) ([04ebd59](https://github.com/angular/angular/commit/04ebd59)), closes [#27217](https://github.com/angular/angular/issues/27217) [#30330](https://github.com/angular/angular/issues/30330)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.0.0-next.0"></a>
|
||||||
|
# [9.0.0-next.0](https://github.com/angular/angular/compare/8.2.0-next.2...9.0.0-next.0) (2019-07-31)
|
||||||
|
|
||||||
|
* Ivy related improvements and fixes
|
||||||
|
|
||||||
|
|
||||||
|
<a name="8.2.0"></a>
|
||||||
|
# [8.2.0](https://github.com/angular/angular/compare/8.2.0-rc.0...8.2.0) (2019-07-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **core:** TypeScript 3.5 support ([#31615](https://github.com/angular/angular/issues/31615)) ([6ece7db](https://github.com/angular/angular/commit/6ece7db))
|
||||||
|
* **core:** add automatic migration from Renderer to Renderer2 ([#30936](https://github.com/angular/angular/issues/30936)) ([c095597](https://github.com/angular/angular/commit/c095597))
|
||||||
* **bazel:** compile targets used for indexing by Kythe with Ivy ([#31786](https://github.com/angular/angular/issues/31786)) ([82055b2](https://github.com/angular/angular/commit/82055b2))
|
* **bazel:** compile targets used for indexing by Kythe with Ivy ([#31786](https://github.com/angular/angular/issues/31786)) ([82055b2](https://github.com/angular/angular/commit/82055b2))
|
||||||
* **upgrade:** support $element in upgraded component template/templateUrl functions ([#31637](https://github.com/angular/angular/issues/31637)) ([29e1c53](https://github.com/angular/angular/commit/29e1c53))
|
* **upgrade:** support $element in upgraded component template/templateUrl functions ([#31637](https://github.com/angular/angular/issues/31637)) ([29e1c53](https://github.com/angular/angular/commit/29e1c53))
|
||||||
|
* **bazel:** allow passing a custom bazel compiler host to ngc compile ([#31341](https://github.com/angular/angular/issues/31341)) ([a29dc96](https://github.com/angular/angular/commit/a29dc96))
|
||||||
|
* **bazel:** allow passing and rewriting an old bazel host ([#31381](https://github.com/angular/angular/issues/31381)) ([11a208f](https://github.com/angular/angular/commit/11a208f)), closes [#31341](https://github.com/angular/angular/issues/31341)
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|
||||||
* **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([24ca582](https://github.com/angular/angular/commit/24ca582)), closes [#31627](https://github.com/angular/angular/issues/31627)
|
* **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([24ca582](https://github.com/angular/angular/commit/24ca582)), closes [#31627](https://github.com/angular/angular/issues/31627)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **core:** DebugElement.listeners not cleared on destroy ([#31820](https://github.com/angular/angular/issues/31820)) ([46b160e](https://github.com/angular/angular/commit/46b160e))
|
||||||
|
* **bazel:** increase memory limit of ngc under bazel from 2 to 4 GB ([#31784](https://github.com/angular/angular/issues/31784)) ([5a8eb92](https://github.com/angular/angular/commit/5a8eb92))
|
||||||
|
* **core:** allow Z variations of CSS transforms in sanitizer ([#29264](https://github.com/angular/angular/issues/29264)) ([78e7fdd](https://github.com/angular/angular/commit/78e7fdd))
|
||||||
|
* **elements:** handle falsy initial value ([#31604](https://github.com/angular/angular/issues/31604)) ([7151eae](https://github.com/angular/angular/commit/7151eae)), closes [angular/angular#30834](https://github.com/angular/angular/issues/30834)
|
||||||
|
* **platform-browser:** debug element query predicates not compatible with strictFunctionTypes ([#30993](https://github.com/angular/angular/issues/30993)) ([10a1e19](https://github.com/angular/angular/commit/10a1e19))
|
||||||
|
* use the correct WTF array to iterate over ([#31208](https://github.com/angular/angular/issues/31208)) ([9204de9](https://github.com/angular/angular/commit/9204de9))
|
||||||
|
* **bazel:** pass custom bazel compiler host rather than rewriting one ([#31496](https://github.com/angular/angular/issues/31496)) ([0c61a35](https://github.com/angular/angular/commit/0c61a35))
|
||||||
|
* **compiler-cli:** Return original sourceFile instead of redirected sourceFile from getSourceFile ([#26036](https://github.com/angular/angular/issues/26036)) ([3166cff](https://github.com/angular/angular/commit/3166cff)), closes [#22524](https://github.com/angular/angular/issues/22524)
|
||||||
|
* **language-service:** Eagarly initialize data members ([#31577](https://github.com/angular/angular/issues/31577)) ([0110de2](https://github.com/angular/angular/commit/0110de2))
|
||||||
|
* **bazel:** revert location of xi18n outputs to bazel-genfiles ([#31410](https://github.com/angular/angular/issues/31410)) ([1d3e227](https://github.com/angular/angular/commit/1d3e227))
|
||||||
|
* **compiler:** give ASTWithSource its own visit method ([#31347](https://github.com/angular/angular/issues/31347)) ([6aaca21](https://github.com/angular/angular/commit/6aaca21))
|
||||||
|
* **core:** handle `undefined` meta in `injectArgs` ([#31333](https://github.com/angular/angular/issues/31333)) ([80ccd6c](https://github.com/angular/angular/commit/80ccd6c)), closes [CLI #14888](https://github.com/angular/angular-cli/issues/14888)
|
||||||
|
* **service-worker:** cache opaque responses in data groups with `freshness` strategy ([#30977](https://github.com/angular/angular/issues/30977)) ([d7be38f](https://github.com/angular/angular/commit/d7be38f)), closes [#30968](https://github.com/angular/angular/issues/30968)
|
||||||
|
* **service-worker:** cache opaque responses when requests exceeds timeout threshold ([#30977](https://github.com/angular/angular/issues/30977)) ([93abc35](https://github.com/angular/angular/commit/93abc35))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="8.1.3"></a>
|
<a name="8.1.3"></a>
|
||||||
## [8.1.3](https://github.com/angular/angular/compare/8.1.2...8.1.3) (2019-07-26)
|
## [8.1.3](https://github.com/angular/angular/compare/8.1.2...8.1.3) (2019-07-26)
|
||||||
@ -35,17 +273,6 @@
|
|||||||
* **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([1f3daa0](https://github.com/angular/angular/commit/1f3daa0)), closes [#31627](https://github.com/angular/angular/issues/31627)
|
* **compiler:** avoid copying from prototype while cloning an object ([#31638](https://github.com/angular/angular/issues/31638)) ([1f3daa0](https://github.com/angular/angular/commit/1f3daa0)), closes [#31627](https://github.com/angular/angular/issues/31627)
|
||||||
|
|
||||||
|
|
||||||
<a name="8.2.0-next.2"></a>
|
|
||||||
# [8.2.0-next.2](https://github.com/angular/angular/compare/8.2.0-next.1...8.2.0-next.2) (2019-07-17)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* use the correct WTF array to iterate over ([#31208](https://github.com/angular/angular/issues/31208)) ([9204de9](https://github.com/angular/angular/commit/9204de9))
|
|
||||||
* **bazel:** pass custom bazel compiler host rather than rewriting one ([#31496](https://github.com/angular/angular/issues/31496)) ([0c61a35](https://github.com/angular/angular/commit/0c61a35))
|
|
||||||
* **compiler-cli:** Return original sourceFile instead of redirected sourceFile from getSourceFile ([#26036](https://github.com/angular/angular/issues/26036)) ([3166cff](https://github.com/angular/angular/commit/3166cff)), closes [#22524](https://github.com/angular/angular/issues/22524)
|
|
||||||
* **language-service:** Eagarly initialize data members ([#31577](https://github.com/angular/angular/issues/31577)) ([0110de2](https://github.com/angular/angular/commit/0110de2))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="8.1.2"></a>
|
<a name="8.1.2"></a>
|
||||||
@ -59,23 +286,6 @@
|
|||||||
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
|
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="8.2.0-next.1"></a>
|
|
||||||
# [8.2.0-next.1](https://github.com/angular/angular/compare/8.2.0-next.0...8.2.0-next.1) (2019-07-10)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **bazel:** revert location of xi18n outputs to bazel-genfiles ([#31410](https://github.com/angular/angular/issues/31410)) ([1d3e227](https://github.com/angular/angular/commit/1d3e227))
|
|
||||||
* **compiler:** give ASTWithSource its own visit method ([#31347](https://github.com/angular/angular/issues/31347)) ([6aaca21](https://github.com/angular/angular/commit/6aaca21))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **core:** add automatic migration from Renderer to Renderer2 ([#30936](https://github.com/angular/angular/issues/30936)) ([c095597](https://github.com/angular/angular/commit/c095597))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="8.1.1"></a>
|
<a name="8.1.1"></a>
|
||||||
## [8.1.1](https://github.com/angular/angular/compare/8.1.0...8.1.1) (2019-07-10)
|
## [8.1.1](https://github.com/angular/angular/compare/8.1.0...8.1.1) (2019-07-10)
|
||||||
|
|
||||||
@ -85,23 +295,6 @@
|
|||||||
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
|
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com//github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com//github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
|
||||||
|
|
||||||
|
|
||||||
<a name="8.2.0-next.0"></a>
|
|
||||||
# [8.2.0-next.0](https://github.com/angular/angular/compare/8.1.0-rc.0...8.2.0-next.0) (2019-07-02)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **core:** handle `undefined` meta in `injectArgs` ([#31333](https://github.com/angular/angular/issues/31333)) ([80ccd6c](https://github.com/angular/angular/commit/80ccd6c)), closes [CLI #14888](https://github.com/angular/angular-cli/issues/14888)
|
|
||||||
* **service-worker:** cache opaque responses in data groups with `freshness` strategy ([#30977](https://github.com/angular/angular/issues/30977)) ([d7be38f](https://github.com/angular/angular/commit/d7be38f)), closes [#30968](https://github.com/angular/angular/issues/30968)
|
|
||||||
* **service-worker:** cache opaque responses when requests exceeds timeout threshold ([#30977](https://github.com/angular/angular/issues/30977)) ([93abc35](https://github.com/angular/angular/commit/93abc35))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **bazel:** allow passing a custom bazel compiler host to ngc compile ([#31341](https://github.com/angular/angular/issues/31341)) ([a29dc96](https://github.com/angular/angular/commit/a29dc96))
|
|
||||||
* **bazel:** allow passing and rewriting an old bazel host ([#31381](https://github.com/angular/angular/issues/31381)) ([11a208f](https://github.com/angular/angular/commit/11a208f)), closes [#31341](https://github.com/angular/angular/issues/31341)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="8.1.0"></a>
|
<a name="8.1.0"></a>
|
||||||
# [8.1.0](https://github.com/angular/angular/compare/8.1.0-rc.0...8.1.0) (2019-07-02)
|
# [8.1.0](https://github.com/angular/angular/compare/8.1.0-rc.0...8.1.0) (2019-07-02)
|
||||||
|
@ -233,6 +233,7 @@ There are currently a few exceptions to the "use package name" rule:
|
|||||||
* **docs-infra**: used for docs-app (angular.io) related changes within the /aio directory of the
|
* **docs-infra**: used for docs-app (angular.io) related changes within the /aio directory of the
|
||||||
repo
|
repo
|
||||||
* **ivy**: used for changes to the [Ivy renderer](https://github.com/angular/angular/issues/21706).
|
* **ivy**: used for changes to the [Ivy renderer](https://github.com/angular/angular/issues/21706).
|
||||||
|
* **ngcc**: used for changes to the [Angular Compatibility Compiler](./packages/compiler-cli/ngcc/README.md)
|
||||||
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all
|
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all
|
||||||
packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a
|
packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a
|
||||||
specific package (e.g. `docs: fix typo in tutorial`).
|
specific package (e.g. `docs: fix typo in tutorial`).
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
# Angular
|
# Angular
|
||||||
|
|
||||||
Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.
|
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
|
||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
|
17
WORKSPACE
17
WORKSPACE
@ -21,8 +21,8 @@ http_archive(
|
|||||||
patch_args = ["-p1"],
|
patch_args = ["-p1"],
|
||||||
# Patch https://github.com/bazelbuild/rules_nodejs/pull/903
|
# Patch https://github.com/bazelbuild/rules_nodejs/pull/903
|
||||||
patches = ["//tools:rollup_bundle_commonjs_ignoreGlobal.patch"],
|
patches = ["//tools:rollup_bundle_commonjs_ignoreGlobal.patch"],
|
||||||
sha256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4",
|
sha256 = "7c4a690268be97c96f04d505224ec4cb1ae53c2c2b68be495c9bd2634296a5cd",
|
||||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.2/rules_nodejs-0.32.2.tar.gz"],
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.34.0/rules_nodejs-0.34.0.tar.gz"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check the bazel version and download npm dependencies
|
# Check the bazel version and download npm dependencies
|
||||||
@ -53,7 +53,8 @@ Try running `yarn bazel` instead.
|
|||||||
# - 0.32.0 yarn_install and npm_install no longer puts build files under symlinked node_modules
|
# - 0.32.0 yarn_install and npm_install no longer puts build files under symlinked node_modules
|
||||||
# - 0.32.1 remove override of @bazel/tsetse & exclude typescript lib declarations in node_module_library transitive_declarations
|
# - 0.32.1 remove override of @bazel/tsetse & exclude typescript lib declarations in node_module_library transitive_declarations
|
||||||
# - 0.32.2 resolves bug in @bazel/hide-bazel-files postinstall step
|
# - 0.32.2 resolves bug in @bazel/hide-bazel-files postinstall step
|
||||||
check_rules_nodejs_version(minimum_version_string = "0.32.2")
|
# - 0.34.0 introduces protractor rule
|
||||||
|
check_rules_nodejs_version(minimum_version_string = "0.34.0")
|
||||||
|
|
||||||
# Setup the Node.js toolchain
|
# Setup the Node.js toolchain
|
||||||
node_repositories(
|
node_repositories(
|
||||||
@ -64,6 +65,9 @@ node_repositories(
|
|||||||
},
|
},
|
||||||
node_version = "10.16.0",
|
node_version = "10.16.0",
|
||||||
package_json = ["//:package.json"],
|
package_json = ["//:package.json"],
|
||||||
|
yarn_repositories = {
|
||||||
|
"1.17.3": ("yarn-v1.17.3.tar.gz", "yarn-v1.17.3", "e3835194409f1b3afa1c62ca82f561f1c29d26580c9e220c36866317e043c6f3"),
|
||||||
|
},
|
||||||
# yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds:
|
# yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds:
|
||||||
# ```
|
# ```
|
||||||
# ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty)
|
# ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty)
|
||||||
@ -72,7 +76,7 @@ node_repositories(
|
|||||||
# It possible that versions of yarn past 1.13.0 do not have this issue, however, before
|
# It possible that versions of yarn past 1.13.0 do not have this issue, however, before
|
||||||
# advancing this version we need to test manually on Windows that the above error does not
|
# advancing this version we need to test manually on Windows that the above error does not
|
||||||
# happen as the issue is not caught by CI.
|
# happen as the issue is not caught by CI.
|
||||||
yarn_version = "1.12.1",
|
yarn_version = "1.17.3",
|
||||||
)
|
)
|
||||||
|
|
||||||
yarn_install(
|
yarn_install(
|
||||||
@ -91,6 +95,11 @@ load("//packages/bazel:package.bzl", "rules_angular_dev_dependencies")
|
|||||||
|
|
||||||
rules_angular_dev_dependencies()
|
rules_angular_dev_dependencies()
|
||||||
|
|
||||||
|
# Load protractor dependencies
|
||||||
|
load("@npm_bazel_protractor//:package.bzl", "npm_bazel_protractor_dependencies")
|
||||||
|
|
||||||
|
npm_bazel_protractor_dependencies()
|
||||||
|
|
||||||
# Load karma dependencies
|
# Load karma dependencies
|
||||||
load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies")
|
load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies")
|
||||||
|
|
||||||
|
@ -14,10 +14,12 @@ Here are the most important tasks you might need to use:
|
|||||||
|
|
||||||
* `yarn` - install all the dependencies.
|
* `yarn` - install all the dependencies.
|
||||||
* `yarn setup` - install all the dependencies, boilerplate, stackblitz, zips and run dgeni on the docs.
|
* `yarn setup` - install all the dependencies, boilerplate, stackblitz, zips and run dgeni on the docs.
|
||||||
* `yarn setup-local` - same as `setup`, but use the locally built Angular packages for aio and docs examples boilerplate.
|
* `yarn setup-local` - same as `setup`, but build the Angular packages from the source code and use these locally built versions (instead of the ones fetched from npm) for aio and docs examples boilerplate.
|
||||||
|
|
||||||
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
|
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
|
||||||
* `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`.
|
* `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`.
|
||||||
|
* `yarn build-with-ivy` - same as `build-local`, but in addition also turns on `ivy` mode in aio.
|
||||||
|
(Note: To turn on `ivy` mode in examples, see `yarn boilerplate:add` below.)
|
||||||
|
|
||||||
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
||||||
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
||||||
@ -31,7 +33,10 @@ Here are the most important tasks you might need to use:
|
|||||||
* `yarn docs-lint` - check that the doc gen code follows our style rules.
|
* `yarn docs-lint` - check that the doc gen code follows our style rules.
|
||||||
* `yarn docs-test` - run the unit tests for the doc generation code.
|
* `yarn docs-test` - run the unit tests for the doc generation code.
|
||||||
|
|
||||||
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `--local` to use your local version of Angular contained in the "dist" folder.
|
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally.
|
||||||
|
- Add the option `--local` to use your local version of Angular contained in the "dist" folder.
|
||||||
|
- Add the option `--ivy` to turn on `ivy` mode.
|
||||||
|
|
||||||
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
|
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
|
||||||
* `yarn generate-stackblitz` - generate the stackblitz files that are used by the `live-example` tags in the docs.
|
* `yarn generate-stackblitz` - generate the stackblitz files that are used by the `live-example` tags in the docs.
|
||||||
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
|
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
|
||||||
@ -41,6 +46,15 @@ Here are the most important tasks you might need to use:
|
|||||||
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
|
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
|
||||||
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
|
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
|
||||||
|
|
||||||
|
> **Note for Windows users**
|
||||||
|
>
|
||||||
|
> Setting up the examples involves creating some [symbolic links](https://en.wikipedia.org/wiki/Symbolic_link) (see [here](./tools/examples/README.md#symlinked-node_modules) for details). On Windows, this requires to either have [Developer Mode enabled](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10) (supported on Windows 10 or newer) or run the setup commands as administrator.
|
||||||
|
>
|
||||||
|
> The affected commands are:
|
||||||
|
> - `yarn setup` / `yarn setup-*`
|
||||||
|
> - `yarn build` / `yarn build-*`
|
||||||
|
> - `yarn boilerplate:add`
|
||||||
|
> - `yarn example-e2e --setup`
|
||||||
|
|
||||||
## Using ServiceWorker locally
|
## Using ServiceWorker locally
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion imports
|
// #docregion imports
|
||||||
import { Component } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CartService } from '../cart.service';
|
import { CartService } from '../cart.service';
|
||||||
// #enddocregion imports
|
// #enddocregion imports
|
||||||
|
|
||||||
@ -10,12 +10,14 @@ import { CartService } from '../cart.service';
|
|||||||
styleUrls: ['./cart.component.css']
|
styleUrls: ['./cart.component.css']
|
||||||
})
|
})
|
||||||
// #docregion props-services, submit
|
// #docregion props-services, submit
|
||||||
export class CartComponent {
|
export class CartComponent implements OnInit {
|
||||||
items;
|
items;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private cartService: CartService
|
private cartService: CartService
|
||||||
) {
|
) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
this.items = this.cartService.getItems();
|
this.items = this.cartService.getItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion imports
|
// #docregion imports
|
||||||
import { Component } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { CartService } from '../cart.service';
|
import { CartService } from '../cart.service';
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
@ -11,7 +11,7 @@ import { CartService } from '../cart.service';
|
|||||||
styleUrls: ['./shipping.component.css']
|
styleUrls: ['./shipping.component.css']
|
||||||
})
|
})
|
||||||
// #docregion props, ctor
|
// #docregion props, ctor
|
||||||
export class ShippingComponent {
|
export class ShippingComponent implements OnInit {
|
||||||
shippingCosts;
|
shippingCosts;
|
||||||
// #enddocregion props
|
// #enddocregion props
|
||||||
|
|
||||||
@ -19,10 +19,12 @@ export class ShippingComponent {
|
|||||||
constructor(
|
constructor(
|
||||||
private cartService: CartService
|
private cartService: CartService
|
||||||
) {
|
) {
|
||||||
// #enddocregion inject-cart-service
|
|
||||||
this.shippingCosts = this.cartService.getShippingPrices();
|
|
||||||
// #docregion inject-cart-service
|
|
||||||
}
|
}
|
||||||
// #enddocregion inject-cart-service
|
// #enddocregion inject-cart-service
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.shippingCosts = this.cartService.getShippingPrices();
|
||||||
|
}
|
||||||
|
|
||||||
// #docregion props
|
// #docregion props
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<h1>HTTP Sample</h1>
|
<h1>HTTP Sample</h1>
|
||||||
<div>
|
<div>
|
||||||
<input type="checkbox" id="heroes" [checked]="toggleHeroes" (click)="toggleHeroes()">
|
<input type="checkbox" id="heroes" [checked]="showHeroes" (click)="toggleHeroes()">
|
||||||
<label for="heroes">Heroes</label>
|
<label for="heroes">Heroes</label>
|
||||||
|
|
||||||
<input type="checkbox" id="config" [checked]="showConfig" (click)="toggleConfig()">
|
<input type="checkbox" id="config" [checked]="showConfig" (click)="toggleConfig()">
|
||||||
|
@ -12,7 +12,7 @@ if (environment.production) {
|
|||||||
// use the require method provided by webpack
|
// use the require method provided by webpack
|
||||||
declare const require;
|
declare const require;
|
||||||
// we use the webpack raw-loader to return the content as a string
|
// we use the webpack raw-loader to return the content as a string
|
||||||
const translations = require(`raw-loader!./locale/messages.fr.xlf`);
|
const translations = require('raw-loader!./locale/messages.fr.xlf').default;
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule, {
|
platformBrowserDynamic().bootstrapModule(AppModule, {
|
||||||
providers: [
|
providers: [
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
import { browser, element, by } from 'protractor';
|
||||||
|
import { logging } from 'selenium-webdriver';
|
||||||
|
|
||||||
|
describe('Providers and ViewProviders', function () {
|
||||||
|
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
browser.get('');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows basic flower emoji', function() {
|
||||||
|
expect(element.all(by.css('p')).get(0).getText()).toContain('🌺');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows whale emoji', function() {
|
||||||
|
expect(element.all(by.css('p')).get(1).getText()).toContain('🐳');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows sunflower from FlowerService', function() {
|
||||||
|
expect(element.all(by.css('p')).get(8).getText()).toContain('🌻');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
10
aio/content/examples/providers-viewproviders/src/app/animal.service.ts
Executable file
10
aio/content/examples/providers-viewproviders/src/app/animal.service.ts
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
// #docregion animal-service
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class AnimalService {
|
||||||
|
emoji = '🐳';
|
||||||
|
}
|
||||||
|
// #enddocregion animal-service
|
@ -0,0 +1,15 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { FlowerService } from './flower.service';
|
||||||
|
import { AnimalService } from './animal.service';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrls: [ './app.component.css' ]
|
||||||
|
})
|
||||||
|
// #docregion injection
|
||||||
|
export class AppComponent {
|
||||||
|
constructor(public flower: FlowerService) {}
|
||||||
|
}
|
||||||
|
// #enddocregion injection
|
15
aio/content/examples/providers-viewproviders/src/app/app.component.html
Executable file
15
aio/content/examples/providers-viewproviders/src/app/app.component.html
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
<h2>From AppComponent:</h2>
|
||||||
|
<!-- #docregion binding-flower -->
|
||||||
|
<p>Emoji from FlowerService: {{flower.emoji}}</p>
|
||||||
|
<!-- #enddocregion binding-flower -->
|
||||||
|
<!-- #docregion binding-animal -->
|
||||||
|
<p>Emoji from AnimalService: {{animal.emoji}}</p>
|
||||||
|
<!-- #enddocregion binding-animal -->
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<h2>From ChildComponent:</h2>
|
||||||
|
<!-- #docregion content-projection -->
|
||||||
|
<app-child><app-inspector></app-inspector></app-child>
|
||||||
|
<!-- #enddocregion content-projection -->
|
15
aio/content/examples/providers-viewproviders/src/app/app.component.ts
Executable file
15
aio/content/examples/providers-viewproviders/src/app/app.component.ts
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { FlowerService } from './flower.service';
|
||||||
|
import { AnimalService } from './animal.service';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrls: [ './app.component.css' ]
|
||||||
|
})
|
||||||
|
// #docregion inject-animal-service
|
||||||
|
export class AppComponent {
|
||||||
|
constructor(public flower: FlowerService, public animal: AnimalService) {}
|
||||||
|
}
|
||||||
|
// #enddocregion inject-animal-service
|
17
aio/content/examples/providers-viewproviders/src/app/app.module.ts
Executable file
17
aio/content/examples/providers-viewproviders/src/app/app.module.ts
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { ChildComponent } from './child/child.component';
|
||||||
|
import { InspectorComponent } from './inspector/inspector.component';
|
||||||
|
|
||||||
|
// #docregion appmodule
|
||||||
|
@NgModule({
|
||||||
|
imports: [ BrowserModule, FormsModule ],
|
||||||
|
declarations: [ AppComponent, ChildComponent, InspectorComponent ],
|
||||||
|
bootstrap: [ AppComponent ],
|
||||||
|
providers: []
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
||||||
|
// #enddocregion appmodule
|
@ -0,0 +1,19 @@
|
|||||||
|
import { Component, OnInit, Host, SkipSelf, Optional } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
|
||||||
|
// #docregion flowerservice
|
||||||
|
@Component({
|
||||||
|
selector: 'app-child',
|
||||||
|
templateUrl: './child.component.html',
|
||||||
|
styleUrls: ['./child.component.css'],
|
||||||
|
// use the providers array to provide a service
|
||||||
|
providers: [{ provide: FlowerService, useValue: { emoji: '🌻' } }]
|
||||||
|
})
|
||||||
|
|
||||||
|
export class ChildComponent {
|
||||||
|
// inject the service
|
||||||
|
constructor( public flower: FlowerService) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
// #enddocregion flowerservice
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
.container {
|
||||||
|
border: 1px solid darkblue;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
<!-- #docplaster -->
|
||||||
|
<!-- #docregion child-component -->
|
||||||
|
<!-- #docregion flower-binding -->
|
||||||
|
<p>Emoji from FlowerService: {{flower.emoji}}</p>
|
||||||
|
<!-- #enddocregion flower-binding -->
|
||||||
|
<!-- #docregion animal-binding -->
|
||||||
|
<p>Emoji from AnimalService: {{animal.emoji}}</p>
|
||||||
|
<!-- #enddocregion animal-binding -->
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<h3>Content projection</h3>
|
||||||
|
<!-- #enddocregion child-component -->
|
||||||
|
<p>The following is coming from content. It doesn't get to see the puppy because the puppy is declared inside the view only.</p>
|
||||||
|
<!-- #docregion child-component -->
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Inside the view</h3>
|
||||||
|
<!-- #enddocregion child-component -->
|
||||||
|
<p>The following is inside the view so it does see the puppy.</p>
|
||||||
|
<!-- #docregion child-component -->
|
||||||
|
<app-inspector></app-inspector>
|
||||||
|
<!-- #enddocregion child-component -->
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
// #docplaster
|
||||||
|
import { Component, OnInit, Host, SkipSelf, Optional } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
import { AnimalService } from '../animal.service';
|
||||||
|
|
||||||
|
// #docregion provide-animal-service
|
||||||
|
@Component({
|
||||||
|
selector: 'app-child',
|
||||||
|
templateUrl: './child.component.html',
|
||||||
|
styleUrls: ['./child.component.css'],
|
||||||
|
// provide services
|
||||||
|
providers: [{ provide: FlowerService, useValue: { emoji: '🌻' } }],
|
||||||
|
viewProviders: [{ provide: AnimalService, useValue: { emoji: '🐶' } }]
|
||||||
|
})
|
||||||
|
|
||||||
|
export class ChildComponent {
|
||||||
|
// inject service
|
||||||
|
constructor( public flower: FlowerService, public animal: AnimalService) { }
|
||||||
|
// #enddocregion provide-animal-service
|
||||||
|
|
||||||
|
// viewProviders ensures that only the view gets to see this.
|
||||||
|
// With the AnimalService in the viewProviders, the
|
||||||
|
// InspectorComponent doesn't get to see it because the
|
||||||
|
// inspector is in the content.
|
||||||
|
|
||||||
|
|
||||||
|
// constructor( public flower: FlowerService, @Optional() @Host() public animal: AnimalService) { }
|
||||||
|
|
||||||
|
// Comment out the above constructor and alternately
|
||||||
|
// uncomment the two following constructors to see the
|
||||||
|
// effects of @Host() and @Host() + @SkipSelf().
|
||||||
|
|
||||||
|
// constructor(
|
||||||
|
// @Host() public animal : AnimalService,
|
||||||
|
// @Host() @Optional() public flower : FlowerService) { }
|
||||||
|
|
||||||
|
// constructor(
|
||||||
|
// @SkipSelf() @Host() public animal : AnimalService,
|
||||||
|
// @SkipSelf() @Host() @Optional() public flower : FlowerService) { }
|
||||||
|
|
||||||
|
// #docregion provide-animal-service
|
||||||
|
}
|
||||||
|
// #enddocregion provide-animal-service
|
||||||
|
|
11
aio/content/examples/providers-viewproviders/src/app/flower.service.ts
Executable file
11
aio/content/examples/providers-viewproviders/src/app/flower.service.ts
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
// #docregion flowerservice
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class FlowerService {
|
||||||
|
emoji = '🌺';
|
||||||
|
}
|
||||||
|
// #enddocregion flowerservice
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
<!-- #docregion binding -->
|
||||||
|
<p>Emoji from FlowerService: {{flower.emoji}}</p>
|
||||||
|
<p>Emoji from AnimalService: {{animal.emoji}}</p>
|
||||||
|
<!-- #enddocregion binding -->
|
@ -0,0 +1,14 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
import { AnimalService } from '../animal.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-inspector',
|
||||||
|
templateUrl: './inspector.component.html',
|
||||||
|
styleUrls: ['./inspector.component.css']
|
||||||
|
})
|
||||||
|
// #docregion injection
|
||||||
|
export class InspectorComponent {
|
||||||
|
constructor(public flower: FlowerService, public animal: AnimalService) { }
|
||||||
|
}
|
||||||
|
// #enddocregion injection
|
14
aio/content/examples/providers-viewproviders/src/index.html
Normal file
14
aio/content/examples/providers-viewproviders/src/index.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>providers vs. viewProviders</title>
|
||||||
|
<base href="/">
|
||||||
|
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
12
aio/content/examples/providers-viewproviders/src/main.ts
Normal file
12
aio/content/examples/providers-viewproviders/src/main.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||||
|
.catch(err => console.log(err));
|
10
aio/content/examples/providers-viewproviders/stackblitz.json
Normal file
10
aio/content/examples/providers-viewproviders/stackblitz.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"description": "Inputs and Outputs",
|
||||||
|
"files": [
|
||||||
|
"!**/*.d.ts",
|
||||||
|
"!**/*.js",
|
||||||
|
"!**/*.[1,2].*"
|
||||||
|
],
|
||||||
|
"file": "src/app/app.component.ts",
|
||||||
|
"tags": ["Inputs and Outputs"]
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
|
describe('Resolution-modifiers-example', function () {
|
||||||
|
|
||||||
|
beforeAll(function () {
|
||||||
|
browser.get('');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows basic flower emoji', function() {
|
||||||
|
expect(element.all(by.css('p')).get(0).getText()).toContain('🌸');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows basic leaf emoji', function() {
|
||||||
|
expect(element.all(by.css('p')).get(1).getText()).toContain('🌿');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows yellow flower in host child', function() {
|
||||||
|
expect(element.all(by.css('p')).get(9).getText()).toContain('🌼');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
0
aio/content/examples/resolution-modifiers/src/app/app.component.css
Executable file
0
aio/content/examples/resolution-modifiers/src/app/app.component.css
Executable file
14
aio/content/examples/resolution-modifiers/src/app/app.component.html
Executable file
14
aio/content/examples/resolution-modifiers/src/app/app.component.html
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
<h1>DI resolution modifiers</h1>
|
||||||
|
|
||||||
|
<p>Basic flower service: {{flower.emoji}}</p>
|
||||||
|
<p>Basic leaf service: {{leaf.emoji}}</p>
|
||||||
|
|
||||||
|
<app-optional></app-optional>
|
||||||
|
|
||||||
|
<app-self></app-self>
|
||||||
|
|
||||||
|
<app-self-no-data></app-self-no-data>
|
||||||
|
|
||||||
|
<app-skipself></app-skipself>
|
||||||
|
|
||||||
|
<app-host-parent></app-host-parent>
|
13
aio/content/examples/resolution-modifiers/src/app/app.component.ts
Executable file
13
aio/content/examples/resolution-modifiers/src/app/app.component.ts
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { LeafService } from './leaf.service';
|
||||||
|
import { FlowerService } from './flower.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styleUrls: [ './app.component.css' ]
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
name = 'Angular';
|
||||||
|
constructor(public flower: FlowerService, public leaf: LeafService) {}
|
||||||
|
}
|
33
aio/content/examples/resolution-modifiers/src/app/app.module.ts
Executable file
33
aio/content/examples/resolution-modifiers/src/app/app.module.ts
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
;
|
||||||
|
import { OptionalComponent } from './optional/optional.component';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { SelfNoDataComponent } from './self-no-data/self-no-data.component';
|
||||||
|
import { HostComponent } from './host/host.component';
|
||||||
|
import { SelfComponent } from './self/self.component';
|
||||||
|
import { SkipselfComponent } from './skipself/skipself.component';
|
||||||
|
import { HostParentComponent } from './host-parent/host-parent.component';
|
||||||
|
import { HostChildComponent } from './host-child/host-child.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
FormsModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
AppComponent,
|
||||||
|
OptionalComponent,
|
||||||
|
SelfComponent,
|
||||||
|
SelfNoDataComponent,
|
||||||
|
HostComponent,
|
||||||
|
SkipselfComponent,
|
||||||
|
HostParentComponent,
|
||||||
|
HostChildComponent
|
||||||
|
],
|
||||||
|
bootstrap: [AppComponent],
|
||||||
|
providers: []
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
9
aio/content/examples/resolution-modifiers/src/app/flower.service.ts
Executable file
9
aio/content/examples/resolution-modifiers/src/app/flower.service.ts
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root' // provide this service in the root ModuleInjector
|
||||||
|
|
||||||
|
})
|
||||||
|
export class FlowerService {
|
||||||
|
emoji = '🌸';
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>Child of @Host() Component</h2>
|
||||||
|
<p>Flower emoji: {{flower.emoji}}</p>
|
||||||
|
</div>
|
@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-host-child',
|
||||||
|
templateUrl: './host-child.component.html',
|
||||||
|
styleUrls: ['./host-child.component.css']
|
||||||
|
})
|
||||||
|
export class HostChildComponent {
|
||||||
|
constructor(public flower: FlowerService) { }
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>Parent of @Host() Component</h2>
|
||||||
|
<p>Flower emoji: {{flower.emoji}}</p>
|
||||||
|
<app-host></app-host>
|
||||||
|
</div>
|
@ -0,0 +1,16 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-host-parent',
|
||||||
|
templateUrl: './host-parent.component.html',
|
||||||
|
styleUrls: ['./host-parent.component.css'],
|
||||||
|
providers: [{ provide: FlowerService, useValue: { emoji: '🌺' } }]
|
||||||
|
|
||||||
|
})
|
||||||
|
export class HostParentComponent {
|
||||||
|
|
||||||
|
constructor(public flower: FlowerService) { }
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>@Host() Component</h2>
|
||||||
|
<p>Flower emoji: {{flower.emoji}}</p>
|
||||||
|
<p><i>(@Host() stops it here)</i></p>
|
||||||
|
<app-host-child></app-host-child>
|
||||||
|
</div>
|
21
aio/content/examples/resolution-modifiers/src/app/host/host.component.ts
Executable file
21
aio/content/examples/resolution-modifiers/src/app/host/host.component.ts
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
import { Component, Host, Optional } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
|
||||||
|
// #docregion host-component
|
||||||
|
@Component({
|
||||||
|
selector: 'app-host',
|
||||||
|
templateUrl: './host.component.html',
|
||||||
|
styleUrls: ['./host.component.css'],
|
||||||
|
// provide the service
|
||||||
|
providers: [{ provide: FlowerService, useValue: { emoji: '🌼' } }]
|
||||||
|
})
|
||||||
|
export class HostComponent {
|
||||||
|
// use @Host() in the constructor when injecting the service
|
||||||
|
constructor(@Host() @Optional() public flower: FlowerService) { }
|
||||||
|
|
||||||
|
}
|
||||||
|
// #enddocregion host-component
|
||||||
|
|
||||||
|
// if you take out @Host() and the providers array, flower will be red hibiscus
|
||||||
|
|
||||||
|
|
11
aio/content/examples/resolution-modifiers/src/app/leaf.service.ts
Executable file
11
aio/content/examples/resolution-modifiers/src/app/leaf.service.ts
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
// #docregion leafservice
|
||||||
|
export class LeafService {
|
||||||
|
emoji = '🌿';
|
||||||
|
}
|
||||||
|
// #enddocregion leafservice
|
||||||
|
|
7
aio/content/examples/resolution-modifiers/src/app/optional.service.ts
Executable file
7
aio/content/examples/resolution-modifiers/src/app/optional.service.ts
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class OptionalService {
|
||||||
|
}
|
||||||
|
|
||||||
|
// This service isn't provided anywhere.
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>@Optional() Component</h2>
|
||||||
|
<p>This component still works even though the OptionalService (notice @Optional() in the consturctor isn't provided or configured anywhere. Angular goes through tree and visibilty rules, and if it doesn't find the requested service, returns null.</p>
|
||||||
|
</div>
|
@ -0,0 +1,21 @@
|
|||||||
|
import { Component, Optional } from '@angular/core';
|
||||||
|
import { OptionalService } from '../optional.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-optional',
|
||||||
|
templateUrl: './optional.component.html',
|
||||||
|
styleUrls: ['./optional.component.css']
|
||||||
|
})
|
||||||
|
|
||||||
|
// #docregion optional-component
|
||||||
|
export class OptionalComponent {
|
||||||
|
constructor(@Optional() public optional: OptionalService) {}
|
||||||
|
}
|
||||||
|
// #enddocregion optional-component
|
||||||
|
|
||||||
|
// The OptionalService isn't provided here, in the @Injectable()
|
||||||
|
// providers array, or in the NgModule. If you remove @Optional()
|
||||||
|
// from the constructor, you'll get an error.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>@Self() Component (without a provider)</h2>
|
||||||
|
<p>Leaf emoji: {{leaf?.emoji}}</p>
|
||||||
|
</div>
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Component, Self, Optional } from '@angular/core';
|
||||||
|
import { LeafService } from '../leaf.service';
|
||||||
|
|
||||||
|
// #docregion self-no-data-component
|
||||||
|
@Component({
|
||||||
|
selector: 'app-self-no-data',
|
||||||
|
templateUrl: './self-no-data.component.html',
|
||||||
|
styleUrls: ['./self-no-data.component.css']
|
||||||
|
})
|
||||||
|
export class SelfNoDataComponent {
|
||||||
|
constructor(@Self() @Optional() public leaf: LeafService) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
// #enddocregion self-no-data-component
|
||||||
|
|
||||||
|
// The app doesn't break because the value being available at self is optional.
|
||||||
|
// If you remove @Optional(), the app breaks.
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>@Self() Component</h2>
|
||||||
|
<p>Flower emoji: {{flower?.emoji}}</p>
|
||||||
|
</div>
|
19
aio/content/examples/resolution-modifiers/src/app/self/self.component.ts
Executable file
19
aio/content/examples/resolution-modifiers/src/app/self/self.component.ts
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
import { Component, Self } from '@angular/core';
|
||||||
|
import { FlowerService } from '../flower.service';
|
||||||
|
|
||||||
|
// #docregion self-component
|
||||||
|
@Component({
|
||||||
|
selector: 'app-self',
|
||||||
|
templateUrl: './self.component.html',
|
||||||
|
styleUrls: ['./self.component.css'],
|
||||||
|
providers: [{ provide: FlowerService, useValue: { emoji: '🌼' } }]
|
||||||
|
|
||||||
|
})
|
||||||
|
export class SelfComponent {
|
||||||
|
constructor(@Self() public flower: FlowerService) {}
|
||||||
|
}
|
||||||
|
// #enddocregion self-component
|
||||||
|
|
||||||
|
// This component provides the FlowerService so the injector
|
||||||
|
// doesn't have to look further up the injector tree
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
.section {
|
||||||
|
border: 2px solid #369;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
<div class="section">
|
||||||
|
<h2>@SkipSelf() Component</h2>
|
||||||
|
<p>Leaf emoji: {{leaf.emoji}}</p>
|
||||||
|
</div>
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Component, SkipSelf } from '@angular/core';
|
||||||
|
import { LeafService } from '../leaf.service';
|
||||||
|
|
||||||
|
// #docregion skipself-component
|
||||||
|
@Component({
|
||||||
|
selector: 'app-skipself',
|
||||||
|
templateUrl: './skipself.component.html',
|
||||||
|
styleUrls: ['./skipself.component.css'],
|
||||||
|
// Angular would ignore this LeafService instance
|
||||||
|
providers: [{ provide: LeafService, useValue: { emoji: '🍁' } }]
|
||||||
|
})
|
||||||
|
export class SkipselfComponent {
|
||||||
|
// Use @SkipSelf() in the constructor
|
||||||
|
constructor(@SkipSelf() public leaf: LeafService) { }
|
||||||
|
}
|
||||||
|
// #enddocregion skipself-component
|
||||||
|
|
||||||
|
// @SkipSelf(): Specifies that the dependency resolution should start from the parent injector, not here.
|
14
aio/content/examples/resolution-modifiers/src/index.html
Normal file
14
aio/content/examples/resolution-modifiers/src/index.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>DI Resolution Modifiers Example</title>
|
||||||
|
<base href="/">
|
||||||
|
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root>Loading...</app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
11
aio/content/examples/resolution-modifiers/src/main.ts
Normal file
11
aio/content/examples/resolution-modifiers/src/main.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
10
aio/content/examples/resolution-modifiers/stackblitz.json
Normal file
10
aio/content/examples/resolution-modifiers/stackblitz.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"description": "NgModules",
|
||||||
|
"files": [
|
||||||
|
"!**/*.d.ts",
|
||||||
|
"!**/*.js",
|
||||||
|
"!**/*.[1,2].*"
|
||||||
|
],
|
||||||
|
"file": "src/app/app.component.ts",
|
||||||
|
"tags": ["NgModules"]
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"description": "Quickstart AppComponent Testing",
|
|
||||||
"files":[
|
|
||||||
"src/browser-test-shim.js",
|
|
||||||
"src/app/app.component.ts",
|
|
||||||
"src/app/app.component.spec.ts",
|
|
||||||
"src/quickstart-specs.html"
|
|
||||||
],
|
|
||||||
"main": "src/quickstart-specs.html",
|
|
||||||
"file": "src/app/app.component.spec.ts",
|
|
||||||
"tags": ["quickstart", "setup", "testing"]
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
<!-- Run application specs in a browser -->
|
|
||||||
<!-- #docregion -->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<base href="/">
|
|
||||||
<title>1st Specs</title>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
<link rel="stylesheet" href="node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<!-- Polyfills -->
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
|
|
||||||
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
|
|
||||||
<script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<script src="node_modules/zone.js/dist/zone-testing.js"></script>
|
|
||||||
|
|
||||||
<!-- #docregion files -->
|
|
||||||
<script>
|
|
||||||
var __spec_files__ = [
|
|
||||||
'app/app.component.spec'
|
|
||||||
];
|
|
||||||
</script>
|
|
||||||
<!-- #enddocregion files-->
|
|
||||||
<script src="browser-test-shim.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"description": "QuickStart Setup",
|
|
||||||
"files": [
|
|
||||||
"src/app/app.component.ts",
|
|
||||||
"src/app/app.module.ts",
|
|
||||||
"src/index.html",
|
|
||||||
"src/main.ts",
|
|
||||||
"src/styles.css"
|
|
||||||
],
|
|
||||||
"file": "src/app/app.component.ts",
|
|
||||||
"tags": ["quickstart", "setup", "seed"]
|
|
||||||
}
|
|
@ -12,7 +12,7 @@ import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
|
|||||||
* then the templated elements are removed removed from the DOM,
|
* then the templated elements are removed removed from the DOM,
|
||||||
* the templated elements are (re)inserted into the DOM.
|
* the templated elements are (re)inserted into the DOM.
|
||||||
*
|
*
|
||||||
* <div *ngUnless="errorCount" class="success">
|
* <div *appUnless="errorCount" class="success">
|
||||||
* Congrats! Everything is great!
|
* Congrats! Everything is great!
|
||||||
* </div>
|
* </div>
|
||||||
*
|
*
|
||||||
|
@ -1,24 +1,22 @@
|
|||||||
{
|
{
|
||||||
"description": "Testing - specs",
|
"description": "Testing - specs",
|
||||||
"files":[
|
"files":[
|
||||||
|
"src/expected.ts",
|
||||||
|
"src/index-specs.html",
|
||||||
|
"src/main-specs.ts",
|
||||||
"src/styles.css",
|
"src/styles.css",
|
||||||
|
"src/test.css",
|
||||||
|
"src/tests.sb.ts",
|
||||||
|
|
||||||
|
"e2e/src/**/*.ts",
|
||||||
|
|
||||||
"src/app/**/*.css",
|
"src/app/**/*.css",
|
||||||
"src/app/**/*.html",
|
"src/app/**/*.html",
|
||||||
"src/app/**/*.ts",
|
"src/app/**/*.ts",
|
||||||
"src/app/**/*.spec.ts",
|
|
||||||
|
|
||||||
"src/testing/*.ts",
|
"src/testing/**/*",
|
||||||
|
|
||||||
"!src/main.ts",
|
"src/**/*.spec.ts"
|
||||||
"!src/app/bag/*.*",
|
|
||||||
"!src/app/1st.spec.ts",
|
|
||||||
|
|
||||||
"src/expected.ts",
|
|
||||||
"src/test.css",
|
|
||||||
"src/tests.sb.ts",
|
|
||||||
"src/main-specs.ts",
|
|
||||||
"src/index-specs.html"
|
|
||||||
],
|
],
|
||||||
"main": "src/index-specs.html",
|
"main": "src/index-specs.html",
|
||||||
"tags": ["testing"]
|
"tags": ["testing"]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
const jasmineRequire = require('jasmine-core/lib/jasmine-core/jasmine.js');
|
import jasmineRequire from 'jasmine-core/lib/jasmine-core/jasmine.js';
|
||||||
|
|
||||||
window['jasmineRequire'] = jasmineRequire;
|
window['jasmineRequire'] = jasmineRequire;
|
||||||
|
@ -1,19 +1,18 @@
|
|||||||
{
|
{
|
||||||
"description": "Heroes Test App",
|
"description": "Heroes Test App",
|
||||||
"files":[
|
"files":[
|
||||||
|
"src/index.html",
|
||||||
|
"src/main.ts",
|
||||||
"src/styles.css",
|
"src/styles.css",
|
||||||
|
"src/test.css",
|
||||||
|
|
||||||
|
"e2e/src/**/*.ts",
|
||||||
|
|
||||||
"src/app/**/*.css",
|
"src/app/**/*.css",
|
||||||
"src/app/**/*.html",
|
"src/app/**/*.html",
|
||||||
"src/app/**/*.ts",
|
"src/app/**/*.ts",
|
||||||
|
|
||||||
"!src/app/bag/*.*",
|
"!src/**/*.spec.ts"
|
||||||
|
|
||||||
"!src/test.ts",
|
|
||||||
|
|
||||||
"src/test.css",
|
|
||||||
"src/main.ts",
|
|
||||||
"src/index.html"
|
|
||||||
],
|
],
|
||||||
"tags": ["testing"]
|
"tags": ["testing"]
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"lib": [ "es2015", "dom" ],
|
"lib": [
|
||||||
|
"es2015",
|
||||||
|
"dom"
|
||||||
|
],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"suppressImplicitAnyIndexErrors": true
|
"suppressImplicitAnyIndexErrors": true
|
||||||
@ -16,5 +19,8 @@
|
|||||||
"node_modules/*",
|
"node_modules/*",
|
||||||
"**/*-aot.ts",
|
"**/*-aot.ts",
|
||||||
"aot/**/*"
|
"aot/**/*"
|
||||||
]
|
],
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableIvy": false
|
||||||
|
}
|
||||||
}
|
}
|
@ -19,6 +19,7 @@
|
|||||||
],
|
],
|
||||||
|
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"skipMetadataEmit" : true
|
"skipMetadataEmit" : true,
|
||||||
|
"enableIvy": false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"lib": [ "es2015", "dom" ],
|
"lib": [
|
||||||
|
"es2015",
|
||||||
|
"dom"
|
||||||
|
],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"suppressImplicitAnyIndexErrors": true
|
"suppressImplicitAnyIndexErrors": true
|
||||||
@ -15,5 +18,8 @@
|
|||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules/*",
|
"node_modules/*",
|
||||||
"**/*-aot.ts"
|
"**/*-aot.ts"
|
||||||
]
|
],
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableIvy": false
|
||||||
|
}
|
||||||
}
|
}
|
@ -6,7 +6,10 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"lib": [ "es2015", "dom" ],
|
"lib": [
|
||||||
|
"es2015",
|
||||||
|
"dom"
|
||||||
|
],
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"suppressImplicitAnyIndexErrors": true
|
"suppressImplicitAnyIndexErrors": true
|
||||||
@ -15,5 +18,8 @@
|
|||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules/*",
|
"node_modules/*",
|
||||||
"**/*-aot.ts"
|
"**/*-aot.ts"
|
||||||
]
|
],
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableIvy": false
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,5 +13,8 @@
|
|||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"compileOnSave": true
|
"compileOnSave": true,
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableIvy": false
|
||||||
|
}
|
||||||
}
|
}
|
@ -99,7 +99,7 @@ The following example shows how to make a simple progress bar accessible by usin
|
|||||||
|
|
||||||
// Sets the minimum and maximum values for the progressbar role.
|
// Sets the minimum and maximum values for the progressbar role.
|
||||||
'aria-valuemin': '0',
|
'aria-valuemin': '0',
|
||||||
'aria-valuemax': '0',
|
'aria-valuemax': '100',
|
||||||
|
|
||||||
// Binding that updates the current value of the progressbar.
|
// Binding that updates the current value of the progressbar.
|
||||||
'[attr.aria-valuenow]': 'value',
|
'[attr.aria-valuenow]': 'value',
|
||||||
@ -179,3 +179,8 @@ Books
|
|||||||
* "A Web for Everyone: Designing Accessible User Experiences", Sarah Horton and Whitney Quesenbery
|
* "A Web for Everyone: Designing Accessible User Experiences", Sarah Horton and Whitney Quesenbery
|
||||||
|
|
||||||
* "Inclusive Design Patterns", Heydon Pickering
|
* "Inclusive Design Patterns", Heydon Pickering
|
||||||
|
|
||||||
|
## More on accessibility
|
||||||
|
|
||||||
|
You may also be interested in the following:
|
||||||
|
* [Audit your Angular app's accessibility with codelyzer](https://web.dev/accessible-angular-with-codelyzer/).
|
||||||
|
179
aio/content/guide/angular-compiler-options.md
Normal file
179
aio/content/guide/angular-compiler-options.md
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
# Angular compiler options
|
||||||
|
|
||||||
|
When you use [AoT compilation](guide/aot-compiler), you can control how your application is compiled by specifying *template* compiler options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration).
|
||||||
|
|
||||||
|
The template options object, `angularCompilerOptions`, is a sibling to the `compilerOptions` object that supplies standard options to the TypeScript compiler.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"fullTemplateTypeCheck": true,
|
||||||
|
"preserveWhitespaces": true,
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
{@a tsconfig-extends}
|
||||||
|
## Configuration inheritance with extends
|
||||||
|
|
||||||
|
Like the TypeScript compiler, The Angular AoT compiler also supports `extends` in the `angularCompilerOptions` section of the TypeScript configuration file, `tsconfig.json`.
|
||||||
|
The `extends` property is at the top level, parallel to `compilerOptions` and `angularCompilerOptions`.
|
||||||
|
|
||||||
|
A TypeScript configuration can inherit settings from another file using the `extends` property.
|
||||||
|
The configuration options from the base file are loaded first, then overridden by those in the inheriting `tsconfig` file.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"extends": "../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
...
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"fullTemplateTypeCheck": true,
|
||||||
|
"preserveWhitespaces": true,
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For more informaton, see the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
|
||||||
|
|
||||||
|
## Template options
|
||||||
|
|
||||||
|
The following options are available for configuring the AoT template compiler.
|
||||||
|
|
||||||
|
### `allowEmptyCodegenFiles`
|
||||||
|
|
||||||
|
When true, generate all possible files even if they are empty. Default is false. Used by the Bazel build rules to simplify how Bazel rules track file dependencies. Do not use this option outside of the Bazel rules.
|
||||||
|
|
||||||
|
### `annotationsAs`
|
||||||
|
|
||||||
|
Modifies how Angular-specific annotations are emitted to improve tree-shaking. Non-Angular annotations are not affected. One of `static fields` (the default) or `decorators`.
|
||||||
|
|
||||||
|
* By default, the compiler replaces decorators with a static field in the class, which allows advanced tree-shakers like [Closure compiler](https://github.com/google/closure-compiler) to remove unused classes.
|
||||||
|
|
||||||
|
* The `decorators` value leaves the decorators in place, which makes compilation faster. TypeScript emits calls to the` __decorate` helper. Use `--emitDecoratorMetadata` for runtime reflection (but note that the resulting code will not properly tree-shake.
|
||||||
|
|
||||||
|
### `annotateForClosureCompiler`
|
||||||
|
|
||||||
|
When true, use [Tsickle](https://github.com/angular/tsickle) to annotate the emitted JavaScript with [JSDoc](http://usejsdoc.org/) comments needed by the
|
||||||
|
[Closure Compiler](https://github.com/google/closure-compiler). Default is false.
|
||||||
|
|
||||||
|
### `disableExpressionLowering`
|
||||||
|
|
||||||
|
When true (the default), transforms code that is or could be used in an annotation, to allow it to be imported from template factory modules. See [metadata rewriting](guide/aot-compiler#metadata-rewriting) for more information.
|
||||||
|
|
||||||
|
When `false`, disables this rewriting, requiring the rewriting to be done manually.
|
||||||
|
|
||||||
|
### `disableTypeScriptVersionCheck`
|
||||||
|
|
||||||
|
When `true`, the compiler does not check the TypeScript version and does not report an error when an unsupported version of TypeScript is used. Not recommended, as unsupported versions of TypeScript might have undefined behavior. Default is false.
|
||||||
|
|
||||||
|
### `enableResourceInlining`
|
||||||
|
|
||||||
|
When true, replaces the `templateUrl` and `styleUrls` property in all `@Component` decorators with inlined contents in `template` and `styles` properties.
|
||||||
|
|
||||||
|
When enabled, the `.js` output of `ngc` does not include any lazy-loaded template or style URLs.
|
||||||
|
|
||||||
|
|
||||||
|
{@a enablelegacytemplate}
|
||||||
|
|
||||||
|
### `enableLegacyTemplate`
|
||||||
|
|
||||||
|
When true, enables use of the `<template>` element, which was deprecated in Angular 4.0, in favor of `<ng-template>` (to avoid colliding with the DOM's element of the same name). Default is false. Might be required by some third-party Angular libraries.
|
||||||
|
|
||||||
|
### `flatModuleId`
|
||||||
|
|
||||||
|
The module ID to use for importing a flat module (when `flatModuleOutFile` is true). References generated by the template compiler use this module name when importing symbols
|
||||||
|
from the flat module. Ignored if `flatModuleOutFile` is false.
|
||||||
|
|
||||||
|
### `flatModuleOutFile`
|
||||||
|
|
||||||
|
When true, generates a flat module index of the given file name and the corresponding flat module metadata. Use to create flat modules that are packaged similarly to `@angular/core` and `@angular/common`. When this option is used, the `package.json` for the library should refer
|
||||||
|
to the generated flat module index instead of the library index file.
|
||||||
|
|
||||||
|
Produces only one `.metadata.json` file, which contains all the metadata necessary
|
||||||
|
for symbols exported from the library index. In the generated `.ngfactory.js` files, the flat
|
||||||
|
module index is used to import symbols that includes both the public API from the library index
|
||||||
|
as well as shrowded internal symbols.
|
||||||
|
|
||||||
|
By default the `.ts` file supplied in the `files` field is assumed to be the library index.
|
||||||
|
If more than one `.ts` file is specified, `libraryIndex` is used to select the file to use.
|
||||||
|
If more than one `.ts` file is supplied without a `libraryIndex`, an error is produced.
|
||||||
|
|
||||||
|
A flat module index `.d.ts` and `.js` is created with the given `flatModuleOutFile` name in the same location as the library index `.d.ts` file.
|
||||||
|
|
||||||
|
For example, if a library uses the `public_api.ts` file as the library index of the module, the `tsconfig.json` `files` field would be `["public_api.ts"]`.
|
||||||
|
The `flatModuleOutFile` options could then be set to (for example) `"index.js"`, which produces `index.d.ts` and `index.metadata.json` files.
|
||||||
|
The `module` field of the library's `package.json` would be `"index.js"` and the `typings` field
|
||||||
|
would be `"index.d.ts"`.
|
||||||
|
|
||||||
|
### `fullTemplateTypeCheck`
|
||||||
|
|
||||||
|
When true (recommended), enables the [binding expression validation](guide/aot-compiler#binding-expression-validation) phase of the template compiler, which uses TypeScript to validate binding expressions.
|
||||||
|
|
||||||
|
Default is currently false.
|
||||||
|
|
||||||
|
### `generateCodeForLibraries`
|
||||||
|
|
||||||
|
When true (the default), generates factory files (`.ngfactory.js` and `.ngstyle.js`)
|
||||||
|
for `.d.ts` files with a corresponding `.metadata.json` file.
|
||||||
|
|
||||||
|
When false, factory files are generated only for `.ts` files. Do this when using factory summaries.
|
||||||
|
|
||||||
|
|
||||||
|
### `preserveWhitespaces`
|
||||||
|
|
||||||
|
When false (the default), removes blank text nodes from compiled templates, which results in smaller emitted template factory modules. Set to true to preserve blank text nodes.
|
||||||
|
|
||||||
|
### `skipMetadataEmit`
|
||||||
|
|
||||||
|
When true, does not to produce `.metadata.json` files. Default is `false`.
|
||||||
|
|
||||||
|
The `.metadata.json` files contain information needed by the template compiler from a `.ts`
|
||||||
|
file that is not included in the `.d.ts` file produced by the TypeScript compiler.
|
||||||
|
This information includes, for example, the content of annotations (such as a component's template), which TypeScript emits to the `.js` file but not to the `.d.ts` file.
|
||||||
|
|
||||||
|
You can set to `true` when using factory summaries, because the factory summaries
|
||||||
|
include a copy of the information that is in the `.metadata.json` file.
|
||||||
|
|
||||||
|
Set to `true` if you are using TypeScript's `--outFile` option, because the metadata files
|
||||||
|
are not valid for this style of TypeScript output. However, we do not recommend using `--outFile` with Angular. Use a bundler, such as [webpack](https://webpack.js.org/), instead.
|
||||||
|
|
||||||
|
### `skipTemplateCodegen`
|
||||||
|
|
||||||
|
When true, does not emit `.ngfactory.js` and `.ngstyle.js` files. This turns off most of the template compiler and disables the reporting of template diagnostics.
|
||||||
|
|
||||||
|
Can be used to instruct the template compiler to produce `.metadata.json` files for distribution with an `npm` package while avoiding the production of `.ngfactory.js` and `.ngstyle.js` files that cannot be distributed to `npm`.
|
||||||
|
|
||||||
|
### `strictMetadataEmit`
|
||||||
|
|
||||||
|
When true, reports an error to the `.metadata.json` file if `"skipMetadataEmit"` is `false`.
|
||||||
|
Default is false. Use only when `"skipMetadataEmit"` is false and `"skipTemplateCodeGen"` is true.
|
||||||
|
|
||||||
|
This option is intended to validate the `.metadata.json` files emitted for bundling with an `npm` package. The validation is strict and can emit errors for metadata that would never produce an error when used by the template compiler. You can choose to suppress the error emitted by this option for an exported symbol by including `@dynamic` in the comment documenting the symbol.
|
||||||
|
|
||||||
|
It is valid for `.metadata.json` files to contain errors.
|
||||||
|
The template compiler reports these errors if the metadata is used to determine the contents of an annotation.
|
||||||
|
The metadata collector cannot predict the symbols that are designed for use in an annotation, so it preemptively includes error nodes in the metadata for the exported symbols.
|
||||||
|
The template compiler can then use the error nodes to report an error if these symbols are used.
|
||||||
|
|
||||||
|
If the client of a library intends to use a symbol in an annotation, the template compiler does not normally report this until the client uses the symbol.
|
||||||
|
This option allows detection of these errors during the build phase of
|
||||||
|
the library and is used, for example, in producing Angular libraries themselves.
|
||||||
|
|
||||||
|
### `strictInjectionParameters`
|
||||||
|
|
||||||
|
When true (recommended), reports an error for a supplied parameter whose injection type cannot be determined. When false (currently the default), constructor parameters of classes marked with `@Injectable` whose type cannot be resolved produce a warning.
|
||||||
|
|
||||||
|
### `trace`
|
||||||
|
|
||||||
|
When true, prints extra information while compiling templates. Default is false.
|
@ -128,7 +128,7 @@ The third argument, `easing`, controls how the animation [accelerates and decele
|
|||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
**Note:** See the Angular Material Design website's topic on [Natural easing curves](https://material.io/design/motion/speed.html#easing) for general information on easing curves.
|
**Note:** See the Material Design website's topic on [Natural easing curves](https://material.io/design/motion/speed.html#easing) for general information on easing curves.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
This example provides a state transition from `open` to `closed` with a one second transition between states.
|
This example provides a state transition from `open` to `closed` with a one second transition between states.
|
||||||
@ -260,7 +260,7 @@ What it does
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>state()</code></td>
|
<td><code><a href="api/animations/state" class="code-anchor">state()</a></code></td>
|
||||||
<td>Creates a named set of CSS styles that should be applied on successful transition to a given state. The state can then be referenced by name within other animation functions.</td>
|
<td>Creates a named set of CSS styles that should be applied on successful transition to a given state. The state can then be referenced by name within other animation functions.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ What it does
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>group()</code></td>
|
<td><code><a href="api/animations/group" class="code-anchor">group()</a></code></td>
|
||||||
<td>Specifies a group of animation steps (<em>inner animations</em>) to be run in parallel. Animation continues only after all inner animation steps have completed. Used within <code>sequence()</code> or <code>transition().</code></td>
|
<td>Specifies a group of animation steps (<em>inner animations</em>) to be run in parallel. Animation continues only after all inner animation steps have completed. Used within <code>sequence()</code> or <code>transition().</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
540
aio/content/guide/aot-metadata-errors.md
Normal file
540
aio/content/guide/aot-metadata-errors.md
Normal file
@ -0,0 +1,540 @@
|
|||||||
|
# AoT metadata errors
|
||||||
|
|
||||||
|
The following are metadata errors you may encounter, with explanations and suggested corrections.
|
||||||
|
|
||||||
|
[Expression form not supported](#expression-form-not-supported)<br>
|
||||||
|
[Reference to a local (non-exported) symbol](#reference-to-a-local-symbol)<br>
|
||||||
|
[Only initialized variables and constants](#only-initialized-variables)<br>
|
||||||
|
[Reference to a non-exported class](#reference-to-a-non-exported-class)<br>
|
||||||
|
[Reference to a non-exported function](#reference-to-a-non-exported-function)<br>
|
||||||
|
[Function calls are not supported](#function-calls-not-supported)<br>
|
||||||
|
[Destructured variable or constant not supported](#destructured-variable-not-supported)<br>
|
||||||
|
[Could not resolve type](#could-not-resolve-type)<br>
|
||||||
|
[Name expected](#name-expected)<br>
|
||||||
|
[Unsupported enum member name](#unsupported-enum-member-name)<br>
|
||||||
|
[Tagged template expressions are not supported](#tagged-template-expressions-not-supported)<br>
|
||||||
|
[Symbol reference expected](#symbol-reference-expected)<br>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a expression-form-not-supported}
|
||||||
|
## Expression form not supported
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
*The compiler encountered an expression it didn't understand while evaluating Angular metadata.*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Language features outside of the compiler's [restricted expression syntax](guide/aot-compiler#expression-syntax)
|
||||||
|
can produce this error, as seen in the following example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
export class Fooish { ... }
|
||||||
|
...
|
||||||
|
const prop = typeof Fooish; // typeof is not valid in metadata
|
||||||
|
...
|
||||||
|
// bracket notation is not valid in metadata
|
||||||
|
{ provide: 'token', useValue: { [prop]: 'value' } };
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
You can use `typeof` and bracket notation in normal application code.
|
||||||
|
You just can't use those features within expressions that define Angular metadata.
|
||||||
|
|
||||||
|
Avoid this error by sticking to the compiler's [restricted expression syntax](guide/aot-compiler#expression-syntax)
|
||||||
|
when writing Angular metadata
|
||||||
|
and be wary of new or unusual TypeScript features.
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a reference-to-a-local-symbol}
|
||||||
|
## Reference to a local (non-exported) symbol
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
_Reference to a local (non-exported) symbol 'symbol name'. Consider exporting the symbol._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
The compiler encountered a referenced to a locally defined symbol that either wasn't exported or wasn't initialized.
|
||||||
|
|
||||||
|
Here's a `provider` example of the problem.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
let foo: number; // neither exported nor initialized
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-component',
|
||||||
|
template: ... ,
|
||||||
|
providers: [
|
||||||
|
{ provide: Foo, useValue: foo }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class MyComponent {}
|
||||||
|
```
|
||||||
|
The compiler generates the component factory, which includes the `useValue` provider code, in a separate module. _That_ factory module can't reach back to _this_ source module to access the local (non-exported) `foo` variable.
|
||||||
|
|
||||||
|
You could fix the problem by initializing `foo`.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
let foo = 42; // initialized
|
||||||
|
```
|
||||||
|
|
||||||
|
The compiler will [fold](guide/aot-compiler#code-folding) the expression into the provider as if you had written this.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
providers: [
|
||||||
|
{ provide: Foo, useValue: 42 }
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can fix it by exporting `foo` with the expectation that `foo` will be assigned at runtime when you actually know its value.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
export let foo: number; // exported
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-component',
|
||||||
|
template: ... ,
|
||||||
|
providers: [
|
||||||
|
{ provide: Foo, useValue: foo }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class MyComponent {}
|
||||||
|
```
|
||||||
|
|
||||||
|
Adding `export` often works for variables referenced in metadata such as `providers` and `animations` because the compiler can generate _references_ to the exported variables in these expressions. It doesn't need the _values_ of those variables.
|
||||||
|
|
||||||
|
Adding `export` doesn't work when the compiler needs the _actual value_
|
||||||
|
in order to generate code.
|
||||||
|
For example, it doesn't work for the `template` property.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
export let someTemplate: string; // exported but not initialized
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-component',
|
||||||
|
template: someTemplate
|
||||||
|
})
|
||||||
|
export class MyComponent {}
|
||||||
|
```
|
||||||
|
|
||||||
|
The compiler needs the value of the `template` property _right now_ to generate the component factory.
|
||||||
|
The variable reference alone is insufficient.
|
||||||
|
Prefixing the declaration with `export` merely produces a new error, "[`Only initialized variables and constants can be referenced`](#only-initialized-variables)".
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a only-initialized-variables}
|
||||||
|
## Only initialized variables and constants
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
_Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
The compiler found a reference to an exported variable or static field that wasn't initialized.
|
||||||
|
It needs the value of that variable to generate code.
|
||||||
|
|
||||||
|
The following example tries to set the component's `template` property to the value of
|
||||||
|
the exported `someTemplate` variable which is declared but _unassigned_.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
export let someTemplate: string;
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-component',
|
||||||
|
template: someTemplate
|
||||||
|
})
|
||||||
|
export class MyComponent {}
|
||||||
|
```
|
||||||
|
|
||||||
|
You'd also get this error if you imported `someTemplate` from some other module and neglected to initialize it there.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR - not initialized there either
|
||||||
|
import { someTemplate } from './config';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-component',
|
||||||
|
template: someTemplate
|
||||||
|
})
|
||||||
|
export class MyComponent {}
|
||||||
|
```
|
||||||
|
|
||||||
|
The compiler cannot wait until runtime to get the template information.
|
||||||
|
It must statically derive the value of the `someTemplate` variable from the source code
|
||||||
|
so that it can generate the component factory, which includes
|
||||||
|
instructions for building the element based on the template.
|
||||||
|
|
||||||
|
To correct this error, provide the initial value of the variable in an initializer clause _on the same line_.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
export let someTemplate = '<h1>Greetings from Angular</h1>';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-component',
|
||||||
|
template: someTemplate
|
||||||
|
})
|
||||||
|
export class MyComponent {}
|
||||||
|
```
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a reference-to-a-non-exported-class}
|
||||||
|
## Reference to a non-exported class
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
_Reference to a non-exported class <class name>. Consider exporting the class._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Metadata referenced a class that wasn't exported.
|
||||||
|
|
||||||
|
For example, you may have defined a class and used it as an injection token in a providers array
|
||||||
|
but neglected to export that class.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
abstract class MyStrategy { }
|
||||||
|
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: MyStrategy, useValue: ... }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
Angular generates a class factory in a separate module and that
|
||||||
|
factory [can only access exported classes](guide/aot-compiler#exported-symbols).
|
||||||
|
To correct this error, export the referenced class.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
export abstract class MyStrategy { }
|
||||||
|
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: MyStrategy, useValue: ... }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a reference-to-a-non-exported-function}
|
||||||
|
## Reference to a non-exported function
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
*Metadata referenced a function that wasn't exported.*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
For example, you may have set a providers `useFactory` property to a locally defined function that you neglected to export.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
function myStrategy() { ... }
|
||||||
|
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: MyStrategy, useFactory: myStrategy }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
Angular generates a class factory in a separate module and that
|
||||||
|
factory [can only access exported functions](guide/aot-compiler#exported-symbols).
|
||||||
|
To correct this error, export the function.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
export function myStrategy() { ... }
|
||||||
|
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: MyStrategy, useFactory: myStrategy }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a function-calls-not-supported}
|
||||||
|
## Function calls are not supported
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
_Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
The compiler does not currently support [function expressions or lambda functions](guide/aot-compiler#function-expression).
|
||||||
|
For example, you cannot set a provider's `useFactory` to an anonymous function or arrow function like this.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: MyStrategy, useFactory: function() { ... } },
|
||||||
|
{ provide: OtherStrategy, useFactory: () => { ... } }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
You also get this error if you call a function or method in a provider's `useValue`.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
import { calculateValue } from './utilities';
|
||||||
|
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: SomeValue, useValue: calculateValue() }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
To correct this error, export a function from the module and refer to the function in a `useFactory` provider instead.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
import { calculateValue } from './utilities';
|
||||||
|
|
||||||
|
export function myStrategy() { ... }
|
||||||
|
export function otherStrategy() { ... }
|
||||||
|
export function someValueFactory() {
|
||||||
|
return calculateValue();
|
||||||
|
}
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: MyStrategy, useFactory: myStrategy },
|
||||||
|
{ provide: OtherStrategy, useFactory: otherStrategy },
|
||||||
|
{ provide: SomeValue, useFactory: someValueFactory }
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a destructured-variable-not-supported}
|
||||||
|
## Destructured variable or constant not supported
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
_Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
The compiler does not support references to variables assigned by [destructuring](https://www.typescriptlang.org/docs/handbook/variable-declarations.html#destructuring).
|
||||||
|
|
||||||
|
For example, you cannot write something like this:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
import { configuration } from './configuration';
|
||||||
|
|
||||||
|
// destructured assignment to foo and bar
|
||||||
|
const {foo, bar} = configuration;
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{provide: Foo, useValue: foo},
|
||||||
|
{provide: Bar, useValue: bar},
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
To correct this error, refer to non-destructured values.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
import { configuration } from './configuration';
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{provide: Foo, useValue: configuration.foo},
|
||||||
|
{provide: Bar, useValue: configuration.bar},
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a could-not-resolve-type}
|
||||||
|
## Could not resolve type
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
*The compiler encountered a type and can't determine which module exports that type.*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
This can happen if you refer to an ambient type.
|
||||||
|
For example, the `Window` type is an ambient type declared in the global `.d.ts` file.
|
||||||
|
|
||||||
|
You'll get an error if you reference it in the component constructor,
|
||||||
|
which the compiler must statically analyze.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
@Component({ })
|
||||||
|
export class MyComponent {
|
||||||
|
constructor (private win: Window) { ... }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
TypeScript understands ambient types so you don't import them.
|
||||||
|
The Angular compiler does not understand a type that you neglect to export or import.
|
||||||
|
|
||||||
|
In this case, the compiler doesn't understand how to inject something with the `Window` token.
|
||||||
|
|
||||||
|
Do not refer to ambient types in metadata expressions.
|
||||||
|
|
||||||
|
If you must inject an instance of an ambient type,
|
||||||
|
you can finesse the problem in four steps:
|
||||||
|
|
||||||
|
1. Create an injection token for an instance of the ambient type.
|
||||||
|
1. Create a factory function that returns that instance.
|
||||||
|
1. Add a `useFactory` provider with that factory function.
|
||||||
|
1. Use `@Inject` to inject the instance.
|
||||||
|
|
||||||
|
Here's an illustrative example.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
import { Inject } from '@angular/core';
|
||||||
|
|
||||||
|
export const WINDOW = new InjectionToken('Window');
|
||||||
|
export function _window() { return window; }
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: WINDOW, useFactory: _window }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class MyComponent {
|
||||||
|
constructor (@Inject(WINDOW) private win: Window) { ... }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `Window` type in the constructor is no longer a problem for the compiler because it
|
||||||
|
uses the `@Inject(WINDOW)` to generate the injection code.
|
||||||
|
|
||||||
|
Angular does something similar with the `DOCUMENT` token so you can inject the browser's `document` object (or an abstraction of it, depending upon the platform in which the application runs).
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { Inject } from '@angular/core';
|
||||||
|
import { DOCUMENT } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
@Component({ ... })
|
||||||
|
export class MyComponent {
|
||||||
|
constructor (@Inject(DOCUMENT) private doc: Document) { ... }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a name-expected}
|
||||||
|
## Name expected
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
*The compiler expected a name in an expression it was evaluating.*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
This can happen if you use a number as a property name as in the following example.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
provider: [{ provide: Foo, useValue: { 0: 'test' } }]
|
||||||
|
```
|
||||||
|
|
||||||
|
Change the name of the property to something non-numeric.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// CORRECTED
|
||||||
|
provider: [{ provide: Foo, useValue: { '0': 'test' } }]
|
||||||
|
```
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a unsupported-enum-member-name}
|
||||||
|
## Unsupported enum member name
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
*Angular couldn't determine the value of the [enum member](https://www.typescriptlang.org/docs/handbook/enums.html) that you referenced in metadata.*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
The compiler can understand simple enum values but not complex values such as those derived from computed properties.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
enum Colors {
|
||||||
|
Red = 1,
|
||||||
|
White,
|
||||||
|
Blue = "Blue".length // computed
|
||||||
|
}
|
||||||
|
|
||||||
|
...
|
||||||
|
providers: [
|
||||||
|
{ provide: BaseColor, useValue: Colors.White } // ok
|
||||||
|
{ provide: DangerColor, useValue: Colors.Red } // ok
|
||||||
|
{ provide: StrongColor, useValue: Colors.Blue } // bad
|
||||||
|
]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
Avoid referring to enums with complicated initializers or computed properties.
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a tagged-template-expressions-not-supported}
|
||||||
|
## Tagged template expressions are not supported
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
_Tagged template expressions are not supported in metadata._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
The compiler encountered a JavaScript ES2015 [tagged template expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) such as the following.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// ERROR
|
||||||
|
const expression = 'funky';
|
||||||
|
const raw = String.raw`A tagged template ${expression} string`;
|
||||||
|
...
|
||||||
|
template: '<div>' + raw + '</div>'
|
||||||
|
...
|
||||||
|
```
|
||||||
|
[`String.raw()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw)
|
||||||
|
is a _tag function_ native to JavaScript ES2015.
|
||||||
|
|
||||||
|
The AoT compiler does not support tagged template expressions; avoid them in metadata expressions.
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{@a symbol-reference-expected}
|
||||||
|
## Symbol reference expected
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
*The compiler expected a reference to a symbol at the location specified in the error message.*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
This error can occur if you use an expression in the `extends` clause of a class.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](https://github.com/angular/angular/pull/17712#discussion_r132025495).
|
||||||
|
|
||||||
|
-->
|
@ -21,11 +21,10 @@ For an existing application, you have to manually add the `RouterModule` and def
|
|||||||
Use the CLI to automatically create the app shell.
|
Use the CLI to automatically create the app shell.
|
||||||
|
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
ng generate app-shell --client-project my-app --universal-project server-app
|
ng generate app-shell --client-project my-app
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
* `my-app` takes the name of your client application.
|
* `client-project` takes the name of your client application.
|
||||||
* `server-app` takes the name of the Universal (or server) application.
|
|
||||||
|
|
||||||
After running this command you will notice that the `angular.json` configuration file has been updated to add two new targets, with a few other changes.
|
After running this command you will notice that the `angular.json` configuration file has been updated to add two new targets, with a few other changes.
|
||||||
|
|
||||||
@ -44,6 +43,12 @@ After running this command you will notice that the `angular.json` configuration
|
|||||||
"browserTarget": "my-app:build",
|
"browserTarget": "my-app:build",
|
||||||
"serverTarget": "my-app:server",
|
"serverTarget": "my-app:server",
|
||||||
"route": "shell"
|
"route": "shell"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "my-app:build:production",
|
||||||
|
"serverTarget": "my-app:server:production"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</code-example>
|
</code-example>
|
||||||
@ -56,4 +61,12 @@ Use the CLI to build the `app-shell` target.
|
|||||||
ng run my-app:app-shell
|
ng run my-app:app-shell
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
Or to use the production configuration.
|
||||||
|
|
||||||
|
<code-example language="bash">
|
||||||
|
ng run my-app:app-shell:production
|
||||||
|
</code-example>
|
||||||
|
|
||||||
To verify the build output, open `dist/my-app/index.html`. Look for default text `app-shell works!` to show that the app shell route was rendered as part of the output.
|
To verify the build output, open `dist/my-app/index.html`. Look for default text `app-shell works!` to show that the app shell route was rendered as part of the output.
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ Angular supports most recent browsers. This includes the following specific vers
|
|||||||
IE
|
IE
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
11, 10, 9
|
11, 10, 9 ("compatibility view" mode not supported)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -214,14 +214,17 @@ Each budget entry is a JSON object with the following properties:
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>type</td>
|
<td>type</td>
|
||||||
<td>The type of budget. One of:
|
<td>
|
||||||
|
|
||||||
* bundle - The size of a specific bundle.
|
The type of budget. One of:
|
||||||
* initial - The initial size of the app.
|
|
||||||
* allScript - The size of all scripts.
|
* `bundle` - The size of a specific bundle.
|
||||||
* all - The size of the entire app.
|
* `initial` - The initial size of the app.
|
||||||
* anyScript - The size of any one script.
|
* `allScript` - The size of all scripts.
|
||||||
* any - The size of any file.
|
* `all` - The size of the entire app.
|
||||||
|
* `anyComponentStyle` - This size of any one component stylesheet.
|
||||||
|
* `anyScript` - The size of any one script.
|
||||||
|
* `any` - The size of any file.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -253,7 +253,7 @@ In the `package.json` file, add a `builders` key that tells the Architect tool w
|
|||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
The official name of our builder is now ` @example/command-runner:command`.
|
The official name of our builder is now ` @example/command-runner:command`.
|
||||||
The first part of this is the package name (resolved using node resolution), and the second part is the builder name (resolved using the `builder.json` file).
|
The first part of this is the package name (resolved using node resolution), and the second part is the builder name (resolved using the `builders.json` file).
|
||||||
|
|
||||||
Using one of our `options` is very straightforward, we did this in the previous section when we accessed `options.command`.
|
Using one of our `options` is very straightforward, we did this in the previous section when we accessed `options.command`.
|
||||||
|
|
||||||
@ -419,7 +419,6 @@ We need to update the `angular.json` file to add a target for this builder to th
|
|||||||
"projects": {
|
"projects": {
|
||||||
"builder-test": {
|
"builder-test": {
|
||||||
"architect": {
|
"architect": {
|
||||||
"builder-test": {
|
|
||||||
"touch": {
|
"touch": {
|
||||||
"builder": "@example/command-runner:command",
|
"builder": "@example/command-runner:command",
|
||||||
"options": {
|
"options": {
|
||||||
@ -428,7 +427,6 @@ We need to update the `angular.json` file to add a target for this builder to th
|
|||||||
"src/main.ts"
|
"src/main.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
@ -497,14 +495,14 @@ The test uses the builder to run the `ls` command, then validates that it ran su
|
|||||||
|
|
||||||
<code-example language="typescript">
|
<code-example language="typescript">
|
||||||
|
|
||||||
import { Architect, ArchitectHost } from '@angular-devkit/architect';
|
import { Architect } from '@angular-devkit/architect';
|
||||||
import { TestingArchitectHost } from '@angular-devkit/architect/testing';
|
import { TestingArchitectHost } from '@angular-devkit/architect/testing';
|
||||||
// Our builder forwards the STDOUT of the command to the logger.
|
// Our builder forwards the STDOUT of the command to the logger.
|
||||||
import { logging, schema } from '@angular-devkit/core';
|
import { logging, schema } from '@angular-devkit/core';
|
||||||
|
|
||||||
describe('Command Runner Builder', () => {
|
describe('Command Runner Builder', () => {
|
||||||
let architect: Architect;
|
let architect: Architect;
|
||||||
let architectHost: ArchitectHost;
|
let architectHost: TestingArchitectHost;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const registry = new schema.CoreSchemaRegistry();
|
const registry = new schema.CoreSchemaRegistry();
|
||||||
|
@ -30,7 +30,7 @@ The Filter/Stagger tab in the live example shows a list of heroes with an introd
|
|||||||
|
|
||||||
The following example demonstrates how to use `query()` and `stagger()` functions on the entry of an animated element.
|
The following example demonstrates how to use `query()` and `stagger()` functions on the entry of an animated element.
|
||||||
|
|
||||||
* Use `query()` to look for any element entering or leaving the page. The query specifies elements meeting certain CSS class criteria.
|
* Use `query()` to look for an element entering the page that meets certain criteria.
|
||||||
|
|
||||||
* For each of these elements, use `style()` to set the same initial style for the element. Make it invisible and use `transform` to move it out of position so that it can slide into place.
|
* For each of these elements, use `style()` to set the same initial style for the element. Make it invisible and use `transform` to move it out of position so that it can slide into place.
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ The `@NgModule()` and `@Component()` decorators have the `providers` metadata op
|
|||||||
|
|
||||||
Components are directives, and the `providers` option is inherited from `@Directive()`. You can also configure providers for directives and pipes at the same level as the component.
|
Components are directives, and the `providers` option is inherited from `@Directive()`. You can also configure providers for directives and pipes at the same level as the component.
|
||||||
|
|
||||||
Learn more about [where to configure providers](guide/hierarchical-dependency-injection#where-to-register).
|
Learn more about [where to configure providers](guide/hierarchical-dependency-injection).
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ When you are ready to deploy your Angular application to a remote server, you ha
|
|||||||
|
|
||||||
## Simple deployment options
|
## Simple deployment options
|
||||||
|
|
||||||
Before fully deploying your application, you can test the process, build configuration, and deployed behavior by using one of these interim techniques
|
Before fully deploying your application, you can test the process, build configuration, and deployed behavior by using one of these interim techniques.
|
||||||
|
|
||||||
### Building and serving from disk
|
### Building and serving from disk
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ You will need two terminals to get the live-reload experience.
|
|||||||
|
|
||||||
<code-example language="none" class="code-shell">
|
<code-example language="none" class="code-shell">
|
||||||
|
|
||||||
lite-server --baseDir="dist"
|
lite-server --baseDir="dist/project-name"
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -53,6 +53,35 @@ This method is for development and testing only, and is not a supported or secur
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
### Automatic deployment with the CLI
|
||||||
|
|
||||||
|
The Angular CLI command `ng deploy` (introduced in version 8.3.0) executes the `deploy` [CLI builder](https://angular.io/guide/cli-builder) associated with your project. A number of third-party builders implement deployment capabilities to different platforms. You can add any of them to your project by running `ng add [package name]`.
|
||||||
|
|
||||||
|
When you add a package with deployment capability, it'll automatically update your workspace configuration (`angular.json` file) with a `deploy` section for the selected project. You can then use the `ng deploy` command to deploy that project.
|
||||||
|
|
||||||
|
For example, the following command automatically deploys a project to Firebase.
|
||||||
|
|
||||||
|
<code-example language="none" class="code-shell">
|
||||||
|
ng add @angular/fire
|
||||||
|
ng deploy
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
The command is interactive. In this case, you must have or create a Firebase account, and authenticate using that account. The command prompts you to select a Firebase project for deployment
|
||||||
|
|
||||||
|
After the command produces an optimal build of your application (equivalent to `ng deploy --prod`), it'll upload the production assets to Firebase.
|
||||||
|
|
||||||
|
In the table below, you can find a list of packages which implement deployment functionality to different platforms. The `deploy` command for each package may require different command line options. You can read more by following the links associated with the package names below:
|
||||||
|
|
||||||
|
| Deployment to | Package |
|
||||||
|
|---------------------------------------------------------------|--------------------------------------------------------------------------------|
|
||||||
|
| [Firebase hosting](https://firebase.google.com/docs/hosting) | [`@angular/fire`](https://npmjs.org/package/@angular/fire) |
|
||||||
|
| [Azure](https://azure.microsoft.com/en-us/) | [`@azure/ng-deploy`](https://npmjs.org/package/@azure/ng-deploy) |
|
||||||
|
| [Now](https://zeit.co/now) | [`@zeit/ng-deploy`](https://npmjs.org/package/@zeit/ng-deploy) |
|
||||||
|
| [Netlify](https://www.netlify.com/) | [`@netlify-builder/deploy`](https://npmjs.org/package/@netlify-builder/deploy) |
|
||||||
|
| [GitHub pages](https://pages.github.com/) | [`angular-cli-ghpages`](https://npmjs.org/package/angular-cli-ghpages) |
|
||||||
|
|
||||||
|
If you're deploying to a self-managed server or there's no builder for your favorite cloud platform, you can either create a builder that allows you to use the `ng deploy` command, or read through this guide to learn how to manually deploy your app.
|
||||||
|
|
||||||
### Basic deployment to a remote server
|
### Basic deployment to a remote server
|
||||||
|
|
||||||
For the simplest deployment, create a production build and copy the output directory to a web server.
|
For the simplest deployment, create a production build and copy the output directory to a web server.
|
||||||
@ -589,14 +618,14 @@ In `angular.json` add two new configuration sections under the `build` and `serv
|
|||||||
...
|
...
|
||||||
},
|
},
|
||||||
"es5": {
|
"es5": {
|
||||||
"browserTarget": "app:build:es5"
|
"browserTarget": "<app-name>:build:es5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
You can then run the serve with this configuration.
|
You can then run the `ng serve` command with this configuration. Make sure to replace `<app-name>` (in `"<app-name>:build:es5"`) with the actual name of the app, as it appears under `projects` in `angular.json`. For example, if your app name is `myAngularApp` the config will become `"browserTarget": "myAngularApp:build:es5"`.
|
||||||
|
|
||||||
<code-example language="none" class="code-shell">
|
<code-example language="none" class="code-shell">
|
||||||
|
|
||||||
@ -651,7 +680,7 @@ Create an [ES5 serve configuration](guide/deployment#configuring-serve-for-es5)
|
|||||||
|
|
||||||
<code-example language="json">
|
<code-example language="json">
|
||||||
|
|
||||||
"test": {
|
"e2e": {
|
||||||
"builder": "@angular-devkit/build-angular:protractor",
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
"options": {
|
"options": {
|
||||||
...
|
...
|
||||||
@ -661,14 +690,14 @@ Create an [ES5 serve configuration](guide/deployment#configuring-serve-for-es5)
|
|||||||
...
|
...
|
||||||
},
|
},
|
||||||
"es5": {
|
"es5": {
|
||||||
"devServerTarget": "app:serve:es5"
|
"devServerTarget": "<app-name>:serve:es5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
You can then run the e2e's with this configuration
|
You can then run the `ng e2e` command with this configuration. Make sure to replace `<app-name>` (in `"<app-name>:serve:es5"`) with the actual name of the app, as it appears under `projects` in `angular.json`. For example, if your app name is `myAngularApp` the config will become `"devServerTarget": "myAngularApp:serve:es5"`.
|
||||||
|
|
||||||
<code-example language="none" class="code-shell">
|
<code-example language="none" class="code-shell">
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ For more information, see [/deep/, >>>, and ::ng-deep](guide/component-styles#de
|
|||||||
{@a template-tag}
|
{@a template-tag}
|
||||||
### <template> tag
|
### <template> tag
|
||||||
|
|
||||||
The `<template>` tag was deprecated in v4 to avoid colliding with the DOM's element of the same name (such as when using web components). Use `<ng-template>` instead. For more information, see the [Ahead-of-Time Compilation](guide/aot-compiler#enablelegacytemplate) guide.
|
The `<template>` tag was deprecated in v4 to avoid colliding with the DOM's element of the same name (such as when using web components). Use `<ng-template>` instead. For more information, see the [Ahead-of-Time Compilation](guide/angular-compiler-options#enablelegacytemplate) guide.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user