angular/packages/compiler-cli/ngcc/test
JoostK a87951a28f fix(ngcc): prevent including JavaScript sources outside of the package (#37596)
When ngcc creates an entry-point program, the `allowJs` option is enabled
in order to operate on the JavaScript source files of the entry-point.
A side-effect of this approach is that external modules that don't ship
declaration files will also have their JavaScript source files loaded
into the program, as the `allowJs` flag allows for them to be imported.
This may pose an issue in certain edge cases, where ngcc would inadvertently
operate on these external modules. This can introduce all sorts of undesirable
behavior and incompatibilities, e.g. the reflection host that is selected for
the entry-point's format could be incompatible with that of the external
module's JavaScript bundles.

To avoid these kinds of issues, module resolution that would resolve to
a JavaScript file located outside of the package will instead be rejected,
as if the file would not exist. This would have been the behavior when
`allowJs` is set to false, which is the case in typical Angular compilations.

Fixes #37508

PR Close #37596
2020-06-29 12:21:22 -07:00
..
analysis refactor(ngcc): let isWithinPackage operate on paths instead of source files (#37596) 2020-06-29 12:21:22 -07:00
dependencies refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
entry_point_finder perf(ngcc): use EntryPointManifest to speed up noop ProgramBaseEntryPointFinder (#37665) 2020-06-25 14:11:03 -07:00
execution fix(ngcc): ensure lockfile is removed when analyzeFn fails (#37739) 2020-06-29 10:29:11 -07:00
helpers fix(ngcc): prevent including JavaScript sources outside of the package (#37596) 2020-06-29 12:21:22 -07:00
host refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
integration fix(ngcc): prevent including JavaScript sources outside of the package (#37596) 2020-06-29 12:21:22 -07:00
locking refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
migrations refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
packages fix(ngcc): prevent including JavaScript sources outside of the package (#37596) 2020-06-29 12:21:22 -07:00
rendering refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
writing docs(ngcc): add additional next steps to an error (#37672) 2020-06-25 11:37:43 -07:00
BUILD.bazel refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
ngcc_options_spec.ts refactor(ngcc): move logging code into ngtsc (#37114) 2020-06-22 13:38:47 -07:00
utils_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00