angular-docs-cn/packages/compiler-cli/test/ngtsc
Alex Rickabaugh c37ec8b255 fix(ivy): produce ts.Diagnostics for NgModule scope errors (#29191)
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
2019-03-08 14:21:48 -08:00
..
fake_core style: enforce buildifier lint on CI (#28186) 2019-02-26 16:57:41 -08:00
BUILD.bazel fix(ivy): produce ts.Diagnostics for NgModule scope errors (#29191) 2019-03-08 14:21:48 -08:00
env.ts fix(ivy): avoid missing imports for types that can be represented as values (#28941) 2019-02-27 15:13:40 -08:00
ngtsc_spec.ts fix(ivy): generate type references to a default import (#29146) 2019-03-08 11:57:08 -08:00
scope_spec.ts fix(ivy): produce ts.Diagnostics for NgModule scope errors (#29191) 2019-03-08 14:21:48 -08:00
sourcemap_utils.ts feat(ivy): add source mappings to compiled Angular templates (#28055) 2019-02-12 20:58:28 -08:00
template_mapping_spec.ts test(ivy): add template source mapping tests (#28055) 2019-02-12 20:58:28 -08:00
template_typecheck_spec.ts build: remove unused "test.sh" leftover code in compiler-cli (#28352) 2019-02-05 14:31:10 -05:00