Skip to content

Commit 0bff4ac

Browse files
committed
more flow
1 parent bf9720e commit 0bff4ac

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

packages/react-server-native-relay/src/ReactFlightNativeRelayClient.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
resolveModel,
1717
resolveModule,
1818
resolveSymbol,
19-
resolveError,
19+
resolveErrorDev,
20+
resolveErrorProd,
2021
close,
2122
getRoot,
2223
} from 'react-client/src/ReactFlightClient';
@@ -34,7 +35,20 @@ export function resolveRow(response: Response, chunk: RowEncoding): void {
3435
// $FlowFixMe: Flow doesn't support disjoint unions on tuples.
3536
resolveSymbol(response, chunk[1], chunk[2]);
3637
} else {
37-
// $FlowFixMe: Flow doesn't support disjoint unions on tuples.
38-
resolveError(response, chunk[1], chunk[2].message, chunk[2].stack);
38+
if (__DEV__) {
39+
resolveErrorDev(
40+
response,
41+
chunk[1],
42+
// $FlowFixMe: Flow doesn't support disjoint unions on tuples.
43+
chunk[2].digest,
44+
// $FlowFixMe: Flow doesn't support disjoint unions on tuples.
45+
chunk[2].message || '',
46+
// $FlowFixMe: Flow doesn't support disjoint unions on tuples.
47+
chunk[2].stack || '',
48+
);
49+
} else {
50+
// $FlowFixMe: Flow doesn't support disjoint unions on tuples.
51+
resolveErrorProd(response, chunk[1], chunk[2].digest);
52+
}
3953
}
4054
}

packages/react-server-native-relay/src/ReactFlightNativeRelayProtocol.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ export type RowEncoding =
2626
'E',
2727
number,
2828
{
29-
message: string,
30-
stack: string,
29+
digest: string,
30+
message?: string,
31+
stack?: string,
3132
...
3233
},
3334
];

0 commit comments

Comments
 (0)