Skip to content

Optimizing incremental compilation status tracker #40728

@JoostK

Description

@JoostK

This issue is created as a status tracker to implement an optimization for incremental compilations to enable more effective reuse of work from the previous compilation. The general idea is that decorated classes will be compared to their equivalent in the prior compilation and skip emit if nothing relevant has changed. There has been a working prototype in #39791 which implements this idea, which has since been refined to a simplified yet more effective approach.

This work aims to address #34867 and #40635. One initial improvement in response to #40635 is pending in angular/angular-cli#19986 which avoids an inefficiency in Webpack's dependency mechanism resulting in a significant improvement of rebuild times. This work should take this one step further and avoid emit of files when their generated output could not possibly be affected by the change.

  • Implement semantic dependency graph and symbol comparison (ngtsc/semantic-updates)
  • Refactor the registration of semantic symbols
  • Work on remote scoping scenarios
  • Address scenarios that may result in broken type-check-blocks
    • Generic type parameters
    • Changes to inheritance chains
    • Changes to type-checking metadata
  • Test various scenarios:
    • Update expectations for existing tests.
    • Test behavior in combination with errors in the program.
    • Test behavior in combination with external declarations.
    • Changing an NgModule into a Component, and all other relevant combinations.
    • Introducing and breaking cyclic component includes to verify remote scoping.
    • Classes that are exported under a different name
    • Add template type-checking tests for generic type parameters
    • Add template type-checking tests for inline ctors
    • Add template type-checking tests for various metadata properties
    • Add template type-checking tests for inheritance
  • Update ngcc tests (i.e. fix build errors)
  • Update incremental rebuild documentation.
  • Review

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compilerIssues related to `ngc`, Angular's template compilerarea: language-serviceIssues related to Angular's VS Code language servicearea: performanceIssues related to performancefeatureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions