angular-docs-cn/packages
Alex Rickabaugh ed7aa1c3e5 fix(ivy): force new imports for .d.ts files (#25080)
When ngtsc encounters a reference to a type (for example, a Component
type listed in an NgModule declarations array), it traces the import
of that type and attempts to determine the best way to refer to it.

In the event the type is defined in the same file where a reference
is being generated, the identifier of the type is used. If the type
was imported, ngtsc has a choice. It can use the identifier from the
original import, or it can write a new import to the module where the
type came from.

ngtsc has a bug currently when it elects to rely on the user's import.
When writing a .d.ts file, the user's import may have been elided as
the type was not referred to from the type side of the program. Thus,
in .d.ts files ngtsc must always assume the import may not exist, and
generate a new one.

In .js output the import is guaranteed to still exist, so it's
preferable for ngtsc to continue using the existing import if one is
available.

This commit changes how @angular/compiler writes type definitions, and
allows it to use a different expression to write a type definition than
is used to write the value. This allows ngtsc to specify that types in
type definitions should always be imported. A corresponding change to
the staticallyResolve() Reference system allows the choice of which
type of import to use when generating an Expression from a Reference.

PR Close #25080
2018-07-26 16:38:09 -07:00
..
animations docs(animations): typo fix in the comments (#22652) 2018-07-25 10:13:18 -07:00
bazel test(bazel): allow no sandbox for protractor tests (#24906) 2018-07-24 08:28:03 -07:00
benchpress build(bazel): //modules/benchmarks/src/largetable/render3:perf bazel protractor test (#24788) 2018-07-24 08:26:16 -07:00
common docs: more info on currency digits (#24661) 2018-07-20 10:33:06 -07:00
compiler fix(ivy): force new imports for .d.ts files (#25080) 2018-07-26 16:38:09 -07:00
compiler-cli fix(ivy): force new imports for .d.ts files (#25080) 2018-07-26 16:38:09 -07:00
core fix(ivy): force new imports for .d.ts files (#25080) 2018-07-26 16:38:09 -07:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
elements build(bazel): turn on preserve-symlinks (#24881) 2018-07-20 10:37:30 -07:00
examples docs: tests for number/percent/currency pipe (#25028) 2018-07-23 13:18:23 -07:00
forms feat(ivy): selector side of ModuleWithProviders via type metadata (#24862) 2018-07-20 11:48:35 -07:00
http test: make `NgMatchers` type-aware (#19904) 2018-07-06 13:48:02 -07:00
language-service fix(language-service): do not overwrite native `Reflect` (#24299) 2018-07-09 15:09:16 -07:00
platform-browser feat(ivy): selector side of ModuleWithProviders via type metadata (#24862) 2018-07-20 11:48:35 -07:00
platform-browser-dynamic ci(ivy): configure CI environments for Ivy JIT and AOT (#24309) 2018-06-08 13:34:27 -07:00
platform-server fix(animations): set animations styles properly on platform-server (#24624) 2018-06-25 07:58:11 -07:00
platform-webworker test(platform-webworker): avoid flakes due to existing `PlatformRef` (#24916) 2018-07-20 10:47:17 -07:00
platform-webworker-dynamic ci(ivy): configure CI environments for Ivy JIT and AOT (#24309) 2018-06-08 13:34:27 -07:00
router fix(router): Fix _lastPathIndex in deeply nested empty paths (#22394) 2018-07-25 11:27:28 -07:00
service-worker fix(service-worker): don't include sourceMappingURL in ngsw-worker (#24877) 2018-07-20 11:49:46 -07:00
upgrade fix(ivy): allow building router with ngtsc (#24862) 2018-07-20 11:48:35 -07:00
BUILD.bazel feat(bazel): introduce a binary stamping feature (#22176) 2018-02-15 14:08:53 -08:00
README.md Revert "docs: Remove unneeded file (#18106)" 2017-07-20 16:46:47 -05:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
es6-subset.d.ts build: switch from npm to yarn (#19328) 2017-09-22 13:20:52 -07:00
goog.d.ts fix(compiler): add typings for `COMPILED`. 2017-09-29 09:26:38 -07:00
license-banner.txt docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
rollup.config.js refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04:00
system.d.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
tsconfig-build.json build(bazel): Turning on strictPropertyInitialization for Angular. (#24572) 2018-06-25 07:57:13 -07:00
tsconfig-metadata.json refactor(compiler): bump metadata version to 4 (#19338) 2017-09-26 13:31:59 -07:00
tsconfig.json build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
types.d.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT