Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.2 backport] perf(compiler-cli): cache source file for reporting type-checking dia… #47508

Closed

Commits on Sep 21, 2022

  1. perf(compiler-cli): cache source file for reporting type-checking dia…

    …gnostics
    
    When reporting type-checking diagnostics in external templates we create a
    `ts.SourceFile` of the template text, as this is needed to report Angular
    template diagnostics using TypeScript's diagnostics infrastructure. Each
    reported diagnostic would create its own `ts.SourceFile`, resulting in
    repeatedly parsing of the template text and potentially high memory usage
    if the template is large and there are many diagnostics reported. This commit
    caches the parsed template in the template mapping, such that all reported
    diagnostics get to reuse the same `ts.SourceFile`.
    
    Closes angular#47470
    JoostK committed Sep 21, 2022
    Copy the full SHA
    3e5f9ea View commit details
    Browse the repository at this point in the history