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
Hydration: detect when index.html is altered between the server and the client #51160
Labels
area: core
Issues related to the framework runtime
core: hydration
feature: in backlog
Feature request for which voting has completed and is now in the backlog
feature
Issue that requests a new feature
Milestone
Comments
AndrewKushnir
added
feature
Issue that requests a new feature
area: core
Issues related to the framework runtime
feature: in backlog
Feature request for which voting has completed and is now in the backlog
core: hydration
labels
Jul 24, 2023
Clever! I like it. |
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 25, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 25, 2023
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
2 tasks
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 25, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 26, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 26, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 26, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 26, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 28, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 28, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 31, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 31, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Jul 31, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Aug 1, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
Aug 1, 2023
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
JeanMeche
added a commit
to JeanMeche/angular
that referenced
this issue
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). fixes angular#51160 PR Close angular#51170
thomasturrell
pushed a commit
to thomasturrell/angular
that referenced
this issue
Aug 29, 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). fixes angular#51160 PR Close angular#51170
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this issue
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
area: core
Issues related to the framework runtime
core: hydration
feature: in backlog
Feature request for which voting has completed and is now in the backlog
feature
Issue that requests a new feature
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
The non-destructive hydration expects the DOM tree to have the same structure in both places. This also includes whitespaces and comment nodes that Angular produces during the rendering on the server. Those whitespaces and nodes must be present in the HTML generated by the server-side rendering process. This is also documented at: https://angular.io/guide/hydration#constraints.
In practice, some CDNs (example) have mechanisms to remove all comment nodes and spaces from all text nodes from HTML while serving the content (there are also cases where this type of optimization is performed at the build step). Those mechanisms are frequently enabled by default. This leads to situations where an application worked in dev mode correctly, but started failing in production. Since the production code is also minified, it makes it hard to look at the stack trace and identify the origin of the problem.
This feature requests proposes that we add a special detection mechanism for such cases. For example, we can do the following:
<body>
)One of the examples where this issue becomes a hard-to-debug problem: #50133 (comment)
The text was updated successfully, but these errors were encountered: