angular-cn/packages/compiler-cli/ngcc/test/analysis
JoostK 002a97d852 fix(ngcc): ensure private exports are added for `ModuleWithProviders` (#32902)
ngcc may need to insert public exports into the bundle's source as well
as to the entry-point's declaration file, as the Ivy compiler may need
to create import statements to internal library types. The way ngcc
knows which exports to add is through the references registry, to which
references to things that require a public export are added by the
various analysis steps that are executed.

One of these analysis steps is the augmentation of declaration files
where functions that return `ModuleWithProviders` are updated so that a
generic type argument is added that corresponds with the `NgModule` that
is actually imported. This type has to be publicly exported, so the
analyzer step has to add the module type to the references registry.

A problem occurs when `ModuleWithProviders` already has a generic type
argument, in which case no update of the declaration file is necessary.
This may happen when 1) ngcc is processing additional bundle formats, so
that the declaration file has already been updated while processing the
first bundle format, or 2) when a package is processed which already
contains the generic type in its source. In both scenarios it may occur
that the referenced `NgModule` type does not yet have a public export,
so it is crucial that a reference to the type is added to the
references registry, which ngcc failed to do.

This commit fixes the issue by always adding the referenced `NgModule`
type to the references registry, so that a public export will always be
created if necessary.

Resolves FW-1575

PR Close #32902
2019-09-30 14:11:16 -07:00
..
decoration_analyzer_spec.ts refactor(ivy): ngcc - remove `formatProperty` from `EntryPointBundle` (#32052) 2019-08-08 11:14:38 -07:00
migration_host_spec.ts fix(ngcc): consistently use outer declaration for classes (#32539) 2019-09-12 11:12:10 -07:00
module_with_providers_analyzer_spec.ts fix(ngcc): ensure private exports are added for `ModuleWithProviders` (#32902) 2019-09-30 14:11:16 -07:00
private_declarations_analyzer_spec.ts refactor(ivy): ngcc - remove `formatProperty` from `EntryPointBundle` (#32052) 2019-08-08 11:14:38 -07:00
references_registry_spec.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
switch_marker_analyzer_spec.ts refactor(ivy): ngcc - remove `formatProperty` from `EntryPointBundle` (#32052) 2019-08-08 11:14:38 -07:00
util_spec.ts fix(ivy): ngcc - do not analyze files outside the current package (#30591) 2019-06-26 08:00:03 -07:00