angular/packages/compiler-cli/test/compliance/test_cases
JoostK 75bb931889 fix(compiler-cli): prefer non-aliased exports in reference emitters (#41866)
This commit changes the reference emitters in the Ivy compiler to prefer
non-aliased exports if they exist. This avoids selecting "private
exports" that may not be stable, e.g. the reexports that have been added
by the View Engine compiler. Such reexports are not stable and are
therefore not suitable to be emitted into partial compilations, as the
output of partial compilations should only reference stable symbols
from upstream libraries.

An alternative solution has been considered where ViewEngine-generated
exports would gain a certain prefix, such that the Ivy compiler could
just exclude those exports (see #41443). However, that solution would
be insufficient in case a library is built using partial compilation and
while depending itself on a VE-compiled library from earlier versions of
Angular, where the magic prefix would be missing. For such libraries,
ngcc would have generated reexports using the declared name if not already
present so this change does result in choosing the correct export.

Because ngcc always generates reexports using the declared name even if
an aliased export is present, this change causes those ngcc-generated
exports to be chosen in downstream libraries using partial compilation.
This is unfortunate as it means that the declared names become
effectively public even if the library author was intentionally
exporting it using an alias. This commit does not address this problem;
it is expected that this should not result in widespread issues across
the library ecosystem.

Fixes #41277

PR Close #41866
2021-04-30 14:15:11 -07:00
..
r3_compiler_compliance fix(compiler-cli): prefer non-aliased exports in reference emitters (#41866) 2021-04-30 14:15:11 -07:00
r3_view_compiler perf(compiler): reduce amount of generated code for safe accesses and nullish coalescing (#41563) 2021-04-14 15:48:22 -07:00
r3_view_compiler_bindings perf(compiler): reduce amount of generated code for safe accesses and nullish coalescing (#41563) 2021-04-14 15:48:22 -07:00
r3_view_compiler_di/di refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_directives/matching refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_i18n perf(compiler): reduce amount of generated code for safe accesses and nullish coalescing (#41563) 2021-04-14 15:48:22 -07:00
r3_view_compiler_input_outputs refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_listener refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_providers refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_styling refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_template refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
source_mapping refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
BUILD.bazel test(compiler-cli): generate golden files for partial compilation (#39617) 2020-11-13 11:25:56 -08:00
list_golden_update_rules.ts refactor(compiler-cli): use semver range checking for partial versions (#39847) 2020-12-04 10:26:17 -08:00
test_case_schema.json test(compiler-cli): improve compliance test compile mode filtering (#39939) 2020-12-07 16:21:04 -08:00