-
Notifications
You must be signed in to change notification settings - Fork 47.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flight] Simplify Relay row protocol (#20168)
* Simplify Relay protocol integration * Encode Relay rows as tuples instead of objects This is slightly more compact and more ressembles more closely the encoding we use for the raw stream protocol.
- Loading branch information
1 parent
16e6dad
commit 35e53b4
Showing
13 changed files
with
132 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/react-transport-dom-relay/src/ReactFlightDOMRelayProtocol.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its 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 'ReactFlightDOMRelayServerIntegration'; | ||
|
||
export type JSONValue = | ||
| string | ||
| number | ||
| boolean | ||
| null | ||
| {+[key: string]: JSONValue} | ||
| Array<JSONValue>; | ||
|
||
export type RowEncoding = | ||
| ['J', number, JSONValue] | ||
| ['M', number, ModuleMetaData] | ||
| [ | ||
'E', | ||
number, | ||
{ | ||
message: string, | ||
stack: string, | ||
... | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/react-transport-native-relay/src/ReactFlightNativeRelayProtocol.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its 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 = | ||
| ['J', number, JSONValue] | ||
| ['M', number, ModuleMetaData] | ||
| [ | ||
'E', | ||
number, | ||
{ | ||
message: string, | ||
stack: string, | ||
... | ||
}, | ||
]; |
Oops, something went wrong.