angular-cn/packages/compiler-cli/ngcc/test/rendering
Pete Bacon Darwin f22a6eb00e fix(ngcc): correctly match aliased classes between src and dts files (#34254)
The naïve matching algorithm we previously used to match declarations in
source files to declarations in typings files was based only on the name
of the thing being declared.  This did not handle cases where the declared
item had been exported via an alias - a common scenario when one of the two
file sets (source or typings) has been flattened, while the other has not.

The new algorithm tries to overcome this by creating two maps of export
name to declaration (i.e. `Map<string, ts.Declaration>`).
One for the source files and one for the typings files.
It then joins these two together by matching export names, resulting in a
new map that maps source declarations to typings declarations directly
(i.e. `Map<ts.Declaration, ts.Declaration>`).

This new map can handle the declaration names being different between the
source and typings as long as they are ultimately both exported with the
same alias name.

Further more, there is one map for "public exports", i.e. exported via the
root of the source tree (the entry-point), and another map for "private
exports", which are exported from individual files in the source tree but
not necessarily from the root. This second map can be used to "guess"
the mapping between exports in a deep (non-flat) file tree, which can be
used by ngcc to add required private exports to the entry-point.

Fixes #33593

PR Close #34254
2019-12-18 11:25:01 -08:00
..
commonjs_rendering_formatter_spec.ts refactor(ngcc): use bundle src to create reflection hosts (#34254) 2019-12-18 11:25:01 -08:00
dts_renderer_spec.ts fix(ngcc): correctly match aliased classes between src and dts files (#34254) 2019-12-18 11:25:01 -08:00
esm5_rendering_formatter_spec.ts refactor(ngcc): use bundle src to create reflection hosts (#34254) 2019-12-18 11:25:01 -08:00
esm_rendering_formatter_spec.ts fix(ngcc): correctly match aliased classes between src and dts files (#34254) 2019-12-18 11:25:01 -08:00
renderer_spec.ts refactor(ngcc): use bundle src to create reflection hosts (#34254) 2019-12-18 11:25:01 -08:00
umd_rendering_formatter_spec.ts refactor(ngcc): use bundle src to create reflection hosts (#34254) 2019-12-18 11:25:01 -08:00