@@ -47,10 +47,9 @@ export type JSONValue =
47
47
48
48
const PENDING = 0 ;
49
49
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 ;
54
53
55
54
type PendingChunk = {
56
55
_status : 0 ,
@@ -64,34 +63,27 @@ type ResolvedModelChunk = {
64
63
_response : Response ,
65
64
then ( resolve : ( ) => mixed ) : void ,
66
65
} ;
67
- type ResolvedProviderChunk = {
68
- _status : 2 ,
69
- _value : string ,
70
- _response : Response ,
71
- then ( resolve : ( ) => mixed ) : void ,
72
- } ;
73
66
type ResolvedModuleChunk < T > = {
74
- _status : 3 ,
67
+ _status : 2 ,
75
68
_value : ModuleReference < T > ,
76
69
_response : Response ,
77
70
then ( resolve : ( ) => mixed ) : void ,
78
71
} ;
79
72
type InitializedChunk < T > = {
80
- _status : 4 ,
73
+ _status : 3 ,
81
74
_value : T ,
82
75
_response : Response ,
83
76
then ( resolve : ( ) => mixed ) : void ,
84
77
} ;
85
78
type ErroredChunk = {
86
- _status : 5 ,
79
+ _status : 4 ,
87
80
_value : Error ,
88
81
_response : Response ,
89
82
then ( resolve : ( ) => mixed ) : void ,
90
83
} ;
91
84
type SomeChunk < T > =
92
85
| PendingChunk
93
86
| ResolvedModelChunk
94
- | ResolvedProviderChunk
95
87
| ResolvedModuleChunk < T >
96
88
| InitializedChunk < T >
97
89
| ErroredChunk ;
@@ -127,8 +119,6 @@ function readChunk<T>(chunk: SomeChunk<T>): T {
127
119
return chunk . _value ;
128
120
case RESOLVED_MODEL:
129
121
return initializeModelChunk ( chunk ) ;
130
- case RESOLVED_PROVIDER:
131
- return initializeProviderChunk ( chunk ) ;
132
122
case RESOLVED_MODULE:
133
123
return initializeModuleChunk ( chunk ) ;
134
124
case PENDING :
@@ -188,13 +178,6 @@ function createResolvedModelChunk(
188
178
return new Chunk ( RESOLVED_MODEL , value , response ) ;
189
179
}
190
180
191
- function createResolvedProviderChunk(
192
- response: Response,
193
- value: string,
194
- ): ResolvedProviderChunk {
195
- return new Chunk ( RESOLVED_PROVIDER , value , response ) ;
196
- }
197
-
198
181
function createResolvedModuleChunk< T > (
199
182
response: Response,
200
183
value: ModuleReference< T > ,
@@ -217,18 +200,6 @@ function resolveModelChunk<T>(
217
200
wakeChunk(listeners);
218
201
}
219
202
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
-
232
203
function resolveModuleChunk < T > (
233
204
chunk: SomeChunk< T > ,
234
205
value: ModuleReference< T > ,
@@ -252,14 +223,6 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk): T {
252
223
return value ;
253
224
}
254
225
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
-
263
226
function initializeModuleChunk< T > (chunk: ResolvedModuleChunk< T > ): T {
264
227
const value : T = requireModule ( chunk . _value ) ;
265
228
const initializedChunk : InitializedChunk < T > = ( chunk : any ) ;
0 commit comments