Skip to content

Conversation

@JeanMeche
Copy link
Member

Non-destructive hydration expects the DOM tree to have the same structure in both places. With this commit, the app will throw an error if comments are stripped out by the http server (eg by some CDNs).

fixes #51160

I'll create a dedicate doc for the error in a subsequent PR.

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)

Does this PR introduce a breaking change?

  • No

@JeanMeche JeanMeche force-pushed the chore/ssr-marker branch 3 times, most recently from 49748d2 to 04f37f0 Compare July 26, 2023 00:18
@JeanMeche JeanMeche force-pushed the chore/ssr-marker branch 2 times, most recently from 604aa26 to 28367ca Compare July 26, 2023 12:04
@JeanMeche JeanMeche marked this pull request as ready for review July 26, 2023 14:14
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: dev-infra

@pullapprove pullapprove bot requested a review from josephperrott July 26, 2023 14:15
@jessicajaniuk jessicajaniuk 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 Jul 26, 2023
@ngbot ngbot bot added this to the Backlog milestone Jul 26, 2023
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.

@JeanMeche thanks for the changes, everything looks good! The code is in the right location, just left a few comments with proposed improvements. Thank you.

@JeanMeche JeanMeche force-pushed the chore/ssr-marker branch 2 times, most recently from 5d58766 to ce1283a Compare July 28, 2023 12:43
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.

@JeanMeche thanks for addressing the feedback! 👍 I've left a final comment and we should be ready for the next steps: presubmit and merge.

@JeanMeche JeanMeche force-pushed the chore/ssr-marker branch 2 times, most recently from 4c9389c to df3f675 Compare July 31, 2023 10:02
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: fw-security

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.

@JeanMeche thanks for addressing comments 👍 I did a final pass and added a couple more (all minor comments).

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.

@JeanMeche thanks for the update 👍

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.

Reviewed-for: public-api

@AndrewKushnir
Copy link
Contributor

@JeanMeche it looks like there is a merge conflict with the main branch. Could you please rebase and resolve conflicts when you get a chance? Thank you.

@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 1, 2023
@JeanMeche
Copy link
Member Author

@AndrewKushnir One final group of reviewers and we're good 👍

@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Aug 1, 2023
@AndrewKushnir
Copy link
Contributor

Presubmit.

Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: presubmit The PR is in need of a google3 presubmit labels Aug 1, 2023
@ngbot
Copy link

ngbot bot commented Aug 1, 2023

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing
    pending status "pullapprove" is pending
    pending 3 pending code reviews

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@AndrewKushnir
Copy link
Contributor

Caretaker note: the presubmit is "green", the only outstanding thing is an extra review from the fw-security group (in addition to Joey's approval). The reason fw-security was added is this change, which adds dom.iterable to compilerOptions.lib list. I think Joey's approval in this case is enough and we can proceed with the merge.

@dylhunn dylhunn added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Aug 4, 2023
@dylhunn
Copy link
Contributor

dylhunn commented Aug 4, 2023

@JeanMeche This PR has a merge conflict with the patch branch. I'm merging it into just minor. Feel free to create a patch rebase if you want to land it in patch.

@dylhunn
Copy link
Contributor

dylhunn commented Aug 4, 2023

This PR was merged into the repository by commit 0a38dc3.

@dylhunn dylhunn closed this in 0a38dc3 Aug 4, 2023
@AndrewKushnir
Copy link
Contributor

@JeanMeche it looks like this PR only made it into the main branch, which is targeting the next major. It'd be great to include this change into the upcoming v16.2.0. Could you please create a version of this PR targeting 16.2.x branch (and label is as "target: rc")? Thank you.

@JeanMeche
Copy link
Member Author

@AndrewKushnir @dylhunn I made it available at #51276

JeanMeche added a commit to JeanMeche/angular that referenced this pull request Aug 4, 2023
…DOM (angular#51170)

non-destructive hydration expects the DOM tree to have the same structure in both places.
With this commit, the app will throw an error if comments are stripped out by the http server (eg by some CDNs).
@AndrewKushnir
Copy link
Contributor

@JeanMeche thanks a lot for creating a patch version of this PR! 👍

dylhunn pushed a commit that referenced this pull request Aug 7, 2023
…DOM (#51170) (#51276)

non-destructive hydration expects the DOM tree to have the same structure in both places.
With this commit, the app will throw an error if comments are stripped out by the http server (eg by some CDNs).

PR Close #51276
@AndrewKushnir
Copy link
Contributor

@JeanMeche please let me know if you want me to put together an error guide page for this error or if you get a chance to help (I think we have a lot of useful text in code comments, we can use them in the error guide). Without an error guide page, we'd only show an error code in prod mode (which is where the problem would happen). Thank you.

@JeanMeche
Copy link
Member Author

@AndrewKushnir I've opened PR #51340 👍

@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 Sep 12, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…DOM (angular#51170)

non-destructive hydration expects the DOM tree to have the same structure in both places.
With this commit, the app will throw an error if comments are stripped out by the http server (eg by some CDNs).

fixes angular#51160

PR Close angular#51170
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 merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hydration: detect when index.html is altered between the server and the client

5 participants