angular/packages/compiler-cli/test/ngtsc
Alex Rickabaugh 2cf7d0fd05 fix(ivy): disable use of aliasing in template type-checking (#34649)
FileToModuleHost aliasing supports compilation within environments that have
two properties:

1. A `FileToModuleHost` exists which defines canonical module names for any
   given TS file.
2. Dependency restrictions exist which prevent the import of arbitrary files
   even if such files are within the .d.ts transitive closure of a
   compilation ("strictdeps").

In such an environment, generated imports can only go through import paths
which are already present in the user program. The aliasing system supports
the generation and consumption of such imports at runtime.

`FileToModuleHost` aliasing does not emit re-exports in .d.ts files. This
means that it's safe to rely on alias re-exports in generated .js code (they
are guaranteed to exist at runtime) but not in template type-checking code
(since TS will not be able to follow such imports). Therefore, non-aliased
imports should be used in template type-checking code.

This commit adds a `NoAliasing` flag to `ImportFlags` and sets it when
generating imports in template type-checking code. The testing environment
is also patched to support resolution of FileToModuleHost canonical paths
within the template type-checking program, enabling testing of this change.

PR Close #34649
2020-01-23 10:31:49 -08:00
..
fake_core feat(ivy): throw compilation error when providing undecorated classes (#34460) 2019-12-18 15:04:51 -08:00
BUILD.bazel test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:09 -05:00
component_indexing_spec.ts feat(ivy): index template references, variables, bound attributes/events (#31535) 2019-07-25 13:09:10 -07:00
env.ts fix(ivy): disable use of aliasing in template type-checking (#34649) 2020-01-23 10:31:49 -08:00
incremental_error_spec.ts perf(ivy): reuse prior analysis work during incremental builds (#34288) 2019-12-12 13:11:46 -08:00
incremental_spec.ts perf(ivy): reuse prior analysis work during incremental builds (#34288) 2019-12-12 13:11:46 -08:00
modulewithproviders_spec.ts refactor(ivy): include generic type for ModuleWithProviders in .d.ts files (#34235) (#34340) 2019-12-11 08:48:11 -08:00
monorepo_spec.ts fix(ivy): emit fs-relative paths when rootDir(s) aren't in effect (#33828) 2019-11-19 12:41:24 -08:00
ngtsc_spec.ts fix(ivy): more accurate detection of pipes in host bindings (#34655) 2020-01-21 13:22:00 -05:00
scope_spec.ts fix(ivy): don't produce template diagnostics when scope is invalid (#34460) 2019-12-18 15:04:50 -08:00
sourcemap_utils.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
template_mapping_spec.ts perf(ivy): move attributes array into component def (#32798) 2019-10-09 13:16:55 -07:00
template_typecheck_spec.ts fix(ivy): disable use of aliasing in template type-checking (#34649) 2020-01-23 10:31:49 -08:00