Skip to content

refactor(compiler): rework defer block analysis#54700

Closed
crisbeto wants to merge 0 commit intoangular:mainfrom
crisbeto:deferred-partial-refactor
Closed

refactor(compiler): rework defer block analysis#54700
crisbeto wants to merge 0 commit intoangular:mainfrom
crisbeto:deferred-partial-refactor

Conversation

@crisbeto
Copy link
Member

@crisbeto crisbeto commented Mar 5, 2024

Currently we have the deferrableDeclToImportDecl, deferBlocks, deferrableTypes and deferBlockDepsEmitMode fields on the R3ComponentMetadata which is incorrect, because the interface is used both for JIT and AOT mode even though the information for those fields is AOT-specific. It will be problematic for partial compilation since the runtime will have a reference to the dependency loading function, but will not be able to provide any of the other information.

These changes make the following refactors:

  1. It changes the defer-related information in R3ComponentMetadata to include only references to dependency functions which can be provided both in JIT and AOT.
  2. Moves the AOT-specific defer analysis into the ComponentResolutionData.
  3. Moves the construction the defer dependency function into the compilation phase of the ComponentDecoratorHandler.
  4. Drops support for defer blocks from the TemplateDefinitionBuilder. This allows us to clean up some TDB-specific code and shouldn't have an effect on users since the TDB isn't used anymore.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: compiler Issues related to `ngc`, Angular's template compiler labels Mar 5, 2024
@ngbot ngbot bot added this to the Backlog milestone Mar 5, 2024
@crisbeto crisbeto requested a review from AndrewKushnir March 5, 2024 11:34
@crisbeto crisbeto marked this pull request as ready for review March 5, 2024 11:34
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crisbeto great refactoring, thank you 👍 Just left a few minor comments.

@crisbeto crisbeto force-pushed the deferred-partial-refactor branch from b5a9e6e to cca1730 Compare March 6, 2024 12:30
@crisbeto
Copy link
Member Author

crisbeto commented Mar 6, 2024

Feedback has been addressed. Will mark this for merge once the RC goes out.

@crisbeto crisbeto added target: major This PR is targeted for the next major release action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Mar 6, 2024
@atscott
Copy link
Contributor

atscott commented Mar 7, 2024

This PR was merged into the repository by commit eee620a.

@atscott atscott closed this in eee620a Mar 7, 2024
atscott added a commit to atscott/angular that referenced this pull request Mar 8, 2024
@atscott atscott reopened this Mar 8, 2024
@atscott atscott added state: blocked and removed action: merge The PR is ready for merge by the caretaker labels Mar 8, 2024
atscott added a commit that referenced this pull request Mar 8, 2024
@crisbeto crisbeto closed this Mar 8, 2024
@crisbeto crisbeto force-pushed the deferred-partial-refactor branch from cca1730 to fb189c6 Compare March 8, 2024 06:23
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: compiler Issues related to `ngc`, Angular's template compiler state: blocked target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants