Skip to content

Commit dc1e4bc

Browse files
committed
lint... also merging is hard
1 parent a61881e commit dc1e4bc

File tree

4 files changed

+9
-55
lines changed

4 files changed

+9
-55
lines changed

packages/react-client/src/ReactFlightClient.js

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ export type JSONValue =
4747

4848
const PENDING = 0;
4949
const RESOLVED_MODEL = 1;
50-
const RESOLVED_PROVIDER = 2;
51-
const RESOLVED_MODULE = 3;
52-
const INITIALIZED = 4;
53-
const ERRORED = 5;
50+
const RESOLVED_MODULE = 2;
51+
const INITIALIZED = 3;
52+
const ERRORED = 4;
5453

5554
type PendingChunk = {
5655
_status: 0,
@@ -64,34 +63,27 @@ type ResolvedModelChunk = {
6463
_response: Response,
6564
then(resolve: () => mixed): void,
6665
};
67-
type ResolvedProviderChunk = {
68-
_status: 2,
69-
_value: string,
70-
_response: Response,
71-
then(resolve: () => mixed): void,
72-
};
7366
type ResolvedModuleChunk<T> = {
74-
_status: 3,
67+
_status: 2,
7568
_value: ModuleReference<T>,
7669
_response: Response,
7770
then(resolve: () => mixed): void,
7871
};
7972
type InitializedChunk<T> = {
80-
_status: 4,
73+
_status: 3,
8174
_value: T,
8275
_response: Response,
8376
then(resolve: () => mixed): void,
8477
};
8578
type ErroredChunk = {
86-
_status: 5,
79+
_status: 4,
8780
_value: Error,
8881
_response: Response,
8982
then(resolve: () => mixed): void,
9083
};
9184
type SomeChunk<T> =
9285
| PendingChunk
9386
| ResolvedModelChunk
94-
| ResolvedProviderChunk
9587
| ResolvedModuleChunk<T>
9688
| InitializedChunk<T>
9789
| ErroredChunk;
@@ -127,8 +119,6 @@ function readChunk<T>(chunk: SomeChunk<T>): T {
127119
return chunk._value;
128120
case RESOLVED_MODEL:
129121
return initializeModelChunk(chunk);
130-
case RESOLVED_PROVIDER:
131-
return initializeProviderChunk(chunk);
132122
case RESOLVED_MODULE:
133123
return initializeModuleChunk(chunk);
134124
case PENDING:
@@ -188,13 +178,6 @@ function createResolvedModelChunk(
188178
return new Chunk(RESOLVED_MODEL, value, response);
189179
}
190180

191-
function createResolvedProviderChunk(
192-
response: Response,
193-
value: string,
194-
): ResolvedProviderChunk {
195-
return new Chunk(RESOLVED_PROVIDER, value, response);
196-
}
197-
198181
function createResolvedModuleChunk<T>(
199182
response: Response,
200183
value: ModuleReference<T>,
@@ -217,18 +200,6 @@ function resolveModelChunk<T>(
217200
wakeChunk(listeners);
218201
}
219202

220-
function resolveProviderChunk<T>(chunk: SomeChunk<T>, value: string): void {
221-
if (chunk._status !== PENDING) {
222-
// We already resolved. We didn't expect to see this.
223-
return;
224-
}
225-
const listeners = chunk._value;
226-
const resolvedChunk: ResolvedProviderChunk = (chunk: any);
227-
resolvedChunk._status = RESOLVED_PROVIDER;
228-
resolvedChunk._value = value;
229-
wakeChunk(listeners);
230-
}
231-
232203
function resolveModuleChunk<T>(
233204
chunk: SomeChunk<T>,
234205
value: ModuleReference<T>,
@@ -252,14 +223,6 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk): T {
252223
return value;
253224
}
254225

255-
function initializeProviderChunk<T>(chunk: ResolvedProviderChunk): T {
256-
const value: T = getOrCreateServerContext(chunk._value).Provider;
257-
const initializedChunk: InitializedChunk<T> = (chunk: any);
258-
initializedChunk._status = INITIALIZED;
259-
initializedChunk._value = value;
260-
return value;
261-
}
262-
263226
function initializeModuleChunk<T>(chunk: ResolvedModuleChunk<T>): T {
264227
const value: T = requireModule(chunk._value);
265228
const initializedChunk: InitializedChunk<T> = (chunk: any);

packages/react-reconciler/src/ReactFiberNewContext.new.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
* @flow
88
*/
99

10-
import type {
11-
ReactContext,
12-
ReactServerContext,
13-
ReactProviderType,
14-
} from 'shared/ReactTypes';
10+
import type {ReactContext, ReactProviderType} from 'shared/ReactTypes';
1511
import type {
1612
Fiber,
1713
ContextDependency,

packages/react-reconciler/src/ReactFiberNewContext.old.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
* @flow
88
*/
99

10-
import type {
11-
ReactContext,
12-
ReactServerContext,
13-
ReactProviderType,
14-
} from 'shared/ReactTypes';
10+
import type {ReactContext, ReactProviderType} from 'shared/ReactTypes';
1511
import type {
1612
Fiber,
1713
ContextDependency,

packages/react-server/src/ReactFizzNewContext.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
* @flow
88
*/
99

10-
import {REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED} from 'shared/ReactSymbols';
11-
import type {ReactContext, ReactServerContext} from 'shared/ReactTypes';
10+
import type {ReactContext} from 'shared/ReactTypes';
1211

1312
import {REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED} from 'shared/ReactSymbols';
1413
import {isPrimaryRenderer} from './ReactServerFormatConfig';

0 commit comments

Comments
 (0)