refactor(core): simplify hydration annotation key (#52207)

This commit drops the `ɵ` symbol from hydration annotation key: `__ɵnghData__` -> `__nghData__`. This helps ensure that there are no UTF8 symbols that might be damaged in case a web server is misconfigured.

Noticed while working on https://github.com/angular/angular/pull/52206.

PR Close #52207
This commit is contained in:
Andrew Kushnir 2023-10-13 17:07:42 -07:00 committed by Pawel Kozlowski
parent 262d4d52b5
commit 4e4ad5ab2e
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ import {CONTAINERS, DehydratedView, DISCONNECTED_NODES, ELEMENT_CONTAINERS, MULT
* The name of the key used in the TransferState collection,
* where hydration information is located.
*/
const TRANSFER_STATE_TOKEN_ID = '__ɵnghData__';
const TRANSFER_STATE_TOKEN_ID = '__nghData__';
/**
* Lookup key used to reference DOM hydration data (ngh) in `TransferState`.

View file

@ -34,7 +34,7 @@ const TEXT_NODE_SEPARATOR_COMMENT = 'ngtns';
const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = SKIP_HYDRATION_ATTR_NAME.toLowerCase();
const TRANSFER_STATE_TOKEN_ID = '__ɵnghData__';
const TRANSFER_STATE_TOKEN_ID = '__nghData__';
const NGH_ATTR_REGEXP = new RegExp(` ${NGH_ATTR_NAME}=".*?"`, 'g');
const EMPTY_TEXT_NODE_REGEXP = new RegExp(`<!--${EMPTY_TEXT_NODE_COMMENT}-->`, 'g');