angular-cn/packages/core
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
..
src fix(ivy): force new imports for .d.ts files (#25080) 2018-07-26 16:38:09 -07:00
test Revert "feat(core): add support for using async/await with Jasmine" (#25096) 2018-07-25 11:44:56 -07:00
testing Revert "feat(core): add support for using async/await with Jasmine" (#25096) 2018-07-25 11:44:56 -07:00
BUILD.bazel ci(ivy): configure CI environments for Ivy JIT and AOT (#24309) 2018-06-08 13:34:27 -07:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json build: update to rxjs@6.0.0 (#23679) 2018-05-03 10:53:39 -07:00
public_api.ts build: publish tree of files rather than FESMs (#18541) 2017-08-31 15:34:50 -07:00
rollup.config.js feat(ivy): first steps towards JIT compilation (#23833) 2018-05-21 19:13:50 -04:00
tsconfig-build.json refactor(bazel): convert most ts_library to ng_module (#22176) 2018-02-15 14:08:53 -08:00