Skip to content

refactor(core): add skipped defer blocks count to ngDevMode#59188

Closed
thePunderWoman wants to merge 1 commit intoangular:mainfrom
thePunderWoman:hydration-info
Closed

refactor(core): add skipped defer blocks count to ngDevMode#59188
thePunderWoman wants to merge 1 commit intoangular:mainfrom
thePunderWoman:hydration-info

Conversation

@thePunderWoman
Copy link
Copy Markdown
Contributor

This adds the skipped defer blocks to the counts in ngDevMode and the logged hydration information.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)

Does this PR introduce a breaking change?

  • Yes
  • No

@thePunderWoman thePunderWoman added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release labels Dec 13, 2024
@ngbot ngbot bot added this to the Backlog milestone Dec 13, 2024
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 13, 2024
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 13, 2024
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 13, 2024
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test seems to reflect the change in the packages/core/src/hydration/annotate.ts file, but I'd like to propose that we add explicit tests (or explicit checks to existing tests) to verify that there are no annotations present for defer blocks without the hydrate triggers.

It looks like we can also omit "t":[] from the serialized data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've also noticed that we serialize "p": null and created a quick PR to avoid this extra annotation (since it's unrelated to trigger data): #59190.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a good call out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This case is the situation where there's an empty t array because of jsaction triggers, which don't get included in the serialized block data. So the defer block is still incrementally hydratable, but there's nothing in the array. Definitely safe to omit from the annotation data.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, explicit tests for these annotations have been added.

@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 13, 2024
This adds the skipped defer blocks to the counts in ngDevMode and the logged hydration information.
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 16, 2024
@ngbot ngbot bot modified the milestone: Backlog Dec 16, 2024
@thePunderWoman thePunderWoman added 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 labels Dec 16, 2024
@AndrewKushnir
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 4a2df56.

The changes were merged into the following branches: main, 19.0.x

AndrewKushnir pushed a commit that referenced this pull request Dec 16, 2024
This adds the skipped defer blocks to the counts in ngDevMode and the logged hydration information.

PR Close #59188
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Jan 16, 2025
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
…59188)

This adds the skipped defer blocks to the counts in ngDevMode and the logged hydration information.

PR Close angular#59188
@thePunderWoman thePunderWoman deleted the hydration-info branch May 23, 2025 13:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants