[Fizz] Move DOM/Native format configs to their respective packages (#20994)

* Move DOM/Native format configs to their respective packages

The streaming configs (Node/Browser) are different because they operate at
another dimension that exists in each package.

* Use escapeTextForBrowser to encode dynamic strings

We can now use local dependencies
This commit is contained in:
Sebastian Markbåge
2021-03-13 06:54:59 -08:00
committed by GitHub
parent a3d71ea21b
commit 4fddd405be
6 changed files with 7 additions and 8 deletions
@@ -14,6 +14,7 @@ import {
convertStringToBuffer,
} from 'react-server/src/ReactServerStreamConfig';
import escapeTextForBrowser from './escapeTextForBrowser';
import invariant from 'shared/invariant';
// Per response,
@@ -46,13 +47,11 @@ export function createSuspenseBoundaryID(
}
function encodeHTMLIDAttribute(value: string): string {
// TODO: This needs to be encoded for security purposes.
return value;
return escapeTextForBrowser(value);
}
function encodeHTMLTextNode(text: string): string {
// TOOD: This needs to be encoded for security purposes.
return text;
return escapeTextForBrowser(text);
}
export function pushTextInstance(
@@ -7,4 +7,4 @@
* @flow
*/
export * from '../ReactDOMServerFormatConfig';
export * from 'react-dom/src/server/ReactDOMServerFormatConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from '../ReactDOMServerFormatConfig';
export * from 'react-dom/src/server/ReactDOMServerFormatConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from '../ReactDOMServerFormatConfig';
export * from 'react-dom/src/server/ReactDOMServerFormatConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from '../ReactNativeServerFormatConfig';
export * from 'react-native-renderer/src/server/ReactNativeServerFormatConfig';