mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
977bccd24d
This is just shifting around some encoding strategies for Flight in
preparation for more types.
```
S1:"react.suspense"
J2:["$", "$1", {children: "@3"}]
J3:"Hello"
```
```
1:"$Sreact.suspense"
2:["$", "$1", {children: "$L3"}]
3:"Hello"
```
35 lines
686 B
JavaScript
35 lines
686 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import type {ModuleMetaData} from 'ReactFlightNativeRelayServerIntegration';
|
|
|
|
export type JSONValue =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| {+[key: string]: JSONValue}
|
|
| Array<JSONValue>;
|
|
|
|
export type RowEncoding =
|
|
| ['O', number, JSONValue]
|
|
| ['I', number, ModuleMetaData]
|
|
| ['P', number, string]
|
|
| ['S', number, string]
|
|
| [
|
|
'E',
|
|
number,
|
|
{
|
|
digest: string,
|
|
message?: string,
|
|
stack?: string,
|
|
...
|
|
},
|
|
];
|