c37ec8b255
Previously, when the NgModule scope resolver discovered semantic errors within a users NgModules, it would throw assertion errors. TODOs in the codebase indicated these should become ts.Diagnostics eventually. Besides producing better-looking errors, there is another reason to make this change asap: these assertions were shadowing actual errors, via an interesting mechanism: 1) a component would produce a ts.Diagnostic during its analyze() step 2) as a result, it wouldn't register component metadata with the scope resolver 3) the NgModule for the component references it in exports, which was detected as an invalid export (no metadata registering it as a component). 4) the resulting assertion error would crash the compiler, hiding the real cause of the problem (an invalid component). This commit should mitigate this problem by converting scoping errors to proper ts.Diagnostics. Additionally, we should consider registering some marker indicating a class is a directive/component/pipe without actually requiring full metadata to be produced for it, which would allow suppression of errors like "invalid export" for such invalid types. PR Close #29191 |
||
---|---|---|
.. | ||
animations | ||
bazel | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
elements | ||
examples | ||
forms | ||
http | ||
language-service | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
platform-webworker | ||
platform-webworker-dynamic | ||
private/testing | ||
router | ||
service-worker | ||
upgrade | ||
BUILD.bazel | ||
README.md | ||
empty.ts | ||
goog.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig-build.json | ||
tsconfig-test.json | ||
tsconfig.json | ||
types.d.ts |
README.md
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
License: MIT