angular/packages/platform-server/test
Andrew Kushnir 55965cbf8c fix(core): handle hydration of view containers for root components (#51247)
For cases when a root component also acts as an anchor node for a ViewContainerRef (for example, when ViewContainerRef is injected in a root component), there is a need to serialize information about the component itself, as well as an LContainer that represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info: (1) hydration info for the root component itself and (2) hydration info for the ViewContainerRef instance (an LContainer). Each piece of information is included into the hydration data (in the TransferState object) separately, thus we end up with 2 ids. Since we only have 1 root element, we encode both bits of info into a single string: ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view and 25 is the `ngh` for a root view which holds LContainer).

Previously, we were only including component-related information, thus all the views in the view container remained dehydrated and duplicated (client-rendered from scratch) on the client.

Resolves #51157.

PR Close #51247
2023-08-07 09:24:26 -07:00
..
BUILD.bazel refactor(core): internal tracker of pending tasks during initial rendering (#49576) 2023-03-28 16:19:31 -07:00
hydration_spec.ts fix(core): handle hydration of view containers for root components (#51247) 2023-08-07 09:24:26 -07:00
integration_spec.ts refactor(core): throw an error when hydration marker is missing from DOM (#51170) 2023-08-04 11:31:49 -04:00
transfer_state_spec.ts refactor(core): simplify state transfer escaping (#50201) 2023-05-10 11:31:34 -07:00