angular/packages/compiler-cli/test
Pete Bacon Darwin 08de52b9f0 feat(ivy): add source mappings to compiled Angular templates (#28055)
During analysis, the `ComponentDecoratorHandler` passes the component
template to the `parseTemplate()` function. Previously, there was little or
no information about the original source file, where the template is found,
passed when calling this function.

Now, we correctly compute the URL of the source of the template, both
for external `templateUrl` and in-line `template` cases. Further in the
in-line template case we compute the character range of the template
in its containing source file; *but only in the case that the template is
a simple string literal*. If the template is actually a dynamic value like
an interpolated string or a function call, then we do not try to add the
originating source file information.

The translator that converts Ivy AST nodes to TypeScript now adds these
template specific source mappings, which account for the file where
the template was found, to the templates to support stepping through the
template creation and update code when debugging an Angular application.

Note that some versions of TypeScript have a bug which means they cannot
support external template source-maps. We check for this via the
`canSourceMapExternalTemplates()` helper function and avoid trying to
add template mappings to external templates if not supported.

PR Close #28055
2019-02-12 20:58:28 -08:00
..
compliance refactor(compiler): use options argument for parsers (#28055) 2019-02-12 20:58:27 -08:00
diagnostics refactor(compiler): use options argument for parsers (#28055) 2019-02-12 20:58:27 -08:00
metadata test(ivy): mark failing test targets with fixme-ivy-jit and fixme-ivy-local tags (#26471) 2018-10-23 08:57:42 -07:00
ngcc build: support running compiler-cli tests on windows (#28352) 2019-02-05 14:31:10 -05:00
ngtsc feat(ivy): add source mappings to compiled Angular templates (#28055) 2019-02-12 20:58:28 -08:00
transformers build: fix failing compiler-cli tests on windows (#28352) 2019-02-05 14:31:10 -05:00
BUILD.bazel build: support running compiler-cli tests on windows (#28352) 2019-02-05 14:31:10 -05:00
extract_i18n_spec.ts build: remove unused "test.sh" leftover code in compiler-cli (#28352) 2019-02-05 14:31:10 -05:00
mocks.ts fix(compiler-cli): Use typescript to resolve modules for metadata (#22856) 2018-07-10 11:11:48 -07:00
ngc_spec.ts build: fix failing compiler-cli tests on windows (#28352) 2019-02-05 14:31:10 -05:00
ngtools_api_spec.ts fix(ivy): support listing lazy route for project-root-relative entry point in ngtsc (#28542) 2019-02-11 16:23:30 -08:00
perform_compile_spec.ts feat(compiler-cli): add support to extend angularCompilerOptions (#22717) 2018-09-19 16:17:28 -07:00
perform_watch_spec.ts build: fix failing compiler-cli tests on windows (#28352) 2019-02-05 14:31:10 -05:00
runfile_helpers.ts build: support running compiler-cli tests on windows (#28352) 2019-02-05 14:31:10 -05:00
test_support.ts test(ivy): test listing lazy routes to different root directories (#28542) 2019-02-11 16:23:30 -08:00