feat(core): add support for i18n hydration #54823
feat(core): add support for i18n hydration #54823devknoll wants to merge 3 commits intoangular:mainfrom
Conversation
58c610e to
6ea9d82
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
@devknoll thanks for the PR, the change looks very good 👍 I did a first review pass and left some comments. Please let me know once the feedback is addressed, I will do another pass. Thank you.
6ea9d82 to
39b02b0
Compare
39b02b0 to
239770e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
AndrewKushnir
left a comment
There was a problem hiding this comment.
@devknoll thanks for addressing the feedback! 👍
I've left a few more comments and will do another pass on the main algorithm tomorrow.
f55abef to
d899bd9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
d899bd9 to
52c519e
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
@devknoll Thanks for the update, I did another pass over the main logic and proposed a few changes.
52c519e to
4f7ceb7
Compare
4f7ceb7 to
5bfeed8
Compare
df2a879 to
6ef2a88
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
@devknoll looks great 👍
4c72103 to
a2a99f9
Compare
Add support for hydrating i18n blocks. This is accomplished by serializing information about selected ICU cases for a block during server-side rendering. During hydration, this data is read and is used to traverse both an AST of the translated message and the DOM, in parallel, to map each LView with an RNode. Finally, this mapping is used while nodes are being created (either via i18n or their respective instructions) to locate existing nodes.
Modifies the i18n pre-hydration logic to correctly support content projection and elements that act as view containers.
Rework the i18n cleanup behavior to more closely match that of containers. Specifically, we assume that nodes are going to be claimed unless they are part of a branching ICU block. During hydration, we then track which ICU case was active at serialization time, and which was active during hydration. Any remaining cases that weren't used during hydration are then cleaned up.
a2a99f9 to
9e3f2d1
Compare
|
This PR was merged into the repository by commit a5fa279. |
Modifies the i18n pre-hydration logic to correctly support content projection and elements that act as view containers. PR Close #54823
Rework the i18n cleanup behavior to more closely match that of containers. Specifically, we assume that nodes are going to be claimed unless they are part of a branching ICU block. During hydration, we then track which ICU case was active at serialization time, and which was active during hydration. Any remaining cases that weren't used during hydration are then cleaned up. PR Close #54823
|
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. |
Add support for hydrating i18n blocks. This is accomplished by serializing information about selected ICU cases for a block during server-side rendering. During hydration, this data is read and is used to traverse both an AST of the translated message and the DOM, in parallel, to map each LView with an RNode. Finally, this mapping is used while nodes are being created (either via i18n or their respective instructions) to locate existing nodes. PR Close angular#54823
Modifies the i18n pre-hydration logic to correctly support content projection and elements that act as view containers. PR Close angular#54823
…lar#54823) Rework the i18n cleanup behavior to more closely match that of containers. Specifically, we assume that nodes are going to be claimed unless they are part of a branching ICU block. During hydration, we then track which ICU case was active at serialization time, and which was active during hydration. Any remaining cases that weren't used during hydration are then cleaned up. PR Close angular#54823
Add support for hydrating i18n blocks. This is accomplished by serializing information about selected ICU cases for a block during server-side rendering. During hydration, this data is read and is used to traverse both an AST of the translated message and the DOM, in parallel, to map each LView with an RNode. Finally, this mapping is used while nodes are being created (either via i18n or their respective instructions) to locate existing nodes. PR Close angular#54823
Modifies the i18n pre-hydration logic to correctly support content projection and elements that act as view containers. PR Close angular#54823
…lar#54823) Rework the i18n cleanup behavior to more closely match that of containers. Specifically, we assume that nodes are going to be claimed unless they are part of a branching ICU block. During hydration, we then track which ICU case was active at serialization time, and which was active during hydration. Any remaining cases that weren't used during hydration are then cleaned up. PR Close angular#54823

Add support for hydrating i18n blocks. This is accomplished by serializing information about selected ICU cases for a block during server-side rendering.
During hydration, this data is read and is used to traverse both an AST of the translated message and the DOM, in parallel, to map each LView with an RNode.
Finally, this mapping is used while nodes are being created (either via i18n or their respective instructions) to locate existing nodes.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information