Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
One framework. Mobile & desktop.
TypeScript JavaScript HTML Python CSS Shell Other
Branch: master
Clone or download
JoostK and kara fix(ngcc): resolve imports in `.d.ts` files for UMD/CommonJS bundles (#…
…32619)

In ngcc's reflection host for UMD and CommonJS bundles, custom logic is
present to resolve import details of an identifier. However, this custom
logic is unable to resolve an import for an identifier inside of
declaration files, as such files use the regular ESM import syntax.

As a consequence of this limitation, ngtsc is unable to resolve
`ModuleWithProviders` imports that are declared in an external library.
In that situation, ngtsc determines the type of the actual `NgModule`
that is imported, by looking in the library's declaration files for the
generic type argument on `ModuleWithProviders`. In this process, ngtsc
resolves the import for the `ModuleWithProviders` identifier to verify
that it is indeed the `ModuleWithProviders` type from `@angular/core`.
So, when the UMD reflection host was in use this resolution would fail,
therefore no `NgModule` type could be detected.

This commit fixes the bug by using the regular import resolution logic
in addition to the custom resolution logic that is required for UMD
and CommonJS bundles.

Fixes #31791

PR Close #32619
Latest commit 3c7da76 Sep 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci ci: pin docker images by ID for hermeticity (#32602) Sep 11, 2019
.devcontainer build: add recommended config files for VSCode remote development (#3… May 20, 2019
.github docs: add undecorated classes migration faq (#32478) Sep 12, 2019
.vscode build: add recommended config files for VSCode remote development (#3… May 20, 2019
aio docs: add undecorated classes migration faq (#32478) Sep 12, 2019
docs docs: create Issue and Pull Request markdown doc, explaining automati… Aug 30, 2019
integration fix(core): initialize global ngDevMode without toplevel side effects (#… Sep 12, 2019
modules revert: refactor(ivy): remove styling state storage and introduce dir… Sep 11, 2019
packages fix(ngcc): resolve imports in `.d.ts` files for UMD/CommonJS bundles (#… Sep 12, 2019
scripts ci: exclude dev-app subpackage targets in material-unit-tests job (#3… Sep 10, 2019
third_party build: bump yarn requirement to 1.17.3 (#32344) Aug 29, 2019
tools feat(core): Deprecate TestBed.get as deprecated (#32406) Sep 12, 2019
.bazelignore build: update to rules_nodejs 0.32.2 (#31325) Jul 1, 2019
.bazelrc build: use bazel workers for ngc and tsc in local development (#32246) Aug 21, 2019
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. Apr 2, 2015
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) Dec 18, 2018
.gitattributes test: fix ts api guardian and public guard tests on windows (#30105) Apr 26, 2019
.gitignore build: add .vimrc to .gitignore (#32253) Aug 22, 2019
.mailmap build: add a Git .mailmap with my new name (#19550) Oct 9, 2017
.nvmrc build: update .nvmrc file to correct node version (#25992) Sep 18, 2018
BUILD.bazel build: update to rules_nodejs 0.32.2 (#31325) Jul 1, 2019
CHANGELOG.md docs: remove duplicate entry in changelog for 8.2.6 Sep 11, 2019
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC Feb 28, 2018
CONTRIBUTING.md build: add `ngcc` as a valid commit message scope (#32144) Aug 15, 2019
LICENSE build: bump year (#27880) Jan 11, 2019
README.md docs: fix typo of Typescript to TypeScript (#32153) Aug 15, 2019
WORKSPACE build: bump yarn requirement to 1.17.3 (#32344) Aug 29, 2019
browser-providers.conf.js ci: re-enable chrome mobile tests on android (#32447) Sep 3, 2019
browser_repositories.bzl build(bazel): update to latest stable chromium 74 on osx and linux fo… May 16, 2019
gulpfile.js build(zone.js): add changelog gulptask for zone.js (#31852) Jul 26, 2019
karma-js.conf.js refactor(ivy): update the compiler to emit `$localize` tags (#31609) Aug 30, 2019
package.json release: cut the v9.0.0-next.6 release Sep 11, 2019
protractor-perf.conf.js fixup! test(ivy): make the test run with benchpress (#30449) May 17, 2019
renovate.json ci: update packageFiles to be renovated (#29071) Mar 5, 2019
shims_for_IE.js Revert "refactor: add license header to JS files & format files (#12035 Oct 4, 2016
test-events.js fix(platform-browser): run BLACK_LISTED_EVENTS outside of ngZone (#18993 Sep 5, 2017
test-main.js refactor(ivy): update the compiler to emit `$localize` tags (#31609) Aug 30, 2019
tslint.json refactor: remove toplevel property accesses (#29329) May 16, 2019
yarn.lock feat(bazel): update to the latest `@microsoft/api-extractor` (#32185) Aug 30, 2019
yarn.lock.readme.md build: remove travisci leftovers (#27979) Jan 9, 2019

README.md

You can’t perform that action at this time.