Compare commits
231 Commits
5.0.0-beta
...
4.4.1
Author | SHA1 | Date | |
---|---|---|---|
818f4a751e | |||
4e7d2bd5bf | |||
395ac510f7 | |||
b20c5d2c37 | |||
ea02b1ccfa | |||
0bafd03e85 | |||
e8d1858c64 | |||
d1efc5ae90 | |||
86f7b4170c | |||
9d93c859d7 | |||
5baa069b16 | |||
12b7d00747 | |||
d777d79c61 | |||
062a772e48 | |||
3618cc6d34 | |||
9413ca8a2e | |||
1302e54947 | |||
edf423af3d | |||
37086748bf | |||
6c3f1f70ba | |||
8a8c4d37aa | |||
f6a7183c52 | |||
c86e16db5f | |||
c3907893c1 | |||
d61c6f996a | |||
bd04cd61f8 | |||
96dcfafe45 | |||
991a802a8e | |||
48ae1a6574 | |||
dd2d1be006 | |||
5369de80d6 | |||
552dbfc2f1 | |||
0aa4cbdbc8 | |||
9f16c2620c | |||
9b256a9144 | |||
0f1476be33 | |||
769b2aada2 | |||
301236e1a5 | |||
aeb98dbcdf | |||
8036d05412 | |||
7d137d7f88 | |||
b8b551cf2b | |||
7ec28fe9af | |||
1cc3fe21b6 | |||
ba7d70e5e0 | |||
497e0178cc | |||
8821723526 | |||
a203a959ae | |||
dfe2bad663 | |||
f09a266e01 | |||
3853fff795 | |||
641be64544 | |||
bcf211bdb3 | |||
ee5591d583 | |||
1f43713506 | |||
325b9b4562 | |||
88abdbd50b | |||
14d34c9bdf | |||
e1f45a33b7 | |||
9a754f9f0f | |||
c3dcbf9cb3 | |||
5d68c830d2 | |||
ac58914b97 | |||
77ebd2b020 | |||
fec3b1a0e9 | |||
3b571a4f3d | |||
efee81eb57 | |||
a7a698c36f | |||
b5f1dc32d1 | |||
eef28144ce | |||
f9b290570e | |||
4852f55875 | |||
793f31b9b3 | |||
7e94405271 | |||
6076a8d7bb | |||
a1624f217c | |||
b2f4d53bf0 | |||
7662cefe6f | |||
1cb607697a | |||
1990c3c722 | |||
b589d85d6f | |||
03ec3a2169 | |||
a5baed6b97 | |||
259fc91305 | |||
a618d6e4ce | |||
b315a84ba0 | |||
972538be7a | |||
d7be4f12b5 | |||
b9c1c913c1 | |||
06e479ff66 | |||
0065868f37 | |||
77fa3c3e48 | |||
f4cb45345d | |||
9329bfb86a | |||
3efc88fb81 | |||
954b09022a | |||
71f5e78bcb | |||
f0c3ed0f14 | |||
c8fd3f5237 | |||
e0660b1b72 | |||
5a165ebcef | |||
3212f8c826 | |||
c421ccaae9 | |||
bbec7db7ba | |||
00134ae4e0 | |||
07bd459baa | |||
302adf1081 | |||
1a6a13425b | |||
072a772ca6 | |||
5f0e0a46fd | |||
c7b72aa575 | |||
732eb61957 | |||
e7e7622971 | |||
4176832266 | |||
71de92a189 | |||
e0021d4cf5 | |||
4e44102e31 | |||
111b70d108 | |||
5e4054b8f3 | |||
5afc7abcb0 | |||
65d0888708 | |||
adfd2373b8 | |||
3a82af3bde | |||
3af62306b4 | |||
afe339396f | |||
c4b51bf689 | |||
b65fe3e44e | |||
116ee334fb | |||
dbc5c5817a | |||
baf4ce0dd0 | |||
24db1ed938 | |||
82798e9d04 | |||
da8bb1b45b | |||
f5cbc2ee25 | |||
cbc1986c6f | |||
0982f993cb | |||
a5a29b0591 | |||
a8f3197f24 | |||
e6f37120fe | |||
6840b7bda9 | |||
68f458909a | |||
12acecf756 | |||
cfbed40ab6 | |||
fe1a6b8e42 | |||
13e29c4e89 | |||
fd52b178ed | |||
ca1f071b2e | |||
296adbbb72 | |||
c795ee1176 | |||
b550618afd | |||
d08d6eebff | |||
e9789abd05 | |||
f2ec2cbb99 | |||
8de2ace80a | |||
c977994864 | |||
12b8e1af55 | |||
9a188485f5 | |||
45a10419bc | |||
2245748c14 | |||
bcea196530 | |||
b9e32c833a | |||
be49e0ee93 | |||
bf95655a1a | |||
6bf5b84fa4 | |||
4836565ca7 | |||
750e4e8156 | |||
a0846194b7 | |||
bcf6b90c95 | |||
3ca2a0aa37 | |||
b4be96c65d | |||
434ff5fecb | |||
a1bb9c2d42 | |||
7e626bef0a | |||
a1e83a8ed2 | |||
cbeb197aa5 | |||
0330fa6b82 | |||
97135e8fd5 | |||
35bd07fc7b | |||
a8ac77b645 | |||
9ecd377a51 | |||
76171bd8b4 | |||
1f106d75bc | |||
a4fae8c405 | |||
33c07b3394 | |||
c9d06e676f | |||
c7c65d9fda | |||
257a9e3e6f | |||
c7c0a1688e | |||
7e95e2b0ba | |||
ddc286f4b5 | |||
3d17a3672e | |||
61d253f5fd | |||
54be25a7a1 | |||
b1757037fb | |||
f0476fcff0 | |||
a5c4bb5b96 | |||
4c1f32b0db | |||
383d8969ab | |||
333ffd8d32 | |||
d4679a0bc2 | |||
4ce29f3a5b | |||
17b7bc3e06 | |||
f19bd5f4f3 | |||
d503d25f29 | |||
5d275e994a | |||
d8c8b13bb8 | |||
4671168635 | |||
1ac78bfd5d | |||
4340beacea | |||
ec89f378fc | |||
4dd6863bc2 | |||
37c626e673 | |||
f0a110928b | |||
c39e7d1eb2 | |||
799bffb431 | |||
fda607cc2f | |||
cc3aa68123 | |||
306621d2d6 | |||
d204f7aa2a | |||
a94f5e8cbb | |||
1390afef23 | |||
b0346a6e45 | |||
e5da059994 | |||
ac92c3bb26 | |||
87157d7089 | |||
611dd12f0f | |||
969ce9dc2b | |||
34834a9e79 | |||
6e2ddccc2c | |||
55742e4737 | |||
0091b1e8db |
18
.bazelrc
@ -1,18 +1,6 @@
|
||||
# Make compilation fast, by keeping a few copies of the compilers
|
||||
# running as daemons, and cache SourceFile AST's to reduce parse time.
|
||||
build --strategy=TypeScriptCompile=worker
|
||||
build --strategy=AngularTemplateCompile=worker
|
||||
|
||||
# Don't create bazel-* symlinks in the WORKSPACE directory.
|
||||
# These require .gitignore and may scare users.
|
||||
# Also, it's a workaround for https://github.com/bazelbuild/rules_typescript/issues/12
|
||||
# which affects the common case of having `tsconfig.json` in the WORKSPACE directory.
|
||||
#
|
||||
# Instead, you should run `bazel info bazel-bin` to find out where the outputs went.
|
||||
build --symlink_prefix=/
|
||||
# Disable sandboxing because it's too slow.
|
||||
# https://github.com/bazelbuild/bazel/issues/2424
|
||||
build --spawn_strategy=standalone
|
||||
|
||||
# Performance: avoid stat'ing input files
|
||||
build --watchfs
|
||||
|
||||
# Don't print all the .d.ts output locations after builds
|
||||
build --show_result=0
|
@ -41,8 +41,8 @@ jobs:
|
||||
- restore_cache:
|
||||
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
|
||||
|
||||
- run: bazel run @nodejs//:npm install
|
||||
- run: bazel build packages/...
|
||||
- run: bazel run @build_bazel_rules_typescript_node//:bin/npm install
|
||||
- run: bazel build ...
|
||||
- save_cache:
|
||||
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
|
||||
paths:
|
||||
|
1
.gitignore
vendored
@ -5,7 +5,6 @@ bazel-*
|
||||
e2e_test.*
|
||||
node_modules
|
||||
bower_components
|
||||
tools/gulp-tasks/cldr/cldr-data/
|
||||
|
||||
# Include when developing application packages.
|
||||
pubspec.lock
|
||||
|
@ -69,6 +69,7 @@ groups:
|
||||
- "*.lock"
|
||||
- "tools/*"
|
||||
exclude:
|
||||
- "tools/@angular/tsc-wrapped/*"
|
||||
- "tools/public_api_guard/*"
|
||||
- "aio/*"
|
||||
users:
|
||||
@ -135,9 +136,8 @@ groups:
|
||||
compiler-cli:
|
||||
conditions:
|
||||
files:
|
||||
- "packages/tsc-wrapped/*"
|
||||
- "tools/@angular/tsc-wrapped/*"
|
||||
- "packages/compiler-cli/*"
|
||||
- "packages/bazel/*"
|
||||
users:
|
||||
- alexeagle
|
||||
- chuckjaz
|
||||
|
37
BUILD.bazel
@ -6,25 +6,20 @@ exports_files(["tsconfig.json"])
|
||||
# https://github.com/bazelbuild/bazel/issues/374#issuecomment-296217940
|
||||
filegroup(
|
||||
name = "node_modules",
|
||||
# Performance workaround: list individual files
|
||||
# Reduces the number of files as inputs to nodejs_binary:
|
||||
# bazel query "deps(:node_modules)" | wc -l
|
||||
# This won't scale in the general case.
|
||||
# TODO(alexeagle): figure out what to do
|
||||
srcs = glob(["/".join(["node_modules", pkg, "**", ext]) for pkg in [
|
||||
"typescript",
|
||||
"zone.js",
|
||||
"rxjs",
|
||||
"@types",
|
||||
"tsickle",
|
||||
"hammerjs",
|
||||
"protobufjs",
|
||||
"bytebuffer",
|
||||
"reflect-metadata",
|
||||
"minimist",
|
||||
] for ext in [
|
||||
"*.js",
|
||||
"*.json",
|
||||
"*.d.ts",
|
||||
]]),
|
||||
srcs = glob([
|
||||
# Performance workaround: list individual files
|
||||
# This won't scale in the general case.
|
||||
# TODO(alexeagle): figure out what to do
|
||||
"node_modules/typescript/**",
|
||||
"node_modules/zone.js/**",
|
||||
"node_modules/rxjs/**/*.d.ts",
|
||||
"node_modules/rxjs/**/*.js",
|
||||
"node_modules/@types/**/*.d.ts",
|
||||
"node_modules/tsickle/**",
|
||||
"node_modules/hammerjs/**/*.d.ts",
|
||||
"node_modules/protobufjs/**",
|
||||
"node_modules/bytebuffer/**",
|
||||
"node_modules/reflect-metadata/**",
|
||||
"node_modules/minimist/**/*.js",
|
||||
]),
|
||||
)
|
||||
|
375
CHANGELOG.md
@ -1,93 +1,12 @@
|
||||
<a name="5.0.0-beta.7"></a>
|
||||
# [5.0.0-beta.7](https://github.com/angular/angular/compare/5.0.0-beta.6...5.0.0-beta.7) (2017-09-13)
|
||||
<a name="4.4.0"></a>
|
||||
# [4.4.0](https://github.com/angular/angular/compare/4.4.0-RC.0...4.4.0) (2017-09-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** emit preamble in generated files. ([b1055a5](https://github.com/angular/angular/commit/b1055a5))
|
||||
* **compiler:** fix bazel integration and make `perform-compile` more flexible ([a69172f](https://github.com/angular/angular/commit/a69172f))
|
||||
* **compiler:** lower variables with a closure by exporting the variable. ([5ef6e63](https://github.com/angular/angular/commit/5ef6e63))
|
||||
* **platform-browser:** run BLACK_LISTED_EVENTS outside of ngZone ([#18993](https://github.com/angular/angular/issues/18993)) ([d52f426](https://github.com/angular/angular/commit/d52f426))
|
||||
* **platform-browser:** simple version of zone aware addEventListener ([#18993](https://github.com/angular/angular/issues/18993)) ([ed1175f](https://github.com/angular/angular/commit/ed1175f))
|
||||
* **platform-server:** support setting innerText property ([831613a](https://github.com/angular/angular/commit/831613a))
|
||||
* **router:** adjust ChildActivation events to only fire when the child is actually changing ([#19043](https://github.com/angular/angular/issues/19043)) ([66f0ab0](https://github.com/angular/angular/commit/66f0ab0)), closes [#18942](https://github.com/angular/angular/issues/18942)
|
||||
* **tsc-wrapped:** deduplicate metadata for re-exported modules ([c056b8c](https://github.com/angular/angular/commit/c056b8c))
|
||||
* **tsc-wrapped:** fix metadata symbol reference ([626555c](https://github.com/angular/angular/commit/626555c))
|
||||
* **upgrade:** add testability hook to downgraded component ([97cc6ca](https://github.com/angular/angular/commit/97cc6ca))
|
||||
* **upgrade:** remove code setting id attribute. ([b6833d1](https://github.com/angular/angular/commit/b6833d1)), closes [#18446](https://github.com/angular/angular/issues/18446)
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **router:** remove deprecated `RouterOutlet` properties ([a9ef858](https://github.com/angular/angular/commit/a9ef858))
|
||||
* update angular to support TypeScript 2.4 ([ca5aeba](https://github.com/angular/angular/commit/ca5aeba))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **compiler:** deprecate i18n comments in favor of `ng-container` ([#18998](https://github.com/angular/angular/issues/18998)) ([66a5dab](https://github.com/angular/angular/commit/66a5dab))
|
||||
* **platform-server:** provide a way to hook into renderModule* ([#19023](https://github.com/angular/angular/issues/19023)) ([8dfc3c3](https://github.com/angular/angular/commit/8dfc3c3))
|
||||
* **router:** add ActivationStart/End events ([8f79150](https://github.com/angular/angular/commit/8f79150))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* - the Angular compiler now requires TypeScript 2.4.x.
|
||||
* router: `RouterOutlet` properties `locationInjector` and `locationFactoryResolver` have been removed as they were deprecated since v4.
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.6"></a>
|
||||
# [5.0.0-beta.6](https://github.com/angular/angular/compare/5.0.0-beta.5...5.0.0-beta.6) (2017-09-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **animations:** do not leak DOM nodes/styling for host triggered animations ([#18853](https://github.com/angular/angular/issues/18853)) ([fcadeb2](https://github.com/angular/angular/commit/fcadeb2)), closes [#18606](https://github.com/angular/angular/issues/18606)
|
||||
* **common:** fix a duplicate case in the locale switch ([#18941](https://github.com/angular/angular/issues/18941)) ([fdd5010](https://github.com/angular/angular/commit/fdd5010))
|
||||
* **common:** fix improper packaging for [@angular](https://github.com/angular)/common/http ([#18613](https://github.com/angular/angular/issues/18613)) ([65e26d7](https://github.com/angular/angular/commit/65e26d7))
|
||||
* **common:** fix XSSI prefix stripping by using JSON.parse always ([#18466](https://github.com/angular/angular/issues/18466)) ([452a7ae](https://github.com/angular/angular/commit/452a7ae)), closes [#18396](https://github.com/angular/angular/issues/18396) [#18453](https://github.com/angular/angular/issues/18453)
|
||||
* **common:** update closure-locale generation for tree shaking ([#18938](https://github.com/angular/angular/issues/18938)) ([946e5bd](https://github.com/angular/angular/commit/946e5bd))
|
||||
* **common:** use correct group separator for currency pipe ([#18932](https://github.com/angular/angular/issues/18932)) ([4ec5e28](https://github.com/angular/angular/commit/4ec5e28))
|
||||
* **common:** use v4 plurals when importing `DeprecatedI18NPipesModule` ([#18955](https://github.com/angular/angular/issues/18955)) ([30d53a8](https://github.com/angular/angular/commit/30d53a8))
|
||||
* **compiler:** always check summaries first before falling back to metadata from .d.ts files ([#18788](https://github.com/angular/angular/issues/18788)) ([f83b819](https://github.com/angular/angular/commit/f83b819))
|
||||
* **compiler:** always emit ngfactories with reexports ([#18788](https://github.com/angular/angular/issues/18788)) ([0262e37](https://github.com/angular/angular/commit/0262e37))
|
||||
* **compiler:** don’t emit stubs when we didn’t generate code for a file. ([#18788](https://github.com/angular/angular/issues/18788)) ([506d2e9](https://github.com/angular/angular/commit/506d2e9))
|
||||
* **compiler:** don’t reexport types in `.ngfactory` files ([#18788](https://github.com/angular/angular/issues/18788)) ([8c858d7](https://github.com/angular/angular/commit/8c858d7))
|
||||
* **compiler:** normalize the locale name ([#18963](https://github.com/angular/angular/issues/18963)) ([043f104](https://github.com/angular/angular/commit/043f104))
|
||||
* **compiler:** quote non identifiers in map keys. ([#18788](https://github.com/angular/angular/issues/18788)) ([2fbc92f](https://github.com/angular/angular/commit/2fbc92f))
|
||||
* **compiler:** treat absolute imports as package imports ([#18912](https://github.com/angular/angular/issues/18912)) ([fce7ae1](https://github.com/angular/angular/commit/fce7ae1))
|
||||
* **compiler:** use either summary or metadata information when reading .d.ts files ([#18912](https://github.com/angular/angular/issues/18912)) ([f1e526f](https://github.com/angular/angular/commit/f1e526f))
|
||||
* **compiler:** workaround bugs in TS when combining transformers ([#18912](https://github.com/angular/angular/issues/18912)) ([4059a72](https://github.com/angular/angular/commit/4059a72))
|
||||
* **compiler-cli:** fix memory leaks in watch mode ([#18961](https://github.com/angular/angular/issues/18961)) ([83e5deb](https://github.com/angular/angular/commit/83e5deb))
|
||||
* **compiler-cli:** use `--locale` parameter for transformers ([#18988](https://github.com/angular/angular/issues/18988)) ([22c4090](https://github.com/angular/angular/commit/22c4090))
|
||||
* **core:** complete EventEmitter in QueryList on component destroy ([#18902](https://github.com/angular/angular/issues/18902)) ([36d37cc](https://github.com/angular/angular/commit/36d37cc)), closes [#18741](https://github.com/angular/angular/issues/18741)
|
||||
* **tsc-wrapped:** decouple bundle index host from tsickle dependency ([#18999](https://github.com/angular/angular/issues/18999)) ([d1afadb](https://github.com/angular/angular/commit/d1afadb))
|
||||
* **upgrade:** deprecate the dynamic version of `ngUpgrade` ([450a13d](https://github.com/angular/angular/commit/450a13d))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **core:** remove deprecated `OpaqueToken` ([#18971](https://github.com/angular/angular/issues/18971)) ([3c4eef8](https://github.com/angular/angular/commit/3c4eef8))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **http**: deprecate @angular/http in favor of @angular/common/http ([#18906](https://github.com/angular/angular/issues/18906)) ([72c7b6e](https://github.com/angular/angular/commit/72c7b6e))
|
||||
* **common:** accept object map for HttpClient headers & params ([#18490](https://github.com/angular/angular/issues/18490)) ([1b1d5f1](https://github.com/angular/angular/commit/1b1d5f1))
|
||||
* **common:** generate `closure-locale.ts` to tree shake locale data ([#18907](https://github.com/angular/angular/issues/18907)) ([4878936](https://github.com/angular/angular/commit/4878936))
|
||||
* **compiler:** set `enableLegacyTemplate` to false by default ([#18756](https://github.com/angular/angular/issues/18756)) ([56238fe](https://github.com/angular/angular/commit/56238fe))
|
||||
* **compiler-cli:** add watch mode to `ngc` ([#18818](https://github.com/angular/angular/issues/18818)) ([cf7d47d](https://github.com/angular/angular/commit/cf7d47d))
|
||||
* **compiler-cli:** add watch mode to `ngc` ([#18818](https://github.com/angular/angular/issues/18818)) ([06d01b2](https://github.com/angular/angular/commit/06d01b2))
|
||||
* **compiler-cli:** lower metadata `useValue` and `data` literal fields ([#18905](https://github.com/angular/angular/issues/18905)) ([0e64261](https://github.com/angular/angular/commit/0e64261))
|
||||
* **compiler-cli:** lower metadata `useValue` and `data` literal fields ([#18905](https://github.com/angular/angular/issues/18905)) ([c685cc2](https://github.com/angular/angular/commit/c685cc2))
|
||||
* **platform-server:** provide a DOM implementation on the server ([2f2d5f3](https://github.com/angular/angular/commit/2f2d5f3)), closes [#14638](https://github.com/angular/angular/issues/14638)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* core: `OpaqueToken` has been removed as it was deprecated since v4. Use `InjectionToken` instead.
|
||||
* compiler: the compiler option `enableLegacyTemplate` is now disabled by default as the `<template>` element has been deprecated since v4. Use `<ng-template>` instead. The option `enableLegacyTemplate` and the `<template>` element will both be removed in Angular v6.
|
||||
* **tsc-wrapped:** deduplicate metadata for re-exported modules ([48ae1a6](https://github.com/angular/angular/commit/48ae1a6))
|
||||
* **tsc-wrapped:** fix metadata symbol reference ([f6a7183](https://github.com/angular/angular/commit/f6a7183))
|
||||
* **upgrade:** remove code setting id attribute. ([#19182](https://github.com/angular/angular/issues/19182)) ([b20c5d2](https://github.com/angular/angular/commit/b20c5d2)), closes [#18446](https://github.com/angular/angular/issues/18446)
|
||||
|
||||
|
||||
|
||||
@ -110,147 +29,6 @@
|
||||
* **core:** add option to remove blank text nodes from compiled templates ([#18823](https://github.com/angular/angular/issues/18823)) ([b8b551c](https://github.com/angular/angular/commit/b8b551c))
|
||||
|
||||
|
||||
<a name="5.0.0-beta.5"></a>
|
||||
# [5.0.0-beta.5](https://github.com/angular/angular/compare/5.0.0-beta.4...5.0.0-beta.5) (2017-08-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **animations:** ensure animations are disabled on the element containing the @.disabled flag ([#18714](https://github.com/angular/angular/issues/18714)) ([791c7ef](https://github.com/angular/angular/commit/791c7ef))
|
||||
* **animations:** make sure @.disabled respects disabled parent/sub animation sequences ([#18715](https://github.com/angular/angular/issues/18715)) ([e25f05a](https://github.com/angular/angular/commit/e25f05a))
|
||||
* **animations:** make sure animation cancellations respect AUTO style values ([#18787](https://github.com/angular/angular/issues/18787)) ([29aa8b3](https://github.com/angular/angular/commit/29aa8b3)), closes [#17450](https://github.com/angular/angular/issues/17450)
|
||||
* **animations:** resolve error when using AnimationBuilder with platform-server ([#18642](https://github.com/angular/angular/issues/18642)) ([845c68f](https://github.com/angular/angular/commit/845c68f)), closes [#18635](https://github.com/angular/angular/issues/18635)
|
||||
* **animations:** restore auto-style support for removed DOM nodes ([#18787](https://github.com/angular/angular/issues/18787)) ([7062811](https://github.com/angular/angular/commit/7062811))
|
||||
* **compiler-cli:** propagate preserveWhitespaces option to codegen ([#18773](https://github.com/angular/angular/issues/18773)) ([8ea6c56](https://github.com/angular/angular/commit/8ea6c56))
|
||||
* **compiler-cli:** use forward slashes for ts.resolveModuleName ([#18784](https://github.com/angular/angular/issues/18784)) ([e228f2c](https://github.com/angular/angular/commit/e228f2c))
|
||||
* **core:** correct order in ContentChildren query result ([#18326](https://github.com/angular/angular/issues/18326)) ([f53f724](https://github.com/angular/angular/commit/f53f724)), closes [#16568](https://github.com/angular/angular/issues/16568)
|
||||
* **core:** make sure onStable runs in the right zone ([#18706](https://github.com/angular/angular/issues/18706)) ([713d7c2](https://github.com/angular/angular/commit/713d7c2))
|
||||
* **tsc-wrapped:** add metadata for `type` declarations ([#18704](https://github.com/angular/angular/issues/18704)) ([6e3498c](https://github.com/angular/angular/commit/6e3498c)), closes [#18675](https://github.com/angular/angular/issues/18675)
|
||||
* **tsc-wrapped:** make `test.sh tools` run the tsc-wrapped tests again ([#18683](https://github.com/angular/angular/issues/18683)) ([2da45e6](https://github.com/angular/angular/commit/2da45e6))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **common:** remove deprecated `NgFor` ([#18758](https://github.com/angular/angular/issues/18758)) ([ec56760](https://github.com/angular/angular/commit/ec56760))
|
||||
* **common:** remove deprecated `NgTemplateOutlet#ngOutletContext` ([#18780](https://github.com/angular/angular/issues/18780)) ([7522987](https://github.com/angular/angular/commit/7522987))
|
||||
* **compiler:** remove option `useDebug` ([#18778](https://github.com/angular/angular/issues/18778)) ([499d05d](https://github.com/angular/angular/commit/499d05d))
|
||||
* **compiler:** split compiler and core ([#18683](https://github.com/angular/angular/issues/18683)) ([0cc77b4](https://github.com/angular/angular/commit/0cc77b4))
|
||||
* **core:** remove deprecated `ChangeDetectionRef` argument in `DifferFactory#create` ([#18757](https://github.com/angular/angular/issues/18757)) ([be9713c](https://github.com/angular/angular/commit/be9713c))
|
||||
* **core:** remove deprecated `DebugNode#source` ([#18779](https://github.com/angular/angular/issues/18779)) ([d61b902](https://github.com/angular/angular/commit/d61b902))
|
||||
* **core:** remove deprecated `Testability#findBindings` ([#18782](https://github.com/angular/angular/issues/18782)) ([f2a2a6b](https://github.com/angular/angular/commit/f2a2a6b))
|
||||
* **core:** remove deprecated `TrackByFn` ([#18757](https://github.com/angular/angular/issues/18757)) ([596e9f4](https://github.com/angular/angular/commit/596e9f4))
|
||||
* **core:** remove deprecated parameter for `ErrorHandler` ([#18759](https://github.com/angular/angular/issues/18759)) ([8f41326](https://github.com/angular/angular/commit/8f41326))
|
||||
* **platform-browser:** remove deprecated `NgProbeToken` ([#18760](https://github.com/angular/angular/issues/18760)) ([d7f42bf](https://github.com/angular/angular/commit/d7f42bf))
|
||||
* **platform-webworker:** remove deprecated `PRIMITIVE` ([#18761](https://github.com/angular/angular/issues/18761)) ([a56468c](https://github.com/angular/angular/commit/a56468c))
|
||||
* **router:** remove deprecated `initialNavigation` options ([#18781](https://github.com/angular/angular/issues/18781)) ([d76761b](https://github.com/angular/angular/commit/d76761b))
|
||||
* **router:** remove deprecated `RouterOutlet` properties ([#18781](https://github.com/angular/angular/issues/18781)) ([d1c4a94](https://github.com/angular/angular/commit/d1c4a94))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **animations:** allow @.disabled property to work without an expression ([#18713](https://github.com/angular/angular/issues/18713)) ([2159342](https://github.com/angular/angular/commit/2159342))
|
||||
* **animations:** report errors when invalid CSS properties are detected ([#18718](https://github.com/angular/angular/issues/18718)) ([409688f](https://github.com/angular/angular/commit/409688f)), closes [#18701](https://github.com/angular/angular/issues/18701)
|
||||
* **common:** add an empty DeprecatedI18NPipesModule module ([#18737](https://github.com/angular/angular/issues/18737)) ([83713dd](https://github.com/angular/angular/commit/83713dd))
|
||||
* **common:** drop use of the Intl API to improve browser support ([#18284](https://github.com/angular/angular/issues/18284)) ([079d884](https://github.com/angular/angular/commit/079d884)), closes [#10809](https://github.com/angular/angular/issues/10809) [#9524](https://github.com/angular/angular/issues/9524) [#7008](https://github.com/angular/angular/issues/7008) [#9324](https://github.com/angular/angular/issues/9324) [#7590](https://github.com/angular/angular/issues/7590) [#6724](https://github.com/angular/angular/issues/6724) [#3429](https://github.com/angular/angular/issues/3429) [#17576](https://github.com/angular/angular/issues/17576) [#17478](https://github.com/angular/angular/issues/17478) [#17319](https://github.com/angular/angular/issues/17319) [#17200](https://github.com/angular/angular/issues/17200) [#16838](https://github.com/angular/angular/issues/16838) [#16624](https://github.com/angular/angular/issues/16624) [#16625](https://github.com/angular/angular/issues/16625) [#16591](https://github.com/angular/angular/issues/16591) [#14131](https://github.com/angular/angular/issues/14131) [#12632](https://github.com/angular/angular/issues/12632) [#11376](https://github.com/angular/angular/issues/11376) [#11187](https://github.com/angular/angular/issues/11187)
|
||||
* **compiler:** allow multiple exportAs names ([3a50098](https://github.com/angular/angular/commit/3a50098))
|
||||
* **compiler:** make `.ngsummary.json` files portable ([2572bf5](https://github.com/angular/angular/commit/2572bf5))
|
||||
* **compiler:** use typescript for resolving resource paths ([43226cb](https://github.com/angular/angular/commit/43226cb))
|
||||
* **forms:** add updateOn and ngFormOptions to NgForm ([0d45828](https://github.com/angular/angular/commit/0d45828))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
#### Deprecated code
|
||||
* router: `RouterOutlet` properties `locationInjector` and `locationFactoryResolver` have been removed as they were deprecated since v4.
|
||||
* common: `NgFor` has been removed as it was deprecated since v4. Use `NgForOf` instead. This does not impact the use of`*ngFor` in your templates.
|
||||
* common: `NgTemplateOutlet#ngOutletContext` has been removed as it was deprecated since v4. Use `NgTemplateOutlet#ngTemplateOutletContext` instead.
|
||||
* core: `Testability#findBindings` has been removed as it was deprecated since v4. Use `Testability#findProviders` instead.
|
||||
* core: `DebugNode#source` has been removed as it was deprecated since v4.
|
||||
* router: the values `true`, `false`, `legacy_enabled` and `legacy_disabled` for the router parameter `initialNavigation` have been removed as they were deprecated. Use `enabled` or `disabled` instead.
|
||||
* core: `DifferFactory.create` no longer takes ChangeDetectionRef as a first argument as it was not used and deprecated since v4.
|
||||
* core: `TrackByFn` has been removed because it was deprecated since v4. Use `TrackByFunction` instead.
|
||||
* platform-webworker: `PRIMITIVE` has been removed as it was deprecated since v4. Use `SerializerTypes.PRIMITIVE` instead.
|
||||
* platform-browser: `NgProbeToken` has been removed from `@angular/platform-browser` as it was deprecated since v4. Import it from `@angular/core` instead.
|
||||
* core: `ErrorHandler` no longer takes a parameter as it was not used and deprecated since v4.
|
||||
* compiler: the option `useDebug` for the compiler has been removed as it had no effect and was deprecated since v4.
|
||||
|
||||
#### Other breaking changes
|
||||
* compiler: - `@angular/platform-server` now additionally depends on
|
||||
`@angular/platform-browser-dynamic` as a peer dependency.
|
||||
* common: Because of multiple bugs and browser inconsistencies, we have dropped the intl api in favor of data exported from the Unicode Common Locale Data Repository (CLDR).
|
||||
Unfortunately we had to change the i18n pipes (date, number, currency, percent) and there are some breaking changes.
|
||||
##### I18n pipes:
|
||||
- Breaking change:
|
||||
- By default Angular now only contains locale data for the language `en-US`, if you set the value of `LOCALE_ID` to another locale, you will have to import new locale data for this language because we don't use the intl API anymore.
|
||||
- Features:
|
||||
- you don't need to use the intl polyfill for Angular anymore.
|
||||
- all i18n pipes now have an additional last parameter `locale` which allows you to use a specific locale instead of the one defined in the token `LOCALE_ID` (whose default value is `en-US`).
|
||||
- the new locale data extracted from CLDR are now available to developers as well and can be used through an API (which should be especially useful for library authors).
|
||||
- you can still use the old pipes for now, but their names have been changed and they are no longer included in the `CommonModule`. To use them, you will have to import the `DeprecatedI18NPipesModule` after the `CommonModule` (the order is important):
|
||||
|
||||
```ts
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule, DeprecatedI18NPipesModule } from '@angular/common';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
// import deprecated module after
|
||||
DeprecatedI18NPipesModule
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
```
|
||||
|
||||
Don't forget that you will still need to import the intl API polyfill if you want to use those deprecated pipes.
|
||||
|
||||
##### Date pipe
|
||||
- Breaking changes:
|
||||
- the predefined formats (`short`, `shortTime`, `shortDate`, `medium`, ...) now use the patterns given by CLDR (like it was in AngularJS) instead of the ones from the intl API. You might notice some changes, e.g. `shortDate` will be `8/15/17` instead of `8/15/2017` for `en-US`.
|
||||
- the narrow version of eras is now `GGGGG` instead of `G`, the format `G` is now similar to `GG` and `GGG`.
|
||||
- the narrow version of months is now `MMMMM` instead of `L`, the format `L` is now the short standalone version of months.
|
||||
- the narrow version of the week day is now `EEEEE` instead of `E`, the format `E` is now similar to `EE` and `EEE`.
|
||||
- the timezone `z` will now fallback to `O` and output `GMT+1` instead of the complete zone name (e.g. `Pacific Standard Time`), this is because the quantity of data required to have all the zone names in all of the existing locales is too big.
|
||||
- the timezone `Z` will now output the ISO8601 basic format, e.g. `+0100`, you should now use `ZZZZ` to get `GMT+01:00`.
|
||||
|
||||
| Field type | Format | Example value | v4 | v5 |
|
||||
|------------|---------------|-----------------------|----|---------------|
|
||||
| Eras | Narrow | A for AD | G | GGGGG |
|
||||
| Months | Narrow | S for September | L | MMMMM |
|
||||
| Week day | Narrow | M for Monday | E | EEEEE |
|
||||
| Timezone | Long location | Pacific Standard Time | z | Not available |
|
||||
| Timezone | Long GMT | GMT+01:00 | Z | ZZZZ |
|
||||
|
||||
- Features
|
||||
- new predefined formats `long`, `full`, `longTime`, `fullTime`.
|
||||
- the format `yyy` is now supported, e.g. the year `52` will be `052` and the year `2017` will be `2017`.
|
||||
- standalone months are now supported with the formats `L` to `LLLLL`.
|
||||
- week of the year is now supported with the formats `w` and `ww`, e.g. weeks `5` and `05`.
|
||||
- week of the month is now supported with the format `W`, e.g. week `3`.
|
||||
- fractional seconds are now supported with the format `S` to `SSS`.
|
||||
- day periods for AM/PM now supports additional formats `aa`, `aaa`, `aaaa` and `aaaaa`. The formats `a` to `aaa` are similar, while `aaaa` is the wide version if available (e.g. `ante meridiem` for `am`), or equivalent to `a` otherwise, and `aaaaa` is the narrow version (e.g. `a` for `am`).
|
||||
- extra day periods are now supported with the formats `b` to `bbbbb` (and `B` to `BBBBB` for the standalone equivalents), e.g. `morning`, `noon`, `afternoon`, ....
|
||||
- the short non-localized timezones are now available with the format `O` to `OOOO`. The formats `O` to `OOO` will output `GMT+1` while the format `OOOO` will be `GMT+01:00`.
|
||||
- the ISO8601 basic time zones are now available with the formats `Z` to `ZZZZZ`. The formats `Z` to `ZZZ` will output `+0100`, while the format `ZZZZ` will be `GMT+01:00` and `ZZZZZ` will be `+01:00`.
|
||||
|
||||
- Bug fixes
|
||||
- the date pipe will now work exactly the same across all browsers, which will fix a lot of bugs for safari and IE.
|
||||
- eras can now be used on their own without the date, e.g. the format `GG` will be `AD` instead of `8 15, 2017 AD`.
|
||||
|
||||
##### Currency pipe
|
||||
- Breaking change:
|
||||
- the default value for `symbolDisplay` is now `symbol` instead of `code`. This means that by default you will see `$4.99` for `en-US` instead of `USD4.99` previously.
|
||||
|
||||
* Deprecation:
|
||||
- the second parameter of the currency pipe (`symbolDisplay`) is no longer a boolean, it now takes the values `code`, `symbol` or `symbol-narrow`. A boolean value is still valid for now, but it is deprecated and it will print a warning message in the console.
|
||||
|
||||
- Features:
|
||||
- you can now choose between `code`, `symbol` or `symbol-narrow` which gives you access to more options for some currencies (e.g. the canadian dollar with the code `CAD` has the symbol `CA$` and the symbol-narrow `$`).
|
||||
|
||||
##### Percent pipe
|
||||
- Breaking change
|
||||
- if you don't specify the number of digits to round to, the local format will be used (and it usually rounds numbers to 0 digits, instead of not rounding previously), e.g. `{{ 3.141592 | percent }}` will output `314%` for the locale `en-US` instead of `314.1592%` previously.
|
||||
|
||||
|
||||
<a name="4.3.6"></a>
|
||||
## [4.3.6](https://github.com/angular/angular/compare/4.3.5...4.3.6) (2017-08-23)
|
||||
@ -320,90 +98,6 @@ Unfortunately we had to change the i18n pipes (date, number, currency, percent)
|
||||
* **compiler:** cleanly compile with TypeScript 2.4 ([#18456](https://github.com/angular/angular/issues/18456)) ([5e4054b](https://github.com/angular/angular/commit/5e4054b))
|
||||
* **compiler:** ignore [@import](https://github.com/import) in multi-line css ([#18452](https://github.com/angular/angular/issues/18452)) ([e7e7622](https://github.com/angular/angular/commit/e7e7622)), closes [#18038](https://github.com/angular/angular/issues/18038)
|
||||
|
||||
|
||||
<a name="5.0.0-beta.3"></a>
|
||||
# [5.0.0-beta.3](https://github.com/angular/angular/compare/5.0.0-beta.2...5.0.0-beta.3) (2017-08-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **animations:** revert container/queried animations accordingly during cancel ([#18516](https://github.com/angular/angular/issues/18516)) ([c0c03dc](https://github.com/angular/angular/commit/c0c03dc))
|
||||
* **animations:** support persisting dynamic styles within animation states ([#18468](https://github.com/angular/angular/issues/18468)) ([05472cb](https://github.com/angular/angular/commit/05472cb)), closes [#18423](https://github.com/angular/angular/issues/18423) [#17505](https://github.com/angular/angular/issues/17505)
|
||||
* **benchpress:** compile cleanly with TS 2.4 ([#18455](https://github.com/angular/angular/issues/18455)) ([e25b3dd](https://github.com/angular/angular/commit/e25b3dd))
|
||||
* **common:** don't recreate view when context shape doesn't change ([#18277](https://github.com/angular/angular/issues/18277)) ([685cc26](https://github.com/angular/angular/commit/685cc26)), closes [#13407](https://github.com/angular/angular/issues/13407)
|
||||
* **compiler:** cleanly compile with TypeScript 2.4 ([#18456](https://github.com/angular/angular/issues/18456)) ([7c47b62](https://github.com/angular/angular/commit/7c47b62))
|
||||
* **compiler:** ignore [@import](https://github.com/import) in multi-line css ([#18452](https://github.com/angular/angular/issues/18452)) ([1dca575](https://github.com/angular/angular/commit/1dca575)), closes [#18038](https://github.com/angular/angular/issues/18038)
|
||||
* **compiler-cli:** disable buggy expression lowering ([#18513](https://github.com/angular/angular/issues/18513)) ([ca695e0](https://github.com/angular/angular/commit/ca695e0))
|
||||
* **compiler-cli:** fix and re-enable expression lowering ([#18570](https://github.com/angular/angular/issues/18570)) ([6f2038c](https://github.com/angular/angular/commit/6f2038c)), closes [#18388](https://github.com/angular/angular/issues/18388)
|
||||
* **compiler-cli:** modified ngc to throw all errors, not just syntax ([#18388](https://github.com/angular/angular/issues/18388)) ([5651e4a](https://github.com/angular/angular/commit/5651e4a))
|
||||
* **compiler-cli:** remove minimist dependency of compiler-cli/index ([#18532](https://github.com/angular/angular/issues/18532)) ([5b7432b](https://github.com/angular/angular/commit/5b7432b))
|
||||
* **core:** fix platform-browser-dynamic ([#18576](https://github.com/angular/angular/issues/18576)) ([f0a5501](https://github.com/angular/angular/commit/f0a5501))
|
||||
* **core:** forbid destroyed views to be inserted or moved in VC ([#18568](https://github.com/angular/angular/issues/18568)) ([e54bd59](https://github.com/angular/angular/commit/e54bd59)), closes [#17780](https://github.com/angular/angular/issues/17780)
|
||||
|
||||
### Features
|
||||
|
||||
* **core:** Create StaticInjector which does not depend on Reflect polyfill. ([d9d00bd](https://github.com/angular/angular/commit/d9d00bd))
|
||||
* **forms:** add default updateOn values for groups and arrays ([#18536](https://github.com/angular/angular/issues/18536)) ([ff5c58b](https://github.com/angular/angular/commit/ff5c58b))
|
||||
* **forms:** add updateOn blur option to FormControls ([#18408](https://github.com/angular/angular/issues/18408)) ([333a708](https://github.com/angular/angular/commit/333a708)), closes [#7113](https://github.com/angular/angular/issues/7113)
|
||||
* **forms:** add updateOn submit option to FormControls ([#18514](https://github.com/angular/angular/issues/18514)) ([f69561b](https://github.com/angular/angular/commit/f69561b))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* switch angular to use StaticInjector instead of ReflectiveInjector ([fcadbf4](https://github.com/angular/angular/commit/fcadbf4)), closes [#18496](https://github.com/angular/angular/issues/18496)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* `platformXXXX()` no longer accepts providers which depend on reflection.
|
||||
Specifically the method signature when from `Provider[]` to
|
||||
`StaticProvider[]`.
|
||||
|
||||
Example:
|
||||
Before:
|
||||
```
|
||||
[
|
||||
MyClass,
|
||||
{provide: ClassA, useClass: SubClassA}
|
||||
]
|
||||
|
||||
```
|
||||
|
||||
After:
|
||||
```
|
||||
[
|
||||
{provide: MyClass, deps: [Dep1,...]},
|
||||
{provide: ClassA, useClass: SubClassA, deps: [Dep1,...]}
|
||||
]
|
||||
```
|
||||
|
||||
NOTE: This only applies to platform creation and providers for the JIT
|
||||
compiler. It does not apply to `@Component` or `@NgModule` provides
|
||||
declarations.
|
||||
|
||||
Benchpress note: Previously Benchpress also supported reflective
|
||||
provides, which now require static providers.
|
||||
|
||||
DEPRECATION:
|
||||
|
||||
- `ReflectiveInjector` is now deprecated as it will be remove. Use
|
||||
`Injector.create` as a replacement.
|
||||
|
||||
<a name="5.0.0-beta.2"></a>
|
||||
# [5.0.0-beta.2](https://github.com/angular/angular/compare/5.0.0-beta.1...5.0.0-beta.2) (2017-08-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** do not consider arguments when determining recursion ([e64b54b](https://github.com/angular/angular/commit/e64b54b))
|
||||
* **compiler:** fix for element needing implicit parent placed in top-level ng-container ([381471d](https://github.com/angular/angular/commit/381471d)), closes [#18314](https://github.com/angular/angular/issues/18314)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **forms:** add options arg to abstract controls ([ebef5e6](https://github.com/angular/angular/commit/ebef5e6))
|
||||
* **router:** add events tracking activation of individual routes ([49cd851](https://github.com/angular/angular/commit/49cd851))
|
||||
|
||||
|
||||
<a name="4.3.3"></a>
|
||||
## [4.3.3](https://github.com/angular/angular/compare/4.3.2...4.3.3) (2017-08-02)
|
||||
|
||||
@ -411,36 +105,6 @@ DEPRECATION:
|
||||
|
||||
* **compiler:** fix for element needing implicit parent placed in top-level ng-container ([f5cbc2e](https://github.com/angular/angular/commit/f5cbc2e)), closes [#18314](https://github.com/angular/angular/issues/18314)
|
||||
|
||||
|
||||
<a name="5.0.0-beta.1"></a>
|
||||
# [5.0.0-beta.1](https://github.com/angular/angular/compare/5.0.0-beta.0...5.0.0-beta.1) (2017-07-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **animations:** export BrowserModule as apart of BrowserAnimationsModule ([#18263](https://github.com/angular/angular/issues/18263)) ([fd0cc01](https://github.com/angular/angular/commit/fd0cc01))
|
||||
* **compiler:** add equiv & disp attributes to Xliff2 ICU placeholders ([#18283](https://github.com/angular/angular/issues/18283)) ([38ec05f](https://github.com/angular/angular/commit/38ec05f)), closes [#17344](https://github.com/angular/angular/issues/17344)
|
||||
* **compiler:** allow numbers for ICU message cases in lexer ([#18095](https://github.com/angular/angular/issues/18095)) ([a3a5429](https://github.com/angular/angular/commit/a3a5429)), closes [#17799](https://github.com/angular/angular/issues/17799)
|
||||
* **core:** invoke error handler outside of the Angular Zone ([#18269](https://github.com/angular/angular/issues/18269)) ([7ae7573](https://github.com/angular/angular/commit/7ae7573)), closes [#17073](https://github.com/angular/angular/issues/17073) [#7774](https://github.com/angular/angular/issues/7774)
|
||||
* **platform-server:** don't clobber parse5 properties when setting ([#18237](https://github.com/angular/angular/issues/18237)) ([a094769](https://github.com/angular/angular/commit/a094769)), closes [#17050](https://github.com/angular/angular/issues/17050)
|
||||
* **router:** child CanActivate guard should wait for parent to complete ([#18110](https://github.com/angular/angular/issues/18110)) ([086f4aa](https://github.com/angular/angular/commit/086f4aa)), closes [#15670](https://github.com/angular/angular/issues/15670)
|
||||
* **router:** should throw when lazy loaded module doesn't define any routes ([#15001](https://github.com/angular/angular/issues/15001)) ([82923a3](https://github.com/angular/angular/commit/82923a3)), closes [#14596](https://github.com/angular/angular/issues/14596)
|
||||
* **upgrade:** ensure downgraded components are created in the Angular zone ([#18209](https://github.com/angular/angular/issues/18209)) ([43c33d5](https://github.com/angular/angular/commit/43c33d5))
|
||||
* **upgrade:** throw error if trying to get injector before setting ([#18209](https://github.com/angular/angular/issues/18209)) ([d31dc7b](https://github.com/angular/angular/commit/d31dc7b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **compiler:** add representation of placeholders to xliff & xmb ([b3085e9](https://github.com/angular/angular/commit/b3085e9)), closes [#17345](https://github.com/angular/angular/issues/17345)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* latest tsickle to tree shake: abstract class methods & interfaces ([#18236](https://github.com/angular/angular/issues/18236)) ([b7a6f52](https://github.com/angular/angular/commit/b7a6f52))
|
||||
* **core:** use native addEventListener for faster rendering. ([#18107](https://github.com/angular/angular/issues/18107)) ([6279e50](https://github.com/angular/angular/commit/6279e50))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.2"></a>
|
||||
## [4.3.2](https://github.com/angular/angular/compare/4.3.1...4.3.2) (2017-07-26)
|
||||
|
||||
@ -458,35 +122,6 @@ DEPRECATION:
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.0"></a>
|
||||
# [5.0.0-beta.0](https://github.com/angular/angular/compare/4.3.0...5.0.0-beta.0) (2017-07-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **animations:** always camelcase style property names that contain auto styles ([d22f8f5](https://github.com/angular/angular/commit/d22f8f5)), closes [#17938](https://github.com/angular/angular/issues/17938)
|
||||
* **animations:** capture cancelled animation styles within grouped animations ([23146c9](https://github.com/angular/angular/commit/23146c9)), closes [#17170](https://github.com/angular/angular/issues/17170)
|
||||
* **animations:** do not crash animations if a nested component fires CD during CD ([5db6f38](https://github.com/angular/angular/commit/5db6f38)), closes [#18193](https://github.com/angular/angular/issues/18193)
|
||||
* **animations:** make sure @.disabled works in non-animation components ([5344be5](https://github.com/angular/angular/commit/5344be5))
|
||||
* **common:** send flushed body as error instead of null ([5c62e30](https://github.com/angular/angular/commit/5c62e30)), closes [#18181](https://github.com/angular/angular/issues/18181)
|
||||
* **compiler:** ensure jit external id arguments names are unique ([95635c1](https://github.com/angular/angular/commit/95635c1))
|
||||
* **compiler-cli:** don't generate empty <target/> when extracting xliff ([65c9e13](https://github.com/angular/angular/commit/65c9e13)), closes [#15754](https://github.com/angular/angular/issues/15754)
|
||||
* **platform-server:** provide XhrFactory for HttpClient ([8076482](https://github.com/angular/angular/commit/8076482))
|
||||
* **router:** canDeactivate guards should run from bottom to top ([e20cfe1](https://github.com/angular/angular/commit/e20cfe1)), closes [#15657](https://github.com/angular/angular/issues/15657)
|
||||
* **router:** should navigate to the same url when config changes ([eb6fb5f](https://github.com/angular/angular/commit/eb6fb5f)), closes [#15535](https://github.com/angular/angular/issues/15535)
|
||||
* **router:** should run resolvers for the same route concurrently ([ad3029e](https://github.com/angular/angular/commit/ad3029e)), closes [#14279](https://github.com/angular/angular/issues/14279)
|
||||
* **router:** terminal route in custom matcher ([b399cb2](https://github.com/angular/angular/commit/b399cb2))
|
||||
* **upgrade:** allow accessing AngularJS injector from downgraded module ([a5205c6](https://github.com/angular/angular/commit/a5205c6))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **animations:** support :increment and :decrement transition aliases ([6f45519](https://github.com/angular/angular/commit/6f45519))
|
||||
* **upgrade:** propagate touched state of NgModelController ([59c23c7](https://github.com/angular/angular/commit/59c23c7))
|
||||
* **upgrade:** support lazy-loading Angular module into AngularJS app ([30e76fc](https://github.com/angular/angular/commit/30e76fc))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.1"></a>
|
||||
## [4.3.1](https://github.com/angular/angular/compare/4.3.0...4.3.1) (2017-07-19)
|
||||
|
||||
|
22
WORKSPACE
@ -1,21 +1,17 @@
|
||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
|
||||
git_repository(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
remote = "https://github.com/bazelbuild/rules_nodejs.git",
|
||||
tag = "0.0.2",
|
||||
name = "build_bazel_rules_typescript",
|
||||
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
||||
tag = "0.0.5",
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "node_repositories")
|
||||
|
||||
node_repositories(package_json = ["//:package.json"])
|
||||
node_repositories(package_json = "//:package.json")
|
||||
|
||||
local_repository(
|
||||
name = "build_bazel_rules_typescript",
|
||||
path = "node_modules/@bazel/typescript",
|
||||
)
|
||||
|
||||
local_repository(
|
||||
name = "angular",
|
||||
path = "packages/bazel",
|
||||
git_repository(
|
||||
name = "build_bazel_rules_angular",
|
||||
remote = "https://github.com/bazelbuild/rules_angular.git",
|
||||
tag = "0.0.1",
|
||||
)
|
@ -117,7 +117,7 @@ describe('Dependency Injection Tests', function () {
|
||||
expect(element(by.css('#p8')).getText()).toEqual(expectedMsg);
|
||||
});
|
||||
|
||||
it('P9 (InjectionToken) displays as expected', function () {
|
||||
it('P9 (OpaqueToken) displays as expected', function () {
|
||||
expectedMsg = 'APP_CONFIG Application title is Dependency Injection';
|
||||
expect(element(by.css('#p9')).getText()).toEqual(expectedMsg);
|
||||
});
|
||||
|
@ -14,6 +14,7 @@ describe('i18n E2E Tests', () => {
|
||||
|
||||
it('should display the node texts without elements', function () {
|
||||
expect(element(by.css('my-app')).getText()).toContain('No genero ningún elemento');
|
||||
expect(element(by.css('my-app')).getText()).toContain('Yo tampoco genero ningún elemento');
|
||||
});
|
||||
|
||||
it('should display the translated title attribute', function () {
|
||||
|
@ -14,6 +14,14 @@
|
||||
<source>I don't output any element</source>
|
||||
<target/>
|
||||
</trans-unit>
|
||||
<trans-unit id="df3cf8b55cb528cf8c00167e0b119bfb828538b5" datatype="html">
|
||||
<source>
|
||||
I don't output any element either
|
||||
</source>
|
||||
<target/>
|
||||
<note priority="1" from="description">optional description</note>
|
||||
<note priority="1" from="meaning">optional meaning</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="701174153757adf13e7c24a248c8a873ac9f5193" datatype="html">
|
||||
<source>Angular logo</source>
|
||||
<target/>
|
||||
|
@ -11,6 +11,14 @@
|
||||
|
||||
<br />
|
||||
|
||||
<!--#docregion i18n-with-comment-->
|
||||
<!--i18n: optional meaning|optional description -->
|
||||
I don't output any element either
|
||||
<!--/i18n-->
|
||||
<!--#enddocregion i18n-with-comment-->
|
||||
|
||||
<br />
|
||||
|
||||
<!--#docregion i18n-title-translate-->
|
||||
<img [src]="logo" i18n-title title="Angular logo" />
|
||||
<!--#enddocregion i18n-title-translate-->
|
||||
|
@ -1,6 +0,0 @@
|
||||
// #docregion import-locale
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
|
||||
registerLocaleData(localeFr);
|
||||
// #enddocregion import-locale
|
@ -1,7 +0,0 @@
|
||||
// #docregion import-locale-extra
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import localeEnGB from '@angular/common/locales/en-GB';
|
||||
import localeEnGBExtra from '@angular/common/locales/extra/en-GB';
|
||||
|
||||
registerLocaleData(localeEnGB, localeEnGBExtra);
|
||||
// #enddocregion import-locale-extra
|
@ -1,15 +1,15 @@
|
||||
// #docplaster
|
||||
// #docregion without-missing-translation
|
||||
import { TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy, StaticProvider } from '@angular/core';
|
||||
import { TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy } from '@angular/core';
|
||||
import { CompilerConfig } from '@angular/compiler';
|
||||
|
||||
export function getTranslationProviders(): Promise<StaticProvider[]> {
|
||||
export function getTranslationProviders(): Promise<Object[]> {
|
||||
|
||||
// Get the locale id from the global
|
||||
const locale = document['locale'] as string;
|
||||
|
||||
// return no providers if fail to get translation file for locale
|
||||
const noProviders: StaticProvider[] = [];
|
||||
const noProviders: Object[] = [];
|
||||
|
||||
// No locale or U.S. English: no translation providers
|
||||
if (!locale || locale === 'en-US') {
|
||||
|
@ -12,6 +12,14 @@
|
||||
<source>I don't output any element</source>
|
||||
<target>No genero ningún elemento</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="df3cf8b55cb528cf8c00167e0b119bfb828538b5" datatype="html">
|
||||
<source>
|
||||
I don't output any element either
|
||||
</source>
|
||||
<target>Yo tampoco genero ningún elemento</target>
|
||||
<note priority="1" from="description">optional description</note>
|
||||
<note priority="1" from="meaning">optional meaning</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="701174153757adf13e7c24a248c8a873ac9f5193" datatype="html">
|
||||
<source>Angular logo</source>
|
||||
<target>Logo de Angular</target>
|
||||
|
@ -21,6 +21,12 @@
|
||||
<source>I don't output any element</source>
|
||||
<target>No genero ningún elemento</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="df3cf8b55cb528cf8c00167e0b119bfb828538b5" datatype="html">
|
||||
<source>I don't output any element either</source>
|
||||
<target>Yo tampoco genero ningún elemento</target>
|
||||
<note priority="1" from="description">optional description</note>
|
||||
<note priority="1" from="meaning">optional meaning</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="701174153757adf13e7c24a248c8a873ac9f5193" datatype="html">
|
||||
<source>Angular logo</source>
|
||||
<target>Logo de Angular</target>
|
||||
|
@ -92,22 +92,22 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
The <code>hero.id</code> in the <ng-template *ngIf> disappears:
|
||||
The <code>hero.id</code> in the <template *ngIf> disappears:
|
||||
<p>
|
||||
<ng-template *ngIf="showId">
|
||||
<template *ngIf="showId">
|
||||
Id: ({{hero.id}})
|
||||
</ng-template>
|
||||
</template>
|
||||
Name: {{hero.name}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
The <code>hero.id</code> in the <ng-template [ngIf]>
|
||||
The <code>hero.id</code> in the <template [ngIf]>
|
||||
is unaffected by the <span>p-span</span> CSS:
|
||||
<p>
|
||||
<ng-template [ngIf]="showId">
|
||||
<template [ngIf]="showId">
|
||||
Id: ({{hero.id}})
|
||||
</ng-template>
|
||||
</template>
|
||||
Name: {{hero.name}}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -28,7 +28,7 @@ describe('Pipes', function () {
|
||||
|
||||
it('should be able to toggle birthday formats', function () {
|
||||
let birthDayEle = element(by.css('hero-birthday2 > p'));
|
||||
expect(birthDayEle.getText()).toEqual(`The hero's birthday is 4/15/88`);
|
||||
expect(birthDayEle.getText()).toEqual(`The hero's birthday is 4/15/1988`);
|
||||
let buttonEle = element(by.cssContainingText('hero-birthday2 > button', 'Toggle Format'));
|
||||
expect(buttonEle.isDisplayed()).toBe(true);
|
||||
buttonEle.click().then(function() {
|
||||
|
@ -18,9 +18,9 @@ describe('Structural Directives', function () {
|
||||
expect(allLis.get(0).getText()).toEqual('Mr. Nice');
|
||||
});
|
||||
|
||||
it('ngSwitch have two <happy-hero> instances', function () {
|
||||
it('ngSwitch have three <happy-hero> instances', function () {
|
||||
const happyHeroEls = element.all(by.tagName('happy-hero'));
|
||||
expect(happyHeroEls.count()).toEqual(2);
|
||||
expect(happyHeroEls.count()).toEqual(3);
|
||||
});
|
||||
|
||||
it('should toggle *ngIf="hero" with a button', function () {
|
||||
|
@ -55,6 +55,11 @@
|
||||
</ng-template>
|
||||
<!-- #enddocregion ngif-template -->
|
||||
|
||||
<p>template attribute</p>
|
||||
<!-- #docregion ngif-template-attr -->
|
||||
<div template="ngIf hero">{{hero.name}}</div>
|
||||
<!-- #enddocregion ngif-template-attr -->
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 id="ng-container"><ng-container></h2>
|
||||
@ -126,7 +131,14 @@
|
||||
</div>
|
||||
|
||||
<!--#enddocregion inside-ngfor -->
|
||||
<p class="code"><ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById"/></p>
|
||||
<p class="code"><div template="ngFor let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd"></p>
|
||||
<!--#docregion inside-ngfor -->
|
||||
<div template="ngFor let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd">
|
||||
({{i}}) {{hero.name}}
|
||||
</div>
|
||||
|
||||
<!--#enddocregion inside-ngfor -->
|
||||
<p class="code"><template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById"></p>
|
||||
<!--#docregion inside-ngfor -->
|
||||
<ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById">
|
||||
<div [class.odd]="odd">({{i}}) {{hero.name}}</div>
|
||||
@ -157,6 +169,16 @@
|
||||
</div>
|
||||
<!-- #enddocregion built-in, ngswitch -->
|
||||
|
||||
<h4>NgSwitch with <i>template</i> attribute</h4>
|
||||
<!-- #docregion ngswitch-template-attr -->
|
||||
<div [ngSwitch]="hero?.emotion">
|
||||
<happy-hero template="ngSwitchCase 'happy'" [hero]="hero"></happy-hero>
|
||||
<sad-hero template="ngSwitchCase 'sad'" [hero]="hero"></sad-hero>
|
||||
<confused-hero template="ngSwitchCase 'confused'" [hero]="hero"></confused-hero>
|
||||
<unknown-hero template="ngSwitchDefault" [hero]="hero"></unknown-hero>
|
||||
</div>
|
||||
<!-- #enddocregion ngswitch-template-attr -->
|
||||
|
||||
<h4>NgSwitch with <ng-template></h4>
|
||||
<!-- #docregion ngswitch-template -->
|
||||
<div [ngSwitch]="hero?.emotion">
|
||||
@ -177,7 +199,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><ng-template></h2>
|
||||
<h2><template></h2>
|
||||
<!-- #docregion template-tag -->
|
||||
<p>Hip!</p>
|
||||
<ng-template>
|
||||
@ -216,13 +238,13 @@
|
||||
<p *myUnless="condition">Show this sentence unless the condition is true.</p>
|
||||
<!-- #enddocregion myUnless-1 -->
|
||||
|
||||
<p *myUnless="condition" class="code unless">
|
||||
(A) <p *myUnless="condition" class="code unless">
|
||||
<p template="myUnless condition" class="code unless">
|
||||
(A) <p template="myUnless condition" class="code unless">
|
||||
</p>
|
||||
|
||||
<ng-template [myUnless]="condition">
|
||||
<p class="code unless">
|
||||
(A) <ng-template [myUnless]="condition">
|
||||
(A) <template [myUnless]="condition">
|
||||
</p>
|
||||
</ng-template>
|
||||
|
||||
|
@ -19,7 +19,8 @@ import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
|
||||
* ### Syntax
|
||||
*
|
||||
* - `<div *myUnless="condition">...</div>`
|
||||
* - `<ng-template [myUnless]="condition"><div>...</div></ng-template>`
|
||||
* - `<div template="myUnless condition">...</div>`
|
||||
* - `<template [myUnless]="condition"><div>...</div></template>`
|
||||
*
|
||||
// #docregion no-docs
|
||||
*/
|
||||
|
@ -78,11 +78,11 @@
|
||||
|
||||
<p>Template input variable expression context (let hero)</p>
|
||||
<!-- template hides the following; plenty of examples later -->
|
||||
<ng-template>
|
||||
<template>
|
||||
<!-- #docregion context-var -->
|
||||
<div *ngFor="let hero of heroes">{{hero.name}}</div>
|
||||
<!-- #enddocregion context-var -->
|
||||
</ng-template>
|
||||
</template>
|
||||
|
||||
<p>Template reference variable expression context (#heroInput)</p>
|
||||
<div (keyup)="0" class="context">
|
||||
|
@ -347,7 +347,7 @@ Here are the features which may require additional polyfills:
|
||||
|
||||
<td>
|
||||
|
||||
If you use the following deprecated i18n pipes: [date](api/common/DeprecatedDatePipe), [currency](api/common/DeprecatedCurrencyPipe), [decimal](api/common/DeprecatedDecimalPipe) and [percent](api/common/DeprecatedPercentPipe)
|
||||
[Date](api/common/DatePipe), [currency](api/common/CurrencyPipe), [decimal](api/common/DecimalPipe) and [percent](api/common/PercentPipe) pipes
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
@ -40,28 +40,6 @@ You need to build and deploy a separate version of the application for each supp
|
||||
|
||||
{@a i18n-attribute}
|
||||
|
||||
## i18n pipes
|
||||
|
||||
Angular pipes can help you with internationalization: the `DatePipe`, `CurrencyPipe`, `DecimalPipe`
|
||||
and `PercentPipe` use locale data to format your data based on your `LOCALE_ID`.
|
||||
|
||||
By default Angular only contains locale data for the language `en-US`, if you set the value of
|
||||
`LOCALE_ID` to another locale, you will have to import new locale data for this language:
|
||||
|
||||
<code-example path="i18n/src/app/app.locale_data.ts" region="import-locale" title="src/app/app.locale_data.ts" linenums="false">
|
||||
</code-example>
|
||||
|
||||
<div class="l-sub-section">
|
||||
|
||||
Note that the files in `@angular/common/locales` contain most of the locale data that you will
|
||||
need, but some advanced formatting options might only be available in the extra dataset that you can
|
||||
import from `@angular/common/locales/extra`:
|
||||
|
||||
<code-example path="i18n/src/app/app.locale_data_extra.ts" region="import-locale-extra" title="src/app/app.locale_data_extra.ts" linenums="false">
|
||||
</code-example>
|
||||
|
||||
</div>
|
||||
|
||||
## Mark text with the _i18n_ attribute
|
||||
|
||||
The Angular `i18n` attribute is a marker for translatable content.
|
||||
@ -178,14 +156,22 @@ Here is a _meaning_ and a _description_ and the _id_ at the end:
|
||||
|
||||
### Translate text without creating an element
|
||||
|
||||
If there is a stretch of text that you'd like to translate, you could wrap it in a `<span>` tag.
|
||||
But if you don't want to create a new DOM element merely to facilitate translation,
|
||||
you can wrap the text in an `<ng-container>` element.
|
||||
The `<ng-container>` will be transformed into an html comment:
|
||||
Suppose there is a stretch of text that you'd like to translate.
|
||||
You could wrap it in a `<span>` tag but for some reason (CSS comes to mind)
|
||||
you don't want to create a new DOM element merely to facilitate translation.
|
||||
|
||||
Here are two techniques to try.
|
||||
|
||||
(1) Wrap the text in an `<ng-container>` element. The `<ng-container>` is never rendered:
|
||||
|
||||
<code-example path="i18n/src/app/app.component.html" region="i18n-ng-container" title="src/app/app.component.html" linenums="false">
|
||||
</code-example>
|
||||
|
||||
(2) Wrap the text in a pair of HTML comments:
|
||||
|
||||
<code-example path="i18n/src/app/app.component.html" region="i18n-with-comment" title="src/app/app.component.html" linenums="false">
|
||||
</code-example>
|
||||
|
||||
{@a translate-attributes}
|
||||
|
||||
## Add _i18n_ translation attributes
|
||||
|
@ -1,176 +0,0 @@
|
||||
# Angular Language Service
|
||||
|
||||
The Angular Language Service is a way to get completions, errors,
|
||||
hints, and navigation inside your Angular templates whether they
|
||||
are external in an HTML file or embedded in annotations/decorators
|
||||
in a string. The Angular Language Service autodetects that you are
|
||||
opening an Angular file, reads your `tsconfig.json` file, finds all the
|
||||
templates you have in your application, and then provides language
|
||||
services for any templates that you open.
|
||||
|
||||
|
||||
## Autocompletion
|
||||
|
||||
Autocompletion can speed up your development time by providing you with
|
||||
contextual possibilities and hints as you type. This example shows
|
||||
autocomplete in an interpolation. As you type it out,
|
||||
you can hit tab to complete.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/language-service/language-completion.gif" alt="autocompletion">
|
||||
</figure>
|
||||
|
||||
There are also completions within
|
||||
elements. Any elements you have as a component selector will
|
||||
show up in the completion list.
|
||||
|
||||
## Error checking
|
||||
|
||||
The Angular Language Service can also forewarn you of mistakes in your code.
|
||||
In this example, Angular doesn't know what `orders` is or where it comes from.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/language-service/language-error.gif" alt="error checking">
|
||||
</figure>
|
||||
|
||||
## Navigation
|
||||
|
||||
Navigation allows you to hover to
|
||||
see where a component, directive, module, etc. is from and then
|
||||
click and press F12 to go directly to its definition.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/language-service/language-navigation.gif" alt="navigation">
|
||||
</figure>
|
||||
|
||||
|
||||
## Angular Language Service in your editor
|
||||
|
||||
Angular Language Service is currently available for [Visual Studio Code](https://code.visualstudio.com/) and
|
||||
[WebStorm](https://www.jetbrains.com/webstorm).
|
||||
|
||||
### Visual Studio Code
|
||||
|
||||
In Visual Studio Code, install Angular Language Service from the store,
|
||||
which is accessible from the bottom icon on the left menu pane.
|
||||
You can also use the VS Quick Open (⌘+P) to search for the extension. When you've opened it,
|
||||
enter the following command:
|
||||
|
||||
```sh
|
||||
ext install ng-template
|
||||
```
|
||||
|
||||
Then click the install button to install the Angular Language Service.
|
||||
|
||||
|
||||
### WebStorm
|
||||
|
||||
In webstorm, you have to install the language service as a dev dependency.
|
||||
When Angular sees this dev dependency, it provides the
|
||||
language service inside of WebStorm. Webstorm then gives you
|
||||
colorization inside the template and autocomplete in addition to the Angular Language Service.
|
||||
|
||||
Here's the dev dependency
|
||||
you need to have in `package.json`:
|
||||
|
||||
```json
|
||||
|
||||
devDependencies {
|
||||
"@angular/language-service": "^4.0.0"
|
||||
}
|
||||
```
|
||||
|
||||
Then in the terminal window at the root of your project,
|
||||
install the `devDependencies` with `npm` or `yarn`:
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
*OR*
|
||||
|
||||
```sh
|
||||
yarn
|
||||
```
|
||||
|
||||
*OR*
|
||||
|
||||
```sh
|
||||
yarn install
|
||||
```
|
||||
|
||||
|
||||
### Sublime Text
|
||||
|
||||
In [Sublime Text](https://www.sublimetext.com/), you first need an extension to allow Typescript.
|
||||
Install the latest version of typescript in a local `node_modules` directory:
|
||||
|
||||
```sh
|
||||
npm install --save-dev typescript
|
||||
```
|
||||
|
||||
Then install the Angular Language Service in the same location:
|
||||
```sh
|
||||
npm install --save-dev @angular/language-service
|
||||
```
|
||||
|
||||
Starting with TypeScript 2.3, TypeScript has a language service plugin model that the language service can use.
|
||||
|
||||
Next, in your user preferences (`Cmd+,` or `Ctrl+,`), add:
|
||||
|
||||
```json
|
||||
"typescript-tsdk": "<path to your folder>/node_modules/typescript/lib"
|
||||
```
|
||||
|
||||
|
||||
## Installing in your project
|
||||
|
||||
You can also install Angular Language Service in your project with the
|
||||
following `npm` command:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @angular/language-service
|
||||
```
|
||||
Additionally, add the following to the `"compilerOptions"` section of
|
||||
your project's `tsconfig.json`.
|
||||
|
||||
```json
|
||||
"plugins": [
|
||||
{"name": "@angular/language-service"}
|
||||
]
|
||||
```
|
||||
Note that this only provides diagnostics and completions in `.ts`
|
||||
files. You need a custom sublime plugin (or modifications to the current plugin)
|
||||
for completions in HTML files.
|
||||
|
||||
|
||||
## How the Language Service works
|
||||
|
||||
When you use an editor with a language service, there's an
|
||||
editor process which starts a separate language process/service
|
||||
to which it speaks through an [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call).
|
||||
Any time you type inside of the editor, it sends information to the other process to
|
||||
track the state of your project. When you trigger a completion list within a template, the editor process first parses the template into an HTML AST, or [abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree). Then the Angular compiler interprets
|
||||
what module the template is part of, the scope you're in, and the component selector. Then it figures out where in the template AST your cursor is. When it determines the
|
||||
context, it can then determine what the children can be.
|
||||
|
||||
It's a little more involved if you are in an interpolation. If you have an interpolation of `{{data.---}}` inside a `div` and need the completion list after `data.---`, the compiler can't use the HTML AST to find the answer. The HTML AST can only tell the compiler that there is some text with the characters "`{{data.---}}`". That's when the template parser produces an expression AST, which resides within the template AST. The Angular Language Services then looks at `data.---` within its context and asks the TypeScript Language Service what the members of data are. TypeScript then returns the list of possibilities.
|
||||
|
||||
|
||||
For more in-depth information, see the
|
||||
[Angular Language Service API](https://github.com/angular/angular/blob/master/packages/language-service/src/types.ts)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
## More on Information
|
||||
|
||||
For more information, see [Chuck Jazdzewski's presentation](https://www.youtube.com/watch?v=ez3R0Gi4z5A&t=368s) on the Angular Language
|
||||
Service from [ng-conf](https://www.ng-conf.org/) 2017.
|
||||
|
||||
|
@ -16,7 +16,7 @@ In the following example, the `@Component()` metadata object and the class const
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'app-typical',
|
||||
template: '<div>A typical component for {{data.name}}</div>'
|
||||
template: 'div>A typical component for {{data.name}}</div>
|
||||
)}
|
||||
export class TypicalComponent {
|
||||
@Input() data: TypicalData;
|
||||
@ -280,7 +280,13 @@ Most importantly, the compiler only generates code to create instances of certai
|
||||
|
||||
### New instances
|
||||
|
||||
The compiler only allows metadata that create instances of the class `InjectionToken` from `@angular/core`.
|
||||
The compiler only allows metadata that create instances of these Angular classes.
|
||||
|
||||
Class | Module
|
||||
-----------------|--------------
|
||||
`OpaqueToken` | `@angular/core`
|
||||
`InjectionToken` | `@angular/core`
|
||||
|
||||
|
||||
### Annotations/Decorators
|
||||
|
||||
|
@ -46,6 +46,24 @@ Inside the interpolation expression, you flow the component's `birthday` value t
|
||||
function on the right. All pipes work this way.
|
||||
|
||||
|
||||
<div class="l-sub-section">
|
||||
|
||||
|
||||
|
||||
The `Date` and `Currency` pipes need the *ECMAScript Internationalization API*.
|
||||
Safari and other older browsers don't support it. You can add support with a polyfill.
|
||||
|
||||
|
||||
<code-example language="html">
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
## Built-in pipes
|
||||
|
@ -208,7 +208,17 @@ Here is `*ngIf` displaying the hero's name if `hero` exists.
|
||||
|
||||
|
||||
The asterisk is "syntactic sugar" for something a bit more complicated.
|
||||
Internally, Angular translates the `*ngIf` _attribute_ into a `<ng-template>` _element_, wrapped around the host element, like this.
|
||||
Internally, Angular desugars it in two stages.
|
||||
First, it translates the `*ngIf="..."` into a template _attribute_, `template="ngIf ..."`, like this.
|
||||
|
||||
|
||||
<code-example path="structural-directives/src/app/app.component.html" linenums="false" title="src/app/app.component.html (ngif-template-attr)" region="ngif-template-attr">
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
|
||||
Then it translates the template _attribute_ into a `<ng-template>` _element_, wrapped around the host element, like this.
|
||||
|
||||
|
||||
<code-example path="structural-directives/src/app/app.component.html" linenums="false" title="src/app/app.component.html (ngif-template)" region="ngif-template">
|
||||
@ -220,7 +230,8 @@ Internally, Angular translates the `*ngIf` _attribute_ into a `<ng-template>` _e
|
||||
* The `*ngIf` directive moved to the `<ng-template>` element where it became a property binding,`[ngIf]`.
|
||||
* The rest of the `<div>`, including its class attribute, moved inside the `<ng-template>` element.
|
||||
|
||||
The first form is not actually rendered, only the finished product ends up in the DOM.
|
||||
None of these forms are actually rendered.
|
||||
Only the finished product ends up in the DOM.
|
||||
|
||||
|
||||
<figure>
|
||||
@ -241,9 +252,10 @@ The [`NgFor`](guide/structural-directives#ngFor) and [`NgSwitch...`](guide/struc
|
||||
|
||||
## Inside _*ngFor_
|
||||
|
||||
Angular transforms the `*ngFor` in similar fashion from asterisk (*) syntax to `<ng-template>` _element_.
|
||||
Angular transforms the `*ngFor` in similar fashion from asterisk (*) syntax through
|
||||
template _attribute_ to `<ng-template>` _element_.
|
||||
|
||||
Here's a full-featured application of `NgFor`, written both ways:
|
||||
Here's a full-featured application of `NgFor`, written all three ways:
|
||||
|
||||
|
||||
<code-example path="structural-directives/src/app/app.component.html" linenums="false" title="src/app/app.component.html (inside-ngfor)" region="inside-ngfor">
|
||||
@ -301,7 +313,7 @@ It's intended source is implicit.
|
||||
Angular sets `let-hero` to the value of the context's `$implicit` property
|
||||
which `NgFor` has initialized with the hero for the current iteration.
|
||||
|
||||
* The [API guide](api/common/NgForOf "API: NgFor")
|
||||
* The [API guide](api/common/NgFor "API: NgFor")
|
||||
describes additional `NgFor` directive properties and context properties.
|
||||
|
||||
These microsyntax mechanisms are available to you when you write your own structural directives.
|
||||
@ -403,7 +415,16 @@ The `<unknown-hero>` is the host element for the `*ngSwitchDefault`.
|
||||
|
||||
|
||||
As with other structural directives, the `NgSwitchCase` and `NgSwitchDefault`
|
||||
can be desugared into the `<ng-template>` element form.
|
||||
can be desugared into the template _attribute_ form.
|
||||
|
||||
|
||||
<code-example path="structural-directives/src/app/app.component.html" linenums="false" title="src/app/app.component.html (ngswitch-template-attr)" region="ngswitch-template-attr">
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
|
||||
That, in turn, can be desugared into the `<ng-template>` element form.
|
||||
|
||||
|
||||
<code-example path="structural-directives/src/app/app.component.html" linenums="false" title="src/app/app.component.html (ngswitch-template)" region="ngswitch-template">
|
||||
@ -417,7 +438,7 @@ can be desugared into the `<ng-template>` element form.
|
||||
|
||||
## Prefer the asterisk (*) syntax.
|
||||
|
||||
The asterisk (*) syntax is more clear than the desugared form.
|
||||
The asterisk (*) syntax is more clear than the other desugared forms.
|
||||
Use [<ng-container>](guide/structural-directives#ng-container) when there's no single element
|
||||
to host the directive.
|
||||
|
||||
|
@ -1361,8 +1361,8 @@ to group elements when there is no suitable host element for the directive.
|
||||
_This_ section is an introduction to the common structural directives:
|
||||
|
||||
* [`NgIf`](guide/template-syntax#ngIf) - conditionally add or remove an element from the DOM
|
||||
* [`NgFor`](guide/template-syntax#ngFor) - repeat a template for each item in a list
|
||||
* [`NgSwitch`](guide/template-syntax#ngSwitch) - a set of directives that switch among alternative views
|
||||
* [NgForOf](guide/template-syntax#ngFor) - repeat a template for each item in a list
|
||||
|
||||
<hr/>
|
||||
|
||||
@ -1437,18 +1437,18 @@ described below.
|
||||
|
||||
{@a ngFor}
|
||||
|
||||
### NgForOf
|
||||
### NgFor
|
||||
|
||||
`NgForOf` is a _repeater_ directive — a way to present a list of items.
|
||||
`NgFor` is a _repeater_ directive — a way to present a list of items.
|
||||
You define a block of HTML that defines how a single item should be displayed.
|
||||
You tell Angular to use that block as a template for rendering each item in the list.
|
||||
|
||||
Here is an example of `NgForOf` applied to a simple `<div>`:
|
||||
Here is an example of `NgFor` applied to a simple `<div>`:
|
||||
|
||||
<code-example path="template-syntax/src/app/app.component.html" region="NgFor-1" title="src/app/app.component.html" linenums="false">
|
||||
</code-example>
|
||||
|
||||
You can also apply an `NgForOf` to a component element, as in this example:
|
||||
You can also apply an `NgFor` to a component element, as in this example:
|
||||
|
||||
<code-example path="template-syntax/src/app/app.component.html" region="NgFor-2" title="src/app/app.component.html" linenums="false">
|
||||
</code-example>
|
||||
@ -1485,10 +1485,10 @@ Learn about the _microsyntax_ in the [_Structural Directives_](guide/structural-
|
||||
### Template input variables
|
||||
|
||||
The `let` keyword before `hero` creates a _template input variable_ called `hero`.
|
||||
The `NgForOf` directive iterates over the `heroes` array returned by the parent component's `heroes` property
|
||||
The `ngFor` directive iterates over the `heroes` array returned by the parent component's `heroes` property
|
||||
and sets `hero` to the current item from the array during each iteration.
|
||||
|
||||
You reference the `hero` input variable within the `NgForOf` host element
|
||||
You reference the `hero` input variable within the `ngFor` host element
|
||||
(and within its descendents) to access the hero's properties.
|
||||
Here it is referenced first in an interpolation
|
||||
and then passed in a binding to the `hero` property of the `<hero-detail>` component.
|
||||
@ -1501,7 +1501,7 @@ Learn more about _template input variables_ in the
|
||||
|
||||
#### *ngFor with _index_
|
||||
|
||||
The `index` property of the `NgForOf` directive context returns the zero-based index of the item in each iteration.
|
||||
The `index` property of the `NgFor` directive context returns the zero-based index of the item in each iteration.
|
||||
You can capture the `index` in a template input variable and use it in the template.
|
||||
|
||||
The next example captures the `index` in a variable named `i` and displays it with the hero name like this.
|
||||
@ -1511,8 +1511,8 @@ The next example captures the `index` in a variable named `i` and displays it wi
|
||||
|
||||
<div class="l-sub-section">
|
||||
|
||||
Learn about the other `NgForOf` context values such as `last`, `even`,
|
||||
and `odd` in the [NgForOf API reference](api/common/NgForOf).
|
||||
Learn about the other `NgFor` context values such as `last`, `even`,
|
||||
and `odd` in the [NgFor API reference](api/common/NgFor).
|
||||
|
||||
</div>
|
||||
|
||||
@ -1520,7 +1520,7 @@ and `odd` in the [NgForOf API reference](api/common/NgForOf).
|
||||
|
||||
#### *ngFor with _trackBy_
|
||||
|
||||
The `NgForOf` directive may perform poorly, especially with large lists.
|
||||
The `NgFor` directive may perform poorly, especially with large lists.
|
||||
A small change to one item, an item removed, or an item added can trigger a cascade of DOM manipulations.
|
||||
|
||||
For example, re-querying the server could reset the list with all new hero objects.
|
||||
@ -1531,7 +1531,7 @@ But Angular sees only a fresh list of new object references.
|
||||
It has no choice but to tear down the old DOM elements and insert all new DOM elements.
|
||||
|
||||
Angular can avoid this churn with `trackBy`.
|
||||
Add a method to the component that returns the value `NgForOf` _should_ track.
|
||||
Add a method to the component that returns the value `NgFor` _should_ track.
|
||||
In this case, that value is the hero's `id`.
|
||||
|
||||
<code-example path="template-syntax/src/app/app.component.ts" region="trackByHeroes" title="src/app/app.component.ts" linenums="false">
|
||||
|
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 274 KiB |
Before Width: | Height: | Size: 857 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 17 KiB |
BIN
aio/content/images/guide/structural-directives/template-rendering.png
Executable file → Normal file
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 6.9 KiB |
@ -1,10 +1,10 @@
|
||||
<!-- FULL HEADER BLOCK -->
|
||||
<!--FULL HEADER BLOCK-->
|
||||
<header>
|
||||
|
||||
<!-- BACKGROUND IMAGE -->
|
||||
<!--BACKGROUND IMAGE-->
|
||||
<div class="background-sky hero"></div>
|
||||
|
||||
<!-- INTRO SECTION -->
|
||||
<!--INTRO SECTION -->
|
||||
<section id="intro">
|
||||
|
||||
<!-- LOGO -->
|
||||
@ -12,33 +12,31 @@
|
||||
<img src="assets/images/logos/angular/angular.svg"/>
|
||||
</div>
|
||||
|
||||
<!-- CONTAINER -->
|
||||
<!-- CONTAINER -->
|
||||
<div class="homepage-container">
|
||||
<!-- container content starts -->
|
||||
|
||||
<div class="hero-headline no-toc">One framework.<br>Mobile & desktop.</div>
|
||||
<a class="button hero-cta" href="guide/quickstart">Get Started</a>
|
||||
</div>
|
||||
|
||||
</div><!-- CONTAINER END -->
|
||||
</section>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<!-- MAIN CONTENT -->
|
||||
<article>
|
||||
|
||||
<h1 class="no-toc" style="display: none"></h1>
|
||||
|
||||
<div class="home-rows">
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<!--Announcement Bar-->
|
||||
<div class="homepage-container">
|
||||
<div class="announcement-bar">
|
||||
<img src="generated/images/marketing/home/angular-mix.png" height="40" width="151">
|
||||
<p>Join us at our newest event, October 2017</p>
|
||||
<a class="button" href="https://angularmix.com/">Learn More</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Group 1 -->
|
||||
<!-- Group 1-->
|
||||
<div layout="row" layout-xs="column" class="home-row homepage-container">
|
||||
<div class="promo-img-container promo-1">
|
||||
<div>
|
||||
@ -55,8 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<!-- Group 2 -->
|
||||
<!-- Group 2-->
|
||||
<div layout="row" layout-xs="column" class="home-row">
|
||||
<div class="text-container">
|
||||
<div class="text-block">
|
||||
@ -74,7 +71,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<!-- Group 3 -->
|
||||
<!-- Group 3-->
|
||||
<div layout="row" layout-xs="column" class="home-row">
|
||||
<div class="promo-img-container promo-3">
|
||||
<div><img src="generated/images/marketing/home/joyful-development.svg" alt="IDE example"></div>
|
||||
@ -91,8 +88,9 @@
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<!-- Group 4 -->
|
||||
<!-- Group 4-->
|
||||
<div layout="row" layout-xs="column" class="home-row">
|
||||
|
||||
<div class="text-container">
|
||||
<div class="text-block l-pad-top-2">
|
||||
<div class="text-headline">Loved by Millions</div>
|
||||
@ -107,19 +105,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CTA CARDS -->
|
||||
<div layout="row" layout-xs="column" class="home-row">
|
||||
<a href="guide/quickstart">
|
||||
<div class="card">
|
||||
<!-- CTA CARDS -->
|
||||
<div layout="row" layout-xs="column" class="home-row">
|
||||
|
||||
<a href="guide/quickstart">
|
||||
<div class="card">
|
||||
<img src="generated/images/marketing/home/code-icon.svg" height="70px">
|
||||
<div class="card-text-container">
|
||||
<div class="text-headline">Get Started</div>
|
||||
<p>Start building your Angular application.</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div><!-- end of home rows -->
|
||||
</div> <!-- end of home rows -->
|
||||
|
||||
</article>
|
||||
|
@ -288,11 +288,6 @@
|
||||
"title": "Internationalization (i18n)",
|
||||
"tooltip": "Translate the app's template text into multiple languages."
|
||||
},
|
||||
{
|
||||
"url": "guide/language-service",
|
||||
"title": "Language Service",
|
||||
"tooltip": "Use Angular Language Service to speed up dev time."
|
||||
},
|
||||
{
|
||||
"url": "guide/security",
|
||||
"title": "Security",
|
||||
|
@ -2,13 +2,9 @@
|
||||
|
||||
set -u -e -o pipefail
|
||||
|
||||
declare -A payloadLimits
|
||||
payloadLimits["aio", "uncompressed", "inline"]=1600
|
||||
payloadLimits["aio", "uncompressed", "main"]=525000
|
||||
payloadLimits["aio", "uncompressed", "polyfills"]=38000
|
||||
payloadLimits["aio", "gzip7", "inline"]=1000
|
||||
payloadLimits["aio", "gzip7", "main"]=127000
|
||||
payloadLimits["aio", "gzip7", "polyfills"]=12500
|
||||
payloadLimits["aio", "gzip9", "inline"]=1000
|
||||
payloadLimits["aio", "gzip9", "main"]=127000
|
||||
payloadLimits["aio", "gzip9", "polyfills"]=12500
|
||||
declare -A limitUncompressed
|
||||
limitUncompressed=(["inline"]=1600 ["main"]=525000 ["polyfills"]=38000)
|
||||
declare -A limitGzip7
|
||||
limitGzip7=(["inline"]=1000 ["main"]=127000 ["polyfills"]=12500)
|
||||
declare -A limitGzip9
|
||||
limitGzip9=(["inline"]=1000 ["main"]=127000 ["polyfills"]=12500)
|
||||
|
@ -27,7 +27,7 @@ else
|
||||
readonly majorVersionStable=${STABLE_BRANCH%%.*}
|
||||
|
||||
# Do not deploy if the major version is not less than the stable branch major version
|
||||
if [[ !( "$majorVersion" < "$majorVersionStable" ) ]]; then
|
||||
if [[ $majorVersion -ge $majorVersionStable ]]; then
|
||||
echo "Skipping deploy of branch \"${TRAVIS_BRANCH}\" to firebase."
|
||||
echo "We only deploy archive branches with the major version less than the stable branch: \"${STABLE_BRANCH}\""
|
||||
exit 0
|
||||
|
@ -4,10 +4,79 @@ set -eu -o pipefail
|
||||
|
||||
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||
readonly parentDir=$(dirname $thisDir)
|
||||
readonly PROJECT_NAME="angular-payload-size"
|
||||
|
||||
# Track payload size functions
|
||||
source ../scripts/ci/payload-size.sh
|
||||
source ${thisDir}/_payload-limits.sh
|
||||
|
||||
trackPayloadSize "aio" "dist/*.bundle.js" true true
|
||||
failed=false
|
||||
payloadData=""
|
||||
for filename in dist/*.bundle.js; do
|
||||
size=$(stat -c%s "$filename")
|
||||
label=$(echo "$filename" | sed "s/.*\///" | sed "s/\..*//")
|
||||
payloadData="$payloadData\"uncompressed/$label\": $size, "
|
||||
|
||||
|
||||
gzip -7 $filename -c >> "${filename}7.gz"
|
||||
size7=$(stat -c%s "${filename}7.gz")
|
||||
payloadData="$payloadData\"gzip7/$label\": $size7, "
|
||||
|
||||
gzip -9 $filename -c >> "${filename}9.gz"
|
||||
size9=$(stat -c%s "${filename}9.gz")
|
||||
payloadData="$payloadData\"gzip9/$label\": $size9, "
|
||||
|
||||
if [[ $size -gt ${limitUncompressed[$label]} ]]; then
|
||||
failed=true
|
||||
echo "Uncompressed $label size is $size which is greater than ${limitUncompressed[$label]}"
|
||||
elif [[ $size7 -gt ${limitGzip7[$label]} ]]; then
|
||||
failed=true
|
||||
echo "Gzip7 $label size is $size7 which is greater than ${limitGzip7[$label]}"
|
||||
elif [[ $size9 -gt ${limitGzip9[$label]} ]]; then
|
||||
failed=true
|
||||
echo "Gzip9 $label size is $size9 which is greater than ${limitGzip9[$label]}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Add Timestamp
|
||||
timestamp=$(date +%s)
|
||||
payloadData="$payloadData\"timestamp\": $timestamp, "
|
||||
|
||||
# Add change source: application, dependencies, or 'application+dependencies'
|
||||
applicationChanged=false
|
||||
dependenciesChanged=false
|
||||
if [[ $(git diff --name-only $TRAVIS_COMMIT_RANGE $parentDir | grep -v aio/yarn.lock | grep -v content) ]]; then
|
||||
applicationChanged=true
|
||||
fi
|
||||
if [[ $(git diff --name-only $TRAVIS_COMMIT_RANGE $parentDir/yarn.lock) ]]; then
|
||||
dependenciesChanged=true
|
||||
fi
|
||||
|
||||
if $dependenciesChanged && $applicationChanged; then
|
||||
change='application+dependencies'
|
||||
elif $dependenciesChanged; then
|
||||
# only yarn.lock changed
|
||||
change='dependencies'
|
||||
elif $applicationChanged; then
|
||||
change='application'
|
||||
else
|
||||
# Nothing changed in aio/
|
||||
exit 0
|
||||
fi
|
||||
message=$(echo $TRAVIS_COMMIT_MESSAGE | sed 's/"/\\"/g' | sed 's/\\/\\\\/g')
|
||||
payloadData="$payloadData\"change\": \"$change\", \"message\": \"$message\""
|
||||
|
||||
payloadData="{${payloadData}}"
|
||||
|
||||
echo $payloadData
|
||||
|
||||
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
|
||||
readonly safeBranchName=$(echo $TRAVIS_BRANCH | sed -e 's/\./_/g')
|
||||
readonly dbPath=/payload/aio/$safeBranchName/$TRAVIS_COMMIT
|
||||
|
||||
# WARNING: FIREBASE_TOKEN should NOT be printed.
|
||||
set +x
|
||||
firebase database:update --data "$payloadData" --project $PROJECT_NAME --confirm --token "$ANGULAR_PAYLOAD_FIREBASE_TOKEN" $dbPath
|
||||
fi
|
||||
|
||||
if [[ $failed = true ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -41,9 +41,12 @@ const ANGULAR_PACKAGES = [
|
||||
'platform-browser-dynamic',
|
||||
'platform-server',
|
||||
'router',
|
||||
'tsc-wrapped',
|
||||
'upgrade',
|
||||
];
|
||||
const ANGULAR_TOOLS_PACKAGES_PATH = path.resolve(ANGULAR_DIST_PATH, 'tools', '@angular');
|
||||
const ANGULAR_TOOLS_PACKAGES = [
|
||||
'tsc-wrapped'
|
||||
];
|
||||
|
||||
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
|
||||
|
||||
@ -60,6 +63,7 @@ class ExampleBoilerPlate {
|
||||
// Replace the Angular packages with those from the dist folder, if necessary
|
||||
if (useLocal) {
|
||||
ANGULAR_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_PACKAGES_PATH, packageName));
|
||||
ANGULAR_TOOLS_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_TOOLS_PACKAGES_PATH, packageName));
|
||||
}
|
||||
|
||||
// Get all the examples folders, indicated by those that contain a `example-config.json` file
|
||||
@ -133,4 +137,4 @@ module.exports = new ExampleBoilerPlate();
|
||||
// If this file was run directly then run the main function,
|
||||
if (require.main === module) {
|
||||
module.exports.main();
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ describe('example-boilerplate tool', () => {
|
||||
// for example
|
||||
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'common');
|
||||
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'core');
|
||||
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'tsc-wrapped');
|
||||
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/tools/@angular'), 'tsc-wrapped');
|
||||
});
|
||||
|
||||
it('should process all the example folders', () => {
|
||||
|
@ -34,5 +34,5 @@ function getText(h1) {
|
||||
(node.properties.ariaHidden === 'true' || node.properties['aria-hidden'] === 'true')
|
||||
));
|
||||
|
||||
return cleaned ? toString(cleaned) : '';
|
||||
}
|
||||
return toString(cleaned);
|
||||
}
|
@ -69,14 +69,4 @@ describe('h1Checker postprocessor', () => {
|
||||
processor.$process([doc]);
|
||||
expect(doc.vFile.title).toEqual('What is Angular?');
|
||||
});
|
||||
|
||||
it('should not break if the h1 is empty (except for an aria-hidden anchor)', () => {
|
||||
const doc = {
|
||||
docType: 'a',
|
||||
renderedContent: `
|
||||
<h1><a aria-hidden="true"></a></h1>
|
||||
`
|
||||
};
|
||||
expect(() => processor.$process([doc])).not.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
184
build.sh
@ -26,8 +26,7 @@ PACKAGES=(core
|
||||
benchpress)
|
||||
|
||||
NODE_PACKAGES=(compiler-cli
|
||||
benchpress
|
||||
tsc-wrapped)
|
||||
benchpress)
|
||||
|
||||
BUILD_ALL=true
|
||||
BUNDLE=true
|
||||
@ -87,7 +86,7 @@ done
|
||||
#######################################
|
||||
isIgnoredDirectory() {
|
||||
name=$(basename ${1})
|
||||
if [[ -f "${1}" || "${name}" == "src" || "${name}" == "test" || "${name}" == "integrationtest" || "${name}" == "locales" ]]; then
|
||||
if [[ -f "${1}" || "${name}" == "src" || "${name}" == "test" || "${name}" == "integrationtest" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@ -108,37 +107,77 @@ containsElement () {
|
||||
return 1
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Downlevel ES2015 to ESM/ES5
|
||||
# Arguments:
|
||||
# param1 - Source folder
|
||||
# param2 - Naming suffix to apply. Must end in ".ts" (defaults to .es5.ts)
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
downlevelES2015() {
|
||||
# Iterate over the files in this directory, converting to .es5.ts
|
||||
regex="(.+).js"
|
||||
for file in ${1}/*.js ; do
|
||||
if [[ ${file} =~ $regex ]]; then
|
||||
ts_file="${BASH_REMATCH[1]}${2:-".es5.ts"}"
|
||||
cp ${file} ${ts_file}
|
||||
|
||||
echo "====== $TSC ${ts_file} --target es5 --module es2015 --noLib --sourceMap --importHelpers"
|
||||
($TSC ${ts_file} --target es5 --module es2015 --noLib --sourceMap --importHelpers) > /dev/null 2>&1 || true
|
||||
mapSources "${BASH_REMATCH[1]}${2:-".es5.js"}"
|
||||
rm -f ${ts_file}
|
||||
fi
|
||||
done
|
||||
|
||||
# Recurse for sub directories
|
||||
for DIR in ${1}/* ; do
|
||||
isIgnoredDirectory ${DIR} && continue
|
||||
downlevelES2015 ${DIR}
|
||||
done
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Rollup index files recursively, ignoring blacklisted directories
|
||||
# Arguments:
|
||||
# param1 - Base source folder
|
||||
# param2 - Destination directory
|
||||
# param3 - Config file
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
rollupIndex() {
|
||||
# Iterate over the files in this directory, rolling up each into ${2} directory
|
||||
local regex=".+/(.+)/index.js"
|
||||
in_file="${1}/index.js"
|
||||
out_file="${2}/index.js"
|
||||
if [[ "${1}/index.js" =~ $regex ]]; then
|
||||
in_file="${1}/index.js"
|
||||
out_file="${2}/${BASH_REMATCH[1]}.js"
|
||||
|
||||
BANNER_TEXT=`cat ${LICENSE_BANNER}`
|
||||
echo "====== $ROLLUP -i ${in_file} -o ${out_file}"
|
||||
|
||||
if [[ -f ${in_file} ]]; then
|
||||
echo "=========== $ROLLUP -i ${in_file} -o ${out_file} -c ${ROOT_DIR}/rollup.config.js --sourcemap"
|
||||
$ROLLUP -i ${in_file} -o ${out_file} --sourcemap -f es --banner "$BANNER_TEXT" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Recurse for sub directories
|
||||
for DIR in ${1}/* ; do
|
||||
isIgnoredDirectory ${DIR} && continue
|
||||
# NOTE: We need to re-run this regex and use the new match as Bash doesn't have closures
|
||||
if [[ "${DIR}/index.js" =~ $regex ]]; then
|
||||
rollupIndex ${DIR} ${2}/${BASH_REMATCH[1]}
|
||||
if [[ -f "${3}" ]]; then
|
||||
$ROLLUP -i ${in_file} -o ${out_file} -c ${3} --sourcemap
|
||||
else
|
||||
$ROLLUP -i ${in_file} -o ${out_file} --sourcemap
|
||||
fi
|
||||
done
|
||||
cat ${LICENSE_BANNER} > ${out_file}.tmp
|
||||
cat ${out_file} >> ${out_file}.tmp
|
||||
mv ${out_file}.tmp ${out_file}
|
||||
|
||||
mapSources "${out_file}"
|
||||
|
||||
# Recurse for sub directories
|
||||
for DIR in ${1}/* ; do
|
||||
isIgnoredDirectory ${DIR} && continue
|
||||
# NOTE: We need to re-run this regex and use the new match as Bash doesn't have closures
|
||||
if [[ "${1}/index.js" =~ $regex ]]; then
|
||||
rollupIndex ${DIR} ${2}/${BASH_REMATCH[1]} "$(dirname $3)/${BASH_REMATCH[1]}/rollup.config.js"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#######################################
|
||||
# Recursively runs rollup on any entry point that has a "rollup.config.js" file
|
||||
# Arguments:
|
||||
@ -147,11 +186,17 @@ rollupIndex() {
|
||||
# None
|
||||
#######################################
|
||||
runRollup() {
|
||||
local regex="dest: ['\"](.+)['\"],*"
|
||||
if [[ -f "${1}/rollup.config.js" ]]; then
|
||||
cd ${1}
|
||||
|
||||
echo "====== $ROLLUP -c ${1}/rollup.config.js"
|
||||
$ROLLUP -c rollup.config.js --sourcemap >/dev/null 2>&1
|
||||
$ROLLUP -c rollup.config.js --sourcemap
|
||||
|
||||
local dest_line=$(cat "${1}/rollup.config.js" | grep 'dest:')
|
||||
if [[ ${dest_line} =~ $regex ]]; then
|
||||
mapSources "${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
# Recurse for sub directories
|
||||
for DIR in ${1}/* ; do
|
||||
@ -196,6 +241,7 @@ minify() {
|
||||
if [[ "${base_file}" =~ $regex && "${base_file##*.}" != "map" ]]; then
|
||||
local out_file=$(dirname "${file}")/${BASH_REMATCH[1]}.min.js
|
||||
$UGLIFYJS -c --screw-ie8 --comments -o ${out_file} --source-map ${out_file}.map --source-map-include-sources ${file}
|
||||
mapSources "${out_file}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@ -206,18 +252,19 @@ minify() {
|
||||
# param1 - Source directory
|
||||
# param2 - Out dir
|
||||
# param3 - Package Name
|
||||
# param4 - Is child (are we recursing?)
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
compilePackage() {
|
||||
echo "====== [${3}]: COMPILING: ${NGC} -p ${1}/tsconfig-build.json"
|
||||
# For NODE_PACKAGES items (not getting rolled up)
|
||||
if containsElement "${3}" "${NODE_PACKAGES[@]}"; then
|
||||
if containsElement "${PACKAGE}" "${NODE_PACKAGES[@]}"; then
|
||||
$TSC -p ${1}/tsconfig-build.json
|
||||
else
|
||||
local package_name=$(basename "${2}")
|
||||
$NGC -p ${1}/tsconfig-build.json
|
||||
echo "====== Create ${1}/../${package_name}.d.ts re-export file for tsickle"
|
||||
echo "====== Create ${1}/../${package_name}.d.ts re-export file for Closure"
|
||||
echo "$(cat ${LICENSE_BANNER}) ${N} export * from './${package_name}/index'" > ${2}/../${package_name}.d.ts
|
||||
echo "{\"__symbolic\":\"module\",\"version\":3,\"metadata\":{},\"exports\":[{\"from\":\"./${package_name}/index\"}],\"flatModuleIndexRedirect\":true}" > ${2}/../${package_name}.metadata.json
|
||||
fi
|
||||
@ -227,31 +274,24 @@ compilePackage() {
|
||||
BASE_DIR=$(basename "${DIR}")
|
||||
# Skip over directories that are not nested entry points
|
||||
[[ -e ${DIR}/tsconfig-build.json && "${BASE_DIR}" != "integrationtest" ]] || continue
|
||||
compilePackage ${DIR} ${2}/${BASE_DIR} ${3}
|
||||
compilePackage ${DIR} ${2}/${BASE_DIR} ${3} true
|
||||
done
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Recursively compile package
|
||||
# Moves typings and metadata files appropriately
|
||||
# Arguments:
|
||||
# param1 - Source directory
|
||||
# param2 - Out dir
|
||||
# param3 - Package Name
|
||||
# param1 - Source of typings & metadata files
|
||||
# param2 - Root of destination directory
|
||||
# param3 - Package name (needed to correspond to name of d.ts and metadata.json files)
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
compilePackageES5() {
|
||||
echo "====== [${3}]: COMPILING: ${NGC} -p ${1}/tsconfig-build.json --target es5 -d false --outDir ${2} --importHelpers true --sourceMap"
|
||||
local package_name=$(basename "${2}")
|
||||
$NGC -p ${1}/tsconfig-build.json --target es5 -d false --outDir ${2} --importHelpers true --sourceMap
|
||||
|
||||
for DIR in ${1}/* ; do
|
||||
[ -d "${DIR}" ] || continue
|
||||
BASE_DIR=$(basename "${DIR}")
|
||||
# Skip over directories that are not nested entry points
|
||||
[[ -e ${DIR}/tsconfig-build.json && "${BASE_DIR}" != "integrationtest" ]] || continue
|
||||
compilePackageES5 ${DIR} ${2} ${3}
|
||||
done
|
||||
moveTypings() {
|
||||
if [[ -f ${1}/index.d.ts && -f ${1}/index.metadata.json ]]; then
|
||||
mv ${1}/index.d.ts ${1}/${2}.d.ts
|
||||
mv ${1}/index.metadata.json ${1}/${2}.metadata.json
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
@ -274,14 +314,17 @@ addNgcPackageJson() {
|
||||
done
|
||||
}
|
||||
|
||||
updateVersionReferences() {
|
||||
NPM_DIR="$1"
|
||||
(
|
||||
echo "====== VERSION: Updating version references in ${NPM_DIR}"
|
||||
cd ${NPM_DIR}
|
||||
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-PLACEHOLDER/${VERSION}/g\" $""(grep -ril 0\.0\.0\-PLACEHOLDER .)"
|
||||
perl -p -i -e "s/0\.0\.0\-PLACEHOLDER/${VERSION}/g" $(grep -ril 0\.0\.0\-PLACEHOLDER .) < /dev/null 2> /dev/null
|
||||
)
|
||||
#######################################
|
||||
# This is read by NGC to be able to find the flat module index.
|
||||
# Arguments:
|
||||
# param1 - JavaScript file on which to re-map sources
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
mapSources() {
|
||||
if [[ -f "${1}.map" ]]; then
|
||||
$MAP_SOURCES -f "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
VERSION="${VERSION_PREFIX}${VERSION_SUFFIX}"
|
||||
@ -290,7 +333,8 @@ echo "====== BUILDING: Version ${VERSION}"
|
||||
N="
|
||||
"
|
||||
TSC=`pwd`/node_modules/.bin/tsc
|
||||
NGC="node --max-old-space-size=3000 `pwd`/dist/packages-dist/tsc-wrapped/src/main"
|
||||
NGC="node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main"
|
||||
MAP_SOURCES="node `pwd`/scripts/build/map_sources.js "
|
||||
UGLIFYJS=`pwd`/node_modules/.bin/uglifyjs
|
||||
TSCONFIG=./tools/tsconfig.json
|
||||
ROLLUP=`pwd`/node_modules/.bin/rollup
|
||||
@ -301,6 +345,8 @@ if [[ ${BUILD_TOOLS} == true ]]; then
|
||||
rm -rf ./dist/tools/
|
||||
mkdir -p ./dist/tools/
|
||||
$(npm bin)/tsc -p ${TSCONFIG}
|
||||
|
||||
cp ./tools/@angular/tsc-wrapped/package.json ./dist/tools/@angular/tsc-wrapped
|
||||
travisFoldEnd "build tools"
|
||||
fi
|
||||
|
||||
@ -352,11 +398,11 @@ if [[ ${BUILD_ALL} == true && ${TYPECHECK_ALL} == true ]]; then
|
||||
|
||||
TSCONFIG="packages/tsconfig.json"
|
||||
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
|
||||
$TSC -p ${TSCONFIG}
|
||||
$NGC -p ${TSCONFIG}
|
||||
travisFoldEnd "tsc -p ${TSCONFIG}"
|
||||
TSCONFIG="modules/tsconfig.json"
|
||||
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
|
||||
$TSC -p ${TSCONFIG}
|
||||
$NGC -p ${TSCONFIG}
|
||||
travisFoldEnd "tsc -p ${TSCONFIG}"
|
||||
|
||||
fi
|
||||
@ -368,22 +414,6 @@ if [[ ${BUILD_ALL} == true ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${BUILD_TOOLS} == true || ${BUILD_ALL} == true ]]; then
|
||||
echo "====== (tsc-wrapped)COMPILING: \$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig.json ====="
|
||||
$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig.json
|
||||
echo "====== (tsc-wrapped)COMPILING: \$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig-build.json ====="
|
||||
$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig-build.json
|
||||
cp ./packages/tsc-wrapped/package.json ./dist/packages-dist/tsc-wrapped
|
||||
cp ./packages/tsc-wrapped/README.md ./dist/packages-dist/tsc-wrapped
|
||||
updateVersionReferences dist/packages-dist/tsc-wrapped
|
||||
|
||||
rsync -a packages/bazel/ ./dist/packages-dist/bazel
|
||||
# Remove BEGIN-INTERNAL...END-INTERAL blocks
|
||||
# https://stackoverflow.com/questions/24175271/how-can-i-match-multi-line-patterns-in-the-command-line-with-perl-style-regex
|
||||
perl -0777 -n -i -e "s/(?m)^.*BEGIN-INTERNAL[\w\W]*END-INTERNAL.*\n//g; print" $(grep -ril BEGIN-INTERNAL dist/packages-dist/bazel) < /dev/null 2> /dev/null
|
||||
updateVersionReferences dist/packages-dist/bazel
|
||||
fi
|
||||
|
||||
for PACKAGE in ${PACKAGES[@]}
|
||||
do
|
||||
travisFoldStart "build package: ${PACKAGE}" "no-xtrace"
|
||||
@ -392,10 +422,8 @@ do
|
||||
SRC_DIR=${ROOT_DIR}/${PACKAGE}
|
||||
ROOT_OUT_DIR=${PWD}/dist/packages
|
||||
OUT_DIR=${ROOT_OUT_DIR}/${PACKAGE}
|
||||
OUT_DIR_ESM5=${ROOT_OUT_DIR}/${PACKAGE}/esm5
|
||||
NPM_DIR=${PWD}/dist/packages-dist/${PACKAGE}
|
||||
ESM15_DIR=${NPM_DIR}/esm15
|
||||
ESM5_DIR=${NPM_DIR}/esm5
|
||||
MODULES_DIR=${NPM_DIR}/@angular
|
||||
BUNDLES_DIR=${NPM_DIR}/bundles
|
||||
|
||||
LICENSE_BANNER=${ROOT_DIR}/license-banner.txt
|
||||
@ -414,15 +442,15 @@ do
|
||||
|
||||
echo "====== Copy ${PACKAGE} typings"
|
||||
rsync -a --exclude=*.js --exclude=*.js.map ${OUT_DIR}/ ${NPM_DIR}
|
||||
moveTypings ${NPM_DIR} ${PACKAGE}
|
||||
|
||||
(
|
||||
cd ${SRC_DIR}
|
||||
echo "====== Rollup ${PACKAGE}"
|
||||
rollupIndex ${OUT_DIR} ${ESM15_DIR} ${ROOT_DIR}
|
||||
rollupIndex ${OUT_DIR} ${MODULES_DIR} ${ROOT_DIR}
|
||||
|
||||
echo "====== Produce ESM5 version"
|
||||
compilePackageES5 ${SRC_DIR} ${OUT_DIR_ESM5} ${PACKAGE}
|
||||
rollupIndex ${OUT_DIR_ESM5} ${ESM5_DIR} ${ROOT_DIR}
|
||||
echo "====== Downleveling ES2015 to ESM/ES5"
|
||||
downlevelES2015 ${MODULES_DIR}
|
||||
|
||||
echo "====== Run rollup conversions on ${PACKAGE}"
|
||||
runRollup ${SRC_DIR}
|
||||
@ -430,11 +458,6 @@ do
|
||||
minify ${BUNDLES_DIR}
|
||||
|
||||
) 2>&1 | grep -v "as external dependency"
|
||||
|
||||
if [[ ${PACKAGE} == "common" ]]; then
|
||||
echo "====== Copy i18n locale data"
|
||||
rsync -a --exclude=*.d.ts --exclude=*.metadata.json ${OUT_DIR}/locales/ ${NPM_DIR}/locales
|
||||
fi
|
||||
else
|
||||
echo "====== Copy ${PACKAGE} node tool"
|
||||
rsync -a ${OUT_DIR}/ ${NPM_DIR}
|
||||
@ -449,7 +472,12 @@ do
|
||||
|
||||
|
||||
if [[ -d ${NPM_DIR} ]]; then
|
||||
updateVersionReferences ${NPM_DIR}
|
||||
(
|
||||
echo "====== VERSION: Updating version references"
|
||||
cd ${NPM_DIR}
|
||||
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-PLACEHOLDER/${VERSION}/g\" $""(grep -ril 0\.0\.0\-PLACEHOLDER .)"
|
||||
perl -p -i -e "s/0\.0\.0\-PLACEHOLDER/${VERSION}/g" $(grep -ril 0\.0\.0\-PLACEHOLDER .) < /dev/null 2> /dev/null
|
||||
)
|
||||
fi
|
||||
|
||||
travisFoldEnd "build package: ${PACKAGE}"
|
||||
|
@ -1,59 +0,0 @@
|
||||
# Debugging Angular
|
||||
|
||||
The Angular project has comprehensive unit tests for the core packages and the tools.
|
||||
The core packages are tested both in the browser (via Karma) and on the server (via Node.js).
|
||||
|
||||
## Debugging in Karma
|
||||
|
||||
Run the unit tests as normal using via the `./test.sh` script. For example:
|
||||
|
||||
```bash
|
||||
./test.sh browserNoRouter
|
||||
```
|
||||
|
||||
Once the initial build has completed and the Karma server has started up, you can go to the
|
||||
Chrome browser that is automatically opened, usually pointing to `http://localhost:9876`.
|
||||
The script will sit watching for code changes, recompiling the changed files and triggering
|
||||
further runs of the unit tests in the browser.
|
||||
|
||||
In this browser there is a "DEBUG" link (in the top right corner). Clicking this link will
|
||||
open up a new tab that will run the unit tests and will not timeout, giving you time to
|
||||
step through the code.
|
||||
|
||||
Open up this tab's developer console to access the source code viewer where you can set
|
||||
breakpoints and interrogate the current stack and variables.
|
||||
|
||||
It is useful to focus your debugging on one test at a time by changing that test to be
|
||||
defined using the `fit(...)` function, rather than `it(...)`. Moreover it can be helpful
|
||||
to place a `debugger` statement in this `fit` clause to cause the debugger to stop when
|
||||
it hits this test.
|
||||
|
||||
## Debugging in Node
|
||||
|
||||
Run the unit tests as normal using the `./test.sh` script, but add the `--debug` flag to
|
||||
the command. For example:
|
||||
|
||||
```bash
|
||||
./test.sh node --debug
|
||||
```
|
||||
|
||||
Once the initial building has completed, the script will watch for code changes, recompiling
|
||||
and running the unit tests via a tool call `cjs-jasmine`. Due to the `--debug` flag, each
|
||||
test run will create a debugging server listening on a port (such as 9229), which can be
|
||||
connected to by a debugger.
|
||||
|
||||
You can use Chrome as the debugger by navigating to `chrome://inspect` then clicking the
|
||||
"Open dedicated DevTools for Node" link. This will open up a Developer console, which will
|
||||
automatically connect to the debugging server.
|
||||
|
||||
It is useful to focus your debugging on one test at a time by changing that test to be
|
||||
defined using the `fit(...)` function, rather than `it(...)`. Moreover it can be helpful
|
||||
to place a `debugger` statement in this `fit` clause to cause the debugger to stop when
|
||||
it hits this test.
|
||||
|
||||
**Problem with node 6:** at the time of writing, the node process does not tell the Chrome
|
||||
debugger when it has completed, and so the debugger is not able to automatically disconnect
|
||||
from listening to the debugging server. To solve this, just close the developer tools window
|
||||
after each run of the unit tests, before making changes to the code. This is fixed in node 8
|
||||
and may be backported to node 6. This issue is tracked in
|
||||
https://github.com/nodejs/node/pull/12814#issuecomment-309908579.
|
@ -126,8 +126,6 @@ $ ./test.sh tools # Run angular tooling (not framework) tests
|
||||
|
||||
You should execute the 3 test suites before submitting a PR to github.
|
||||
|
||||
See [DEBUG.md](DEBUG.md) for information on debugging the code while running the unit tests.
|
||||
|
||||
All the tests are executed on our Continuous Integration infrastructure and a PR could only be merged once the tests pass.
|
||||
|
||||
- CircleCI fails if your code is not formatted properly,
|
||||
@ -179,7 +177,7 @@ First time, you need to create the github repositories:
|
||||
|
||||
``` shell
|
||||
$ export TOKEN=[get one from https://github.com/settings/tokens]
|
||||
$ CREATE_REPOS=1 TRAVIS= ./scripts/ci/publish-build-artifacts.sh [github username]
|
||||
$ CREATE_REPOS=1 ./scripts/publish/publish-build-artifacts.sh [github username]
|
||||
```
|
||||
|
||||
For subsequent snapshots, just run
|
||||
|
@ -36,13 +36,9 @@ gulp.task('public-api:update', ['build.sh'], loadTask('public-api', 'update'));
|
||||
gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']);
|
||||
gulp.task('tslint', ['tools:build'], loadTask('lint'));
|
||||
gulp.task('validate-commit-messages', loadTask('validate-commit-message'));
|
||||
gulp.task('source-map-test', loadTask('source-map-test'));
|
||||
gulp.task('tools:build', loadTask('tools-build'));
|
||||
gulp.task('check-cycle', loadTask('check-cycle'));
|
||||
gulp.task('serve', loadTask('serve', 'default'));
|
||||
gulp.task('serve-examples', loadTask('serve', 'examples'));
|
||||
gulp.task('changelog', loadTask('changelog'));
|
||||
gulp.task('check-env', () => {/* this is a noop because the env test ran already above */});
|
||||
gulp.task('cldr:extract', loadTask('cldr', 'extract'));
|
||||
gulp.task('cldr:download', loadTask('cldr', 'download'));
|
||||
gulp.task('cldr:gen-closure-locale', loadTask('cldr', 'closure'));
|
||||
|
5
integration/.gitignore
vendored
@ -1,13 +1,10 @@
|
||||
built/
|
||||
dist/
|
||||
vendor/
|
||||
yarn.lock
|
||||
.ng-cli/
|
||||
cli-*/**
|
||||
*/src/*.d.ts
|
||||
*/src/*.js
|
||||
**/*.ngfactory.ts
|
||||
**/*.ngsummary.json
|
||||
**/*.ngsummary.ts
|
||||
*/yarn*
|
||||
**/.yarn_local_cache*
|
||||
*/.yarn_local_cache*
|
||||
|
@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -u -e -o pipefail
|
||||
|
||||
declare -A payloadLimits
|
||||
payloadLimits["hello_world__closure", "uncompressed", "bundle"]=106000
|
||||
payloadLimits["hello_world__closure", "gzip7", "bundle"]=35000
|
||||
payloadLimits["hello_world__closure", "gzip9", "bundle"]=35000
|
||||
|
||||
payloadLimits["cli-hello-world", "uncompressed", "inline"]=1500
|
||||
payloadLimits["cli-hello-world", "uncompressed", "main"]=175000
|
||||
payloadLimits["cli-hello-world", "uncompressed", "polyfills"]=64000
|
||||
payloadLimits["cli-hello-world", "gzip7", "inline"]=900
|
||||
payloadLimits["cli-hello-world", "gzip7", "main"]=48000
|
||||
payloadLimits["cli-hello-world", "gzip7", "polyfills"]=22000
|
||||
payloadLimits["cli-hello-world", "gzip9", "inline"]=900
|
||||
payloadLimits["cli-hello-world", "gzip9", "main"]=48000
|
||||
payloadLimits["cli-hello-world", "gzip9", "polyfills"]=22000
|
||||
|
@ -1,10 +0,0 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "node_modules",
|
||||
srcs = glob([
|
||||
"node_modules/**/*.js",
|
||||
"node_modules/**/*.d.ts",
|
||||
"node_modules/**/*.json",
|
||||
])
|
||||
)
|
@ -1,20 +0,0 @@
|
||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||
|
||||
git_repository(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
remote = "https://github.com/bazelbuild/rules_nodejs.git",
|
||||
tag = "0.0.2",
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
|
||||
node_repositories(package_json = ["//:package.json"])
|
||||
|
||||
local_repository(
|
||||
name = "build_bazel_rules_typescript",
|
||||
path = "node_modules/@bazel/typescript",
|
||||
)
|
||||
|
||||
local_repository(
|
||||
name = "angular",
|
||||
path = "node_modules/@angular/bazel",
|
||||
)
|
@ -1,24 +0,0 @@
|
||||
// WORKAROUND https://github.com/angular/angular/issues/18810
|
||||
// This file is required to run ngc on angular libraries, to write files like
|
||||
// node_modules/@angular/core/core.ngsummary.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2015"
|
||||
],
|
||||
"experimentalDecorators": true,
|
||||
"types": []
|
||||
},
|
||||
"include": [
|
||||
"node_modules/@angular/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/@angular/bazel/**",
|
||||
"node_modules/@angular/compiler-cli/**",
|
||||
// Workaround bug introduced by 079d884
|
||||
"node_modules/@angular/common/locales.d.ts",
|
||||
"node_modules/@angular/common/locales/**",
|
||||
"node_modules/@angular/tsc-wrapped/**"
|
||||
]
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "angular-bazel",
|
||||
"description": "example and integration test for building Angular apps with Bazel",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "file:../../dist/packages-dist/animations",
|
||||
"@angular/common": "file:../../dist/packages-dist/common",
|
||||
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/bazel": "file:../../dist/packages-dist/bazel",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"@types/source-map": "0.5.1"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "ngc -p angular.tsconfig.json",
|
||||
"test": "bazel build ..."
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
# Allow targets under sub-packages to reference the tsconfig.json file
|
||||
exports_files(["tsconfig.json"])
|
||||
|
||||
ng_module(
|
||||
name = "src",
|
||||
srcs = glob(["*.ts"]),
|
||||
deps = ["//src/hello-world"],
|
||||
tsconfig = ":tsconfig.json",
|
||||
)
|
@ -1,9 +0,0 @@
|
||||
import {HelloWorldModule} from './hello-world/hello-world.module';
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
@NgModule({
|
||||
imports: [BrowserModule, HelloWorldModule]
|
||||
})
|
||||
export class AppModule {}
|
@ -1,10 +0,0 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
load("@angular//:index.bzl", "ng_module")
|
||||
|
||||
ng_module(
|
||||
name = "hello-world",
|
||||
srcs = glob(["*.ts"]),
|
||||
tsconfig = "//src:tsconfig.json",
|
||||
# TODO(alexeagle): re-enable
|
||||
# assets = [":styles"],
|
||||
)
|
@ -1,16 +0,0 @@
|
||||
|
||||
import {Component, NgModule} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'hello-world-app',
|
||||
template: `
|
||||
<div>Hello {{ name }}!</div>
|
||||
<input type="text" [value]="name" (input)="name = $event.target.value"/>
|
||||
`,
|
||||
// TODO: might be better to point to .scss so this looks valid at design-time
|
||||
// TODO(alexeagle): re-enable SASS
|
||||
// styleUrls: ['./styles.css']
|
||||
})
|
||||
export class HelloWorldComponent {
|
||||
name: string = 'world';
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
import {HelloWorldComponent} from './hello-world.component';
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
@NgModule({
|
||||
declarations: [HelloWorldComponent],
|
||||
bootstrap: [HelloWorldComponent],
|
||||
})
|
||||
export class HelloWorldModule {}
|
@ -1,4 +0,0 @@
|
||||
import {platformBrowser} from '@angular/platform-browser';
|
||||
import {AppModuleNgFactory} from './app.module.ngfactory';
|
||||
|
||||
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"lib": [
|
||||
"dom",
|
||||
"es5",
|
||||
"es2015.collection",
|
||||
"es2015.iterable",
|
||||
"es2015.promise"
|
||||
]
|
||||
}
|
||||
}
|
@ -13,20 +13,18 @@
|
||||
node_modules/zone.js/dist/zone_externs.js
|
||||
|
||||
--js node_modules/rxjs/**.js
|
||||
|
||||
--js node_modules/@angular/core/package.json
|
||||
--js node_modules/@angular/core/esm15/index.js
|
||||
--js node_modules/@angular/core/src/testability/testability.externs.js
|
||||
|
||||
--js node_modules/@angular/common/package.json
|
||||
--js node_modules/@angular/common/esm15/index.js
|
||||
|
||||
--js node_modules/@angular/platform-browser/package.json
|
||||
--js node_modules/@angular/platform-browser/esm15/index.js
|
||||
|
||||
--module_resolution=node
|
||||
--package_json_entry_names es2015
|
||||
--process_common_js_modules
|
||||
--module_resolution=node
|
||||
|
||||
node_modules/@angular/core/@angular/core.js
|
||||
--js_module_root=node_modules/@angular/core
|
||||
node_modules/@angular/core/src/testability/testability.externs.js
|
||||
|
||||
node_modules/@angular/common/@angular/common.js
|
||||
--js_module_root=node_modules/@angular/common
|
||||
|
||||
node_modules/@angular/platform-browser/@angular/platform-browser.js
|
||||
--js_module_root=node_modules/@angular/platform-browser
|
||||
|
||||
--js built/**.js
|
||||
--entry_point=built/src/main
|
||||
|
@ -10,11 +10,11 @@
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
|
||||
"google-closure-compiler": "git+https://github.com/alexeagle/closure-compiler.git#packagejson.dist",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
"@angular/tsc-wrapped": "file:../../dist/tools/@angular/tsc-wrapped",
|
||||
"google-closure-compiler": "20170409.0.0",
|
||||
"rxjs": "5.3.1",
|
||||
"typescript": "2.1.6",
|
||||
"zone.js": "0.8.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "2.5.41",
|
||||
@ -29,4 +29,4 @@
|
||||
"preprotractor": "tsc -p e2e",
|
||||
"protractor": "protractor e2e/protractor.config.js"
|
||||
}
|
||||
}
|
||||
}
|
@ -19,8 +19,8 @@
|
||||
"plugin-typescript": "6.0.4",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"systemjs": "0.20.2",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
"typescript": "2.1.6",
|
||||
"zone.js": "0.7.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "2.5.41",
|
||||
|
@ -1,31 +0,0 @@
|
||||
--compilation_level=ADVANCED_OPTIMIZATIONS
|
||||
--language_out=ES5
|
||||
--js_output_file=dist/bundle.js
|
||||
--output_manifest=dist/manifest.MF
|
||||
--variable_renaming_report=dist/variable_renaming_report
|
||||
--property_renaming_report=dist/property_renaming_report
|
||||
--create_source_map=%outname%.map
|
||||
|
||||
--warning_level=QUIET
|
||||
--dependency_mode=STRICT
|
||||
--rewrite_polyfills=false
|
||||
|
||||
node_modules/zone.js/dist/zone_externs.js
|
||||
|
||||
--js node_modules/rxjs/**.js
|
||||
--process_common_js_modules
|
||||
--module_resolution=node
|
||||
--package_json_entry_names es2015
|
||||
|
||||
--js node_modules/@angular/core/package.json
|
||||
--js node_modules/@angular/core/esm15/index.js
|
||||
--js node_modules/@angular/core/src/testability/testability.externs.js
|
||||
|
||||
--js node_modules/@angular/common/package.json
|
||||
--js node_modules/@angular/common/esm15/index.js
|
||||
|
||||
--js node_modules/@angular/platform-browser/package.json
|
||||
--js node_modules/@angular/platform-browser/esm15/index.js
|
||||
|
||||
--js built/**.js
|
||||
--entry_point=built/src/main
|
@ -1,10 +0,0 @@
|
||||
import { browser, element, by } from 'protractor';
|
||||
|
||||
describe('i18n E2E Tests', function () {
|
||||
it('remove i18n attributes', function () {
|
||||
browser.get('');
|
||||
const div = element(by.css('div'));
|
||||
expect(div.getAttribute('title')).not.toBe(null);
|
||||
expect(div.getAttribute('i18n')).toBe(null);
|
||||
});
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"open": false,
|
||||
"logLevel": "silent",
|
||||
"port": 8080,
|
||||
"server": {
|
||||
"baseDir": "src",
|
||||
"routes": {
|
||||
"/dist": "dist",
|
||||
"/node_modules": "node_modules"
|
||||
},
|
||||
"middleware": {
|
||||
"0": null
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
exports.config = {
|
||||
specs: [
|
||||
'../built/e2e/*.e2e-spec.js'
|
||||
],
|
||||
capabilities: {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: ['--no-sandbox'],
|
||||
binary: process.env.CHROME_BIN,
|
||||
}
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:8080/',
|
||||
framework: 'jasmine',
|
||||
useAllAngular2AppRoots: true
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "../built/e2e",
|
||||
"types": ["jasmine"],
|
||||
// TODO(alexeagle): was required for Protractor 4.0.11
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
{
|
||||
"name": "angular-integration",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "file:../../dist/packages-dist/animations",
|
||||
"@angular/common": "file:../../dist/packages-dist/common",
|
||||
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
|
||||
"google-closure-compiler": "git+https://github.com/alexeagle/closure-compiler.git#packagejson.dist",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "2.5.41",
|
||||
"concurrently": "3.4.0",
|
||||
"lite-server": "2.2.2",
|
||||
"protractor": "file:../../node_modules/protractor"
|
||||
},
|
||||
"scripts": {
|
||||
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
|
||||
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first",
|
||||
"serve": "lite-server -c e2e/browser.config.json",
|
||||
"preprotractor": "tsc -p e2e",
|
||||
"protractor": "protractor e2e/protractor.config.js"
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import {HelloWorldComponent} from './hello-world.component';
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
@NgModule({
|
||||
declarations: [HelloWorldComponent],
|
||||
bootstrap: [HelloWorldComponent],
|
||||
imports: [BrowserModule],
|
||||
})
|
||||
export class AppModule {}
|
@ -1,9 +0,0 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'hello-world-app',
|
||||
template: `<div i18n="desc|meaning" title="i18n attribute should be removed">Hello {{ name }}!</div>`,
|
||||
})
|
||||
export class HelloWorldComponent {
|
||||
name: string = 'world';
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Hello World</title>
|
||||
<base href="/">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<hello-world-app>Loading...</hello-world-app>
|
||||
|
||||
<script src="node_modules/zone.js/dist/zone.min.js"></script>
|
||||
<script src="dist/bundle.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,4 +0,0 @@
|
||||
import {platformBrowser} from '@angular/platform-browser';
|
||||
import {AppModuleNgFactory} from './app.ngfactory';
|
||||
|
||||
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
|
@ -1,30 +0,0 @@
|
||||
{
|
||||
"angularCompilerOptions": {
|
||||
"annotationsAs": "static fields",
|
||||
"annotateForClosureCompiler": true,
|
||||
"alwaysCompileGeneratedCode": true
|
||||
},
|
||||
|
||||
"compilerOptions": {
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
// TODO(i): strictNullChecks should turned on but are temporarily disabled due to #15432
|
||||
"strictNullChecks": false,
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"sourceMap": false,
|
||||
"experimentalDecorators": true,
|
||||
"outDir": "built",
|
||||
"rootDir": ".",
|
||||
"declaration": true,
|
||||
"types": []
|
||||
},
|
||||
|
||||
"exclude": [
|
||||
"vendor",
|
||||
"node_modules",
|
||||
"built",
|
||||
"dist",
|
||||
"e2e"
|
||||
]
|
||||
}
|
@ -12,13 +12,13 @@
|
||||
"@angular/language-service": "file:../../dist/packages-dist/language-service",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
|
||||
"@angular/tsc-wrapped": "file:../../dist/tools/@angular/tsc-wrapped",
|
||||
"@types/minimist": "^1.2.0",
|
||||
"@types/node": "^7.0.5",
|
||||
"minimist": "^1.2.0",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
"typescript": "^2.1.5",
|
||||
"zone.js": "0.7.6"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "scripts/install.sh",
|
||||
|
@ -9,11 +9,6 @@ source scripts/env.sh
|
||||
HOST="node tools/typescript_host.js"
|
||||
VALIDATE="node tools/typescript_validator.js"
|
||||
|
||||
# Ensure the languages service can load correctly in node before typescript loads it.
|
||||
# This verifies its dependencies and emits any exceptions, both of which are only
|
||||
# emitted to the typescript logs (not the validated output).
|
||||
node tools/load_test.js
|
||||
|
||||
for TYPESCRIPT in ${TYPESCRIPTS[@]}
|
||||
do
|
||||
SERVER="node typescripts/$TYPESCRIPT/node_modules/typescript/lib/tsserver.js"
|
||||
|
@ -1,35 +0,0 @@
|
||||
const ts = require('typescript');
|
||||
const Module = require('module');
|
||||
|
||||
const existingRequire = Module.prototype.require;
|
||||
|
||||
const recordedRequires: string[] = [];
|
||||
|
||||
function recordingRequire(path: string) {
|
||||
recordedRequires.push(path);
|
||||
return existingRequire.call(this, path);
|
||||
}
|
||||
|
||||
Module.prototype.require = recordingRequire;
|
||||
|
||||
try {
|
||||
const lsf = require('@angular/language-service');
|
||||
const ls = lsf({typescript: ts});
|
||||
|
||||
// Assert that the only module that should have been required are '@angular/langauge-service', 'fs', and 'path'
|
||||
|
||||
const allowedLoads = new Set(["@angular/language-service", "fs", "path"]);
|
||||
|
||||
const invalidModules = recordedRequires.filter(m => !allowedLoads.has(m));
|
||||
|
||||
if (invalidModules.length > 0) {
|
||||
console.error(`FAILED: Loading the language service required: ${invalidModules.join(', ')}`);
|
||||
process.exit(1);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`FAILED: Loading the language service caused the following exception: ${e.stack || e}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('SUCCESS: Loading passed')
|
||||
process.exit(0);
|
@ -13,7 +13,6 @@
|
||||
},
|
||||
"files": [
|
||||
"typescript_host.ts",
|
||||
"typescript_validator.ts",
|
||||
"load_test.ts"
|
||||
"typescript_validator.ts"
|
||||
]
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo "Angular cli integration create project"
|
||||
echo
|
||||
echo "./ng-cli-create.sh [project-name]"
|
||||
echo
|
||||
else
|
||||
TEMP=`dirname $0`
|
||||
INTEGRATION_DIR=`(cd $TEMP; pwd)`
|
||||
PROJECT=$1
|
||||
PROJECT_DIR=$INTEGRATION_DIR/$PROJECT
|
||||
NG=$INTEGRATION_DIR/.ng-cli/node_modules/.bin/ng
|
||||
(
|
||||
echo "==================="
|
||||
echo Creating $PROJECT...
|
||||
echo "==================="
|
||||
cd $INTEGRATION_DIR
|
||||
rm -rf $PROJECT
|
||||
$NG set --global packageManager=yarn
|
||||
$NG new $PROJECT --skip-install --skip-git
|
||||
echo "==================="
|
||||
echo $PROJECT created
|
||||
echo "==================="
|
||||
)
|
||||
|
||||
|
||||
# By default `ng new` creates a package.json which uses @angular/* from NPM.
|
||||
# Instead we want to use them from the current build so we overwrite theme here.
|
||||
(
|
||||
echo "==================="
|
||||
echo Updating $PROJECT bundles
|
||||
echo "==================="
|
||||
cd $PROJECT_DIR
|
||||
|
||||
sed -i -E 's/ng build/ng build --prod --build-optimizer/g' package.json
|
||||
sed -i -E 's/ng test/ng test --single-run/g' package.json
|
||||
# workaround for https://github.com/angular/angular-cli/issues/7401
|
||||
sed -i -E 's/"@angular\/cli\"\: \".*\"/"@angular\/cli": "https:\/\/github.com\/angular\/cli-builds"/g' package.json
|
||||
|
||||
yarn add \
|
||||
file:../../dist/packages-dist/compiler-cli \
|
||||
file:../../dist/packages-dist/language-service \
|
||||
--save-dev --skip-integrity-check --emoji
|
||||
|
||||
yarn add \
|
||||
file:../../dist/packages-dist/core \
|
||||
file:../../dist/packages-dist/common \
|
||||
file:../../dist/packages-dist/forms \
|
||||
file:../../dist/packages-dist/http \
|
||||
--save --skip-integrity-check --emoji
|
||||
|
||||
# yarn bug: can not install all of them in a single command and it has to be broken into separate invocations.
|
||||
yarn add \
|
||||
file:../../dist/packages-dist/animations \
|
||||
file:../../dist/packages-dist/compiler \
|
||||
file:../../dist/packages-dist/platform-browser \
|
||||
file:../../dist/packages-dist/platform-browser-dynamic \
|
||||
--save --skip-integrity-check --emoji
|
||||
|
||||
yarn install --emoji
|
||||
|
||||
echo "==================="
|
||||
echo $PROJECT created succesfully
|
||||
echo "==================="
|
||||
)
|
||||
fi
|
@ -4,10 +4,6 @@ set -e -o pipefail
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
# Track payload size functions
|
||||
source ../scripts/ci/payload-size.sh
|
||||
source ./_payload-limits.sh
|
||||
|
||||
# Workaround https://github.com/yarnpkg/yarn/issues/2165
|
||||
# Yarn will cache file://dist URIs and not update Angular code
|
||||
readonly cache=.yarn_local_cache
|
||||
@ -18,17 +14,6 @@ rm_cache
|
||||
mkdir $cache
|
||||
trap rm_cache EXIT
|
||||
|
||||
# We need to install `ng` but don't want to do it globally so we plate it into `.ng-cli` folder.
|
||||
# This check prevents constant re-installing.
|
||||
if [ ! -d ".ng-cli" ]; then
|
||||
(
|
||||
mkdir -p .ng-cli
|
||||
cd .ng-cli
|
||||
yarn add @angular/cli@$ANGULAR_CLI_VERSION --cache-folder ../$cache
|
||||
)
|
||||
fi
|
||||
./ng-cli-create.sh cli-hello-world
|
||||
|
||||
for testDir in $(ls | grep -v node_modules) ; do
|
||||
[[ -d "$testDir" ]] || continue
|
||||
echo "#################################"
|
||||
@ -38,17 +23,7 @@ for testDir in $(ls | grep -v node_modules) ; do
|
||||
cd $testDir
|
||||
# Workaround for https://github.com/yarnpkg/yarn/issues/2256
|
||||
rm -f yarn.lock
|
||||
rm -rf dist
|
||||
yarn install --cache-folder ../$cache
|
||||
yarn test || exit 1
|
||||
# Track payload size for cli-hello-world and hello_world__closure
|
||||
if [[ $testDir == cli-hello-world ]] || [[ $testDir == hello_world__closure ]]; then
|
||||
if [[ $testDir == cli-hello-world ]]; then
|
||||
yarn build
|
||||
fi
|
||||
trackPayloadSize "$testDir" "dist/*.js" true false
|
||||
fi
|
||||
)
|
||||
done
|
||||
|
||||
trackPayloadSize "umd" "../dist/packages-dist/*/bundles/*.umd.min.js" false false
|
||||
|
28
integration/typings_test_ts21/package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "angular-integration",
|
||||
"description": "Assert that users with TypeScript 2.1 can type-check an Angular application",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "file:../../dist/packages-dist/animations",
|
||||
"@angular/common": "file:../../dist/packages-dist/common",
|
||||
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/forms": "file:../../dist/packages-dist/forms",
|
||||
"@angular/http": "file:../../dist/packages-dist/http",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"@angular/tsc-wrapped": "file:../../dist/tools/@angular/tsc-wrapped",
|
||||
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
|
||||
"@types/jasmine": "2.5.41",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "2.1.6",
|
||||
"zone.js": "0.7.6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
||||
}
|
||||
}
|
18
integration/typings_test_ts21/tsconfig.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../dist/typing-test/",
|
||||
"rootDir": ".",
|
||||
"target": "es5",
|
||||
"lib": ["es5", "dom", "es2015.collection", "es2015.iterable", "es2015.promise"],
|
||||
"types": [],
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"files": [
|
||||
"include-all.ts",
|
||||
"node_modules/@types/jasmine/index.d.ts"
|
||||
]
|
||||
}
|
41
integration/typings_test_ts22/include-all.ts
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import * as compiler from '@angular/compiler';
|
||||
import * as compilerTesting from '@angular/compiler/testing';
|
||||
import * as core from '@angular/core';
|
||||
import * as coreTesting from '@angular/core/testing';
|
||||
import * as forms from '@angular/forms';
|
||||
import * as http from '@angular/http';
|
||||
import * as httpTesting from '@angular/http/testing';
|
||||
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
|
||||
import * as platformBrowser from '@angular/platform-browser';
|
||||
import * as platformBrowserTesting from '@angular/platform-browser/testing';
|
||||
import * as platformServer from '@angular/platform-server';
|
||||
import * as platformServerTesting from '@angular/platform-server/testing';
|
||||
import * as router from '@angular/router';
|
||||
import * as routerTesting from '@angular/router/testing';
|
||||
import * as upgrade from '@angular/upgrade';
|
||||
|
||||
export default {
|
||||
compiler,
|
||||
compilerTesting,
|
||||
core,
|
||||
coreTesting,
|
||||
forms,
|
||||
http,
|
||||
httpTesting,
|
||||
platformBrowser,
|
||||
platformBrowserTesting,
|
||||
platformBrowserDynamic,
|
||||
platformServer,
|
||||
platformServerTesting,
|
||||
router,
|
||||
routerTesting,
|
||||
upgrade
|
||||
};
|
@ -15,12 +15,12 @@
|
||||
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
|
||||
"@angular/tsc-wrapped": "file:../../dist/tools/@angular/tsc-wrapped",
|
||||
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
|
||||
"@types/jasmine": "2.5.41",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "file:../../node_modules/typescript",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
"typescript": "2.2.1",
|
||||
"zone.js": "0.7.6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
41
integration/typings_test_ts23/include-all.ts
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import * as compiler from '@angular/compiler';
|
||||
import * as compilerTesting from '@angular/compiler/testing';
|
||||
import * as core from '@angular/core';
|
||||
import * as coreTesting from '@angular/core/testing';
|
||||
import * as forms from '@angular/forms';
|
||||
import * as http from '@angular/http';
|
||||
import * as httpTesting from '@angular/http/testing';
|
||||
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
|
||||
import * as platformBrowser from '@angular/platform-browser';
|
||||
import * as platformBrowserTesting from '@angular/platform-browser/testing';
|
||||
import * as platformServer from '@angular/platform-server';
|
||||
import * as platformServerTesting from '@angular/platform-server/testing';
|
||||
import * as router from '@angular/router';
|
||||
import * as routerTesting from '@angular/router/testing';
|
||||
import * as upgrade from '@angular/upgrade';
|
||||
|
||||
export default {
|
||||
compiler,
|
||||
compilerTesting,
|
||||
core,
|
||||
coreTesting,
|
||||
forms,
|
||||
http,
|
||||
httpTesting,
|
||||
platformBrowser,
|
||||
platformBrowserTesting,
|
||||
platformBrowserDynamic,
|
||||
platformServer,
|
||||
platformServerTesting,
|
||||
router,
|
||||
routerTesting,
|
||||
upgrade
|
||||
};
|
28
integration/typings_test_ts23/package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "angular-integration",
|
||||
"description": "Assert that users with TypeScript 2.2 can type-check an Angular application",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "file:../../dist/packages-dist/animations",
|
||||
"@angular/common": "file:../../dist/packages-dist/common",
|
||||
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/forms": "file:../../dist/packages-dist/forms",
|
||||
"@angular/http": "file:../../dist/packages-dist/http",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
"@angular/tsc-wrapped": "file:../../dist/tools/@angular/tsc-wrapped",
|
||||
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
|
||||
"@types/jasmine": "2.5.41",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"typescript": "2.3.2",
|
||||
"zone.js": "0.7.6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
||||
}
|
||||
}
|
24
integration/typings_test_ts23/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../dist/typing-test/",
|
||||
"rootDir": ".",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es5",
|
||||
"dom",
|
||||
"es2015.collection",
|
||||
"es2015.iterable",
|
||||
"es2015.promise"
|
||||
],
|
||||
"types": [],
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"files": [
|
||||
"include-all.ts",
|
||||
"node_modules/@types/jasmine/index.d.ts"
|
||||
]
|
||||
}
|
@ -35,7 +35,6 @@ module.exports = function(config) {
|
||||
'node_modules/zone.js/dist/fake-async-test.js',
|
||||
|
||||
// Including systemjs because it defines `__eval`, which produces correct stack traces.
|
||||
'test-events.js',
|
||||
'shims_for_IE.js',
|
||||
'node_modules/systemjs/dist/system.src.js',
|
||||
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
|
||||
@ -48,8 +47,7 @@ module.exports = function(config) {
|
||||
pattern: 'packages/platform-browser/test/browser/static_assets/**',
|
||||
included: false,
|
||||
watched: false,
|
||||
},
|
||||
{pattern: 'packages/common/i18n/**', included: false, watched: false, served: true},
|
||||
}
|
||||
],
|
||||
|
||||
exclude: [
|
||||
@ -61,7 +59,6 @@ module.exports = function(config) {
|
||||
'dist/all/@angular/examples/**/e2e_test/*',
|
||||
'dist/all/@angular/language-service/**',
|
||||
'dist/all/@angular/router/test/**',
|
||||
'dist/all/@angular/tsc-wrapped/**',
|
||||
'dist/all/@angular/platform-browser/testing/e2e_util.js',
|
||||
'dist/all/angular1_router.js',
|
||||
'dist/examples/**/e2e_test/**',
|
||||
|
@ -11,7 +11,7 @@ const yargs = require('yargs');
|
||||
const nodeUuid = require('node-uuid');
|
||||
import * as fs from 'fs-extra';
|
||||
|
||||
import {SeleniumWebDriverAdapter, Options, JsonFileReporter, Validator, RegressionSlopeValidator, ConsoleReporter, SizeValidator, MultiReporter, MultiMetric, Runner, StaticProvider} from '@angular/benchpress';
|
||||
import {SeleniumWebDriverAdapter, Options, JsonFileReporter, Validator, RegressionSlopeValidator, ConsoleReporter, SizeValidator, MultiReporter, MultiMetric, Runner, Provider} from '@angular/benchpress';
|
||||
import {readCommandLine as readE2eCommandLine, openBrowser} from './e2e_util';
|
||||
|
||||
let cmdArgs: {'sample-size': number, 'force-gc': boolean, 'dryrun': boolean, 'bundles': boolean};
|
||||
@ -59,7 +59,7 @@ function createBenchpressRunner(): Runner {
|
||||
}
|
||||
const resultsFolder = './dist/benchmark_results';
|
||||
fs.ensureDirSync(resultsFolder);
|
||||
const providers: StaticProvider[] = [
|
||||
const providers: Provider[] = [
|
||||
SeleniumWebDriverAdapter.PROTRACTOR_PROVIDERS,
|
||||
{provide: Options.FORCE_GC, useValue: cmdArgs['force-gc']},
|
||||
{provide: Options.DEFAULT_DESCRIPTION, useValue: {'runId': runId}}, JsonFileReporter.PROVIDERS,
|
||||
|
@ -1,8 +1,6 @@
|
||||
# How to run the examples locally
|
||||
|
||||
```
|
||||
$ cp -r ./modules/playground ./dist/all/
|
||||
$ ./node_modules/.bin/tsc -p modules --emitDecoratorMetadata -w
|
||||
$ gulp serve
|
||||
$ open http://localhost:8000/all/playground/src/hello_world/index.html?bundles=false
|
||||
```
|
@ -25,6 +25,9 @@ describe('Model-Driven Forms', function() {
|
||||
input.sendKeys('invalid');
|
||||
firstName.click();
|
||||
|
||||
expect(form.getAttribute('innerHTML')).toContain('is invalid credit card number');
|
||||
// TODO: getInnerHtml has been deprecated by selenium-webdriver in the
|
||||
// upcoming release of 3.0.0. Protractor has removed this method from
|
||||
// ElementFinder but can still be accessed via WebElement.
|
||||
expect(form.getWebElement().getInnerHtml()).toContain('is invalid credit card number');
|
||||
});
|
||||
});
|
||||
|
@ -25,6 +25,9 @@ describe('Template-Driven Forms', function() {
|
||||
input.sendKeys('invalid');
|
||||
firstName.click();
|
||||
|
||||
expect(form.getAttribute('innerHTML')).toContain('is invalid credit card number');
|
||||
// TODO: getInnerHtml has been deprecated by selenium-webdriver in the
|
||||
// upcoming release of 3.0.0. Protractor has removed this method from
|
||||
// ElementFinder but can still be accessed via WebElement.
|
||||
expect(form.getWebElement().getInnerHtml()).toContain('is invalid credit card number');
|
||||
});
|
||||
});
|
||||
|