@@ -13,7 +13,7 @@ import type {LazyComponent} from 'react/src/ReactLazy';
1313import type {
1414 ClientReference ,
1515 ClientReferenceMetadata ,
16- UninitializedModel ,
16+ UninitializedValue ,
1717 Response ,
1818 SSRManifest ,
1919} from './ReactFlightClientHostConfig' ;
@@ -22,7 +22,7 @@ import {
2222 resolveClientReference ,
2323 preloadModule ,
2424 requireModule ,
25- parseModel ,
25+ parseValue ,
2626} from './ReactFlightClientHostConfig' ;
2727
2828import { REACT_LAZY_TYPE , REACT_ELEMENT_TYPE } from 'shared/ReactSymbols' ;
@@ -41,7 +41,7 @@ export type JSONValue =
4141
4242const PENDING = 'pending';
4343const BLOCKED = 'blocked';
44- const RESOLVED_MODEL = 'resolved_model ';
44+ const RESOLVED_VALUE = 'resolved_value ';
4545const RESOLVED_MODULE = 'resolved_module';
4646const INITIALIZED = 'fulfilled';
4747const ERRORED = 'rejected';
@@ -60,9 +60,9 @@ type BlockedChunk<T> = {
6060 _response : Response ,
6161 then ( resolve : ( T ) = > mixed , reject : ( mixed ) = > mixed ) : void ,
6262} ;
63- type ResolvedModelChunk < T > = {
64- status : 'resolved_model ' ,
65- value : UninitializedModel ,
63+ type ResolvedValueChunk < T > = {
64+ status : 'resolved_value ' ,
65+ value : UninitializedValue ,
6666 reason : null ,
6767 _response : Response ,
6868 then ( resolve : ( T ) = > mixed , reject : ( mixed ) = > mixed ) : void ,
@@ -91,7 +91,7 @@ type ErroredChunk<T> = {
9191type SomeChunk< T > =
9292 | PendingChunk< T >
9393 | BlockedChunk< T >
94- | ResolvedModelChunk < T >
94+ | ResolvedValueChunk < T >
9595 | ResolvedModuleChunk< T >
9696 | InitializedChunk< T >
9797 | ErroredChunk< T > ;
@@ -115,8 +115,8 @@ Chunk.prototype.then = function <T>(
115115 // If we have resolved content, we try to initialize it first which
116116 // might put us back into one of the other states.
117117 switch ( chunk . status ) {
118- case RESOLVED_MODEL :
119- initializeModelChunk ( chunk ) ;
118+ case RESOLVED_VALUE :
119+ initializeValueChunk ( chunk ) ;
120120 break ;
121121 case RESOLVED_MODULE :
122122 initializeModuleChunk ( chunk ) ;
@@ -161,8 +161,8 @@ function readChunk<T>(chunk: SomeChunk<T>): T {
161161 // If we have resolved content, we try to initialize it first which
162162 // might put us back into one of the other states.
163163 switch ( chunk . status ) {
164- case RESOLVED_MODEL :
165- initializeModelChunk ( chunk ) ;
164+ case RESOLVED_VALUE :
165+ initializeValueChunk ( chunk ) ;
166166 break ;
167167 case RESOLVED_MODULE :
168168 initializeModuleChunk ( chunk ) ;
@@ -247,12 +247,12 @@ function triggerErrorOnChunk<T>(chunk: SomeChunk<T>, error: mixed): void {
247247 }
248248}
249249
250- function createResolvedModelChunk < T > (
250+ function createResolvedValueChunk < T > (
251251 response: Response,
252- value: UninitializedModel ,
253- ): ResolvedModelChunk < T > {
252+ value: UninitializedValue ,
253+ ): ResolvedValueChunk < T > {
254254 // $FlowFixMe Flow doesn't support functions as constructors
255- return new Chunk ( RESOLVED_MODEL , value , null , response ) ;
255+ return new Chunk ( RESOLVED_VALUE , value , null , response ) ;
256256}
257257
258258function createResolvedModuleChunk< T > (
@@ -263,24 +263,24 @@ function createResolvedModuleChunk<T>(
263263 return new Chunk ( RESOLVED_MODULE , value , null , response ) ;
264264}
265265
266- function resolveModelChunk < T > (
266+ function resolveValueChunk < T > (
267267 chunk: SomeChunk< T > ,
268- value: UninitializedModel ,
268+ value: UninitializedValue ,
269269): void {
270270 if ( chunk . status !== PENDING ) {
271271 // We already resolved. We didn't expect to see this.
272272 return ;
273273 }
274274 const resolveListeners = chunk.value;
275275 const rejectListeners = chunk.reason;
276- const resolvedChunk: ResolvedModelChunk < T > = (chunk: any);
277- resolvedChunk.status = RESOLVED_MODEL ;
276+ const resolvedChunk: ResolvedValueChunk < T > = (chunk: any);
277+ resolvedChunk.status = RESOLVED_VALUE ;
278278 resolvedChunk.value = value;
279279 if (resolveListeners !== null) {
280280 // This is unfortunate that we're reading this eagerly if
281281 // we already have listeners attached since they might no
282282 // longer be rendered or might not be the highest pri.
283- initializeModelChunk ( resolvedChunk ) ;
283+ initializeValueChunk ( resolvedChunk ) ;
284284 // The status might have changed after initialization.
285285 wakeChunkIfInitialized ( chunk , resolveListeners , rejectListeners ) ;
286286 }
@@ -305,20 +305,20 @@ function resolveModuleChunk<T>(
305305 }
306306}
307307
308- let initializingChunk : ResolvedModelChunk < any > = (null: any);
309- let initializingChunkBlockedModel : null | { deps : number , value : any } = null;
310- function initializeModelChunk < T > (chunk: ResolvedModelChunk < T > ): void {
308+ let initializingChunk : ResolvedValueChunk < any > = (null: any);
309+ let initializingChunkBlockedValue : null | { deps : number , value : any } = null;
310+ function initializeValueChunk < T > (chunk: ResolvedValueChunk < T > ): void {
311311 const prevChunk = initializingChunk ;
312- const prevBlocked = initializingChunkBlockedModel ;
312+ const prevBlocked = initializingChunkBlockedValue ;
313313 initializingChunk = chunk ;
314- initializingChunkBlockedModel = null ;
314+ initializingChunkBlockedValue = null ;
315315 try {
316- const value : T = parseModel ( chunk . _response , chunk . value ) ;
316+ const value : T = parseValue ( chunk . _response , chunk . value ) ;
317317 if (
318- initializingChunkBlockedModel !== null &&
319- initializingChunkBlockedModel . deps > 0
318+ initializingChunkBlockedValue !== null &&
319+ initializingChunkBlockedValue . deps > 0
320320 ) {
321- initializingChunkBlockedModel . value = value ;
321+ initializingChunkBlockedValue . value = value ;
322322 // We discovered new dependencies on modules that are not yet resolved.
323323 // We have to go the BLOCKED state until they're resolved.
324324 const blockedChunk : BlockedChunk < T > = ( chunk : any ) ;
@@ -336,7 +336,7 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
336336 erroredChunk . reason = error ;
337337 } finally {
338338 initializingChunk = prevChunk ;
339- initializingChunkBlockedModel = prevBlocked ;
339+ initializingChunkBlockedValue = prevBlocked ;
340340 }
341341}
342342
@@ -434,17 +434,17 @@ function getChunk(response: Response, id: number): SomeChunk<any> {
434434 return chunk ;
435435}
436436
437- function createModelResolver < T > (
437+ function createValueResolver < T > (
438438 chunk: SomeChunk< T > ,
439439 parentObject: Object,
440440 key: string,
441441): (value: any) => void {
442442 let blocked ;
443- if ( initializingChunkBlockedModel ) {
444- blocked = initializingChunkBlockedModel ;
443+ if ( initializingChunkBlockedValue ) {
444+ blocked = initializingChunkBlockedValue ;
445445 blocked . deps ++ ;
446446 } else {
447- blocked = initializingChunkBlockedModel = {
447+ blocked = initializingChunkBlockedValue = {
448448 deps : 1 ,
449449 value : null ,
450450 } ;
@@ -467,7 +467,7 @@ function createModelResolver<T>(
467467 } ;
468468}
469469
470- function createModelReject < T > (chunk: SomeChunk< T > ): (error: mixed) => void {
470+ function createValueReject < T > (chunk: SomeChunk< T > ): (error: mixed) => void {
471471 return ( error : mixed ) = > triggerErrorOnChunk ( chunk , error ) ;
472472}
473473
@@ -498,7 +498,7 @@ function createServerReferenceProxy<A: Iterable<any>, T>(
498498 return proxy;
499499}
500500
501- export function parseModelString (
501+ export function parseValueString (
502502 response: Response,
503503 parentObject: Object,
504504 key: string,
@@ -541,8 +541,8 @@ export function parseModelString(
541541 const id = parseInt ( value . substring ( 2 ) , 16 ) ;
542542 const chunk = getChunk ( response , id ) ;
543543 switch ( chunk . status ) {
544- case RESOLVED_MODEL :
545- initializeModelChunk ( chunk ) ;
544+ case RESOLVED_VALUE :
545+ initializeValueChunk ( chunk ) ;
546546 break ;
547547 }
548548 // The status might have changed after initialization.
@@ -561,8 +561,8 @@ export function parseModelString(
561561 const id = parseInt ( value . substring ( 1 ) , 16 ) ;
562562 const chunk = getChunk ( response , id ) ;
563563 switch ( chunk . status ) {
564- case RESOLVED_MODEL :
565- initializeModelChunk ( chunk ) ;
564+ case RESOLVED_VALUE :
565+ initializeValueChunk ( chunk ) ;
566566 break ;
567567 case RESOLVED_MODULE :
568568 initializeModuleChunk ( chunk ) ;
@@ -576,8 +576,8 @@ export function parseModelString(
576576 case BLOCKED :
577577 const parentChunk = initializingChunk ;
578578 chunk . then (
579- createModelResolver ( parentChunk , parentObject , key ) ,
580- createModelReject ( parentChunk ) ,
579+ createValueResolver ( parentChunk , parentObject , key ) ,
580+ createValueReject ( parentChunk ) ,
581581 ) ;
582582 return null ;
583583 default :
@@ -589,7 +589,7 @@ export function parseModelString(
589589 return value ;
590590}
591591
592- export function parseModelTuple (
592+ export function parseValueTuple (
593593 response : Response ,
594594 value : { + [ key : string ] : JSONValue } | $ReadOnlyArray < JSONValue > ,
595595) : any {
@@ -626,27 +626,27 @@ export function createResponse(
626626export function resolveModel (
627627 response : Response ,
628628 id : number ,
629- model : UninitializedModel ,
629+ value : UninitializedValue ,
630630) : void {
631631 const chunks = response . _chunks ;
632632 const chunk = chunks . get ( id ) ;
633633 if ( ! chunk ) {
634- chunks . set ( id , createResolvedModelChunk ( response , model ) ) ;
634+ chunks . set ( id , createResolvedValueChunk ( response , value ) ) ;
635635 } else {
636- resolveModelChunk ( chunk , model ) ;
636+ resolveValueChunk ( chunk , value ) ;
637637 }
638638}
639639
640640export function resolveModule (
641641 response : Response ,
642642 id : number ,
643- model : UninitializedModel ,
643+ value : UninitializedValue ,
644644) : void {
645645 const chunks = response . _chunks ;
646646 const chunk = chunks . get ( id ) ;
647- const clientReferenceMetadata : ClientReferenceMetadata = parseModel (
647+ const clientReferenceMetadata : ClientReferenceMetadata = parseValue (
648648 response ,
649- model ,
649+ value ,
650650 ) ;
651651 const clientReference = resolveClientReference < $FlowFixMe > (
652652 response . _ssrManifest ,
0 commit comments