@@ -153,7 +153,8 @@ export function getInternalReactConstants(
153153 // **********************************************************
154154 // The section below is copied from files in React repo.
155155 // Keep it in sync, and add version guards if it changes.
156- if ( gte ( version , '16.6.0-beta.0' ) ) {
156+ if ( gte ( version , '17.0.0-alpha' ) ) {
157+ // TODO (Offscreen) Update the version number above to reflect the first Offscreen alpha/beta release.
157158 ReactTypeOfWork = {
158159 Block : 22 ,
159160 ClassComponent : 1 ,
@@ -181,6 +182,34 @@ export function getInternalReactConstants(
181182 SuspenseListComponent : 19 , // Experimental
182183 YieldComponent : - 1 , // Removed
183184 } ;
185+ } else if ( gte ( version , '16.6.0-beta.0' ) ) {
186+ ReactTypeOfWork = {
187+ Block : 22 ,
188+ ClassComponent : 1 ,
189+ ContextConsumer : 9 ,
190+ ContextProvider : 10 ,
191+ CoroutineComponent : - 1 , // Removed
192+ CoroutineHandlerPhase : - 1 , // Removed
193+ DehydratedSuspenseComponent : 18 , // Behind a flag
194+ ForwardRef : 11 ,
195+ Fragment : 7 ,
196+ FunctionComponent : 0 ,
197+ HostComponent : 5 ,
198+ HostPortal : 4 ,
199+ HostRoot : 3 ,
200+ HostText : 6 ,
201+ IncompleteClassComponent : 17 ,
202+ IndeterminateComponent : 2 ,
203+ LazyComponent : 16 ,
204+ MemoComponent : 14 ,
205+ Mode : 8 ,
206+ OffscreenComponent : - 1 , // Experimental
207+ Profiler : 12 ,
208+ SimpleMemoComponent : 15 ,
209+ SuspenseComponent : 13 ,
210+ SuspenseListComponent : 19 , // Experimental
211+ YieldComponent : - 1 , // Removed
212+ } ;
184213 } else if ( gte ( version , '16.4.3-alpha' ) ) {
185214 ReactTypeOfWork = {
186215 Block : - 1 , // Doesn't exist yet
@@ -452,14 +481,16 @@ export function attach(
452481 const debug = ( name : string , fiber : Fiber , parentFiber : ?Fiber ) : void => {
453482 if ( __DEBUG__ ) {
454483 const displayName = getDisplayNameForFiber ( fiber ) || 'null' ;
484+ const id = getFiberID ( fiber ) ;
455485 const parentDisplayName =
456486 ( parentFiber != null && getDisplayNameForFiber ( parentFiber ) ) || 'null' ;
487+ const parentID = parentFiber ? getFiberID ( parentFiber ) : '' ;
457488 // NOTE: calling getFiberID or getPrimaryFiber is unsafe here
458489 // because it will put them in the map. For now, we'll omit them.
459490 // TODO: better debugging story for this.
460491 console . log (
461- `[renderer] %c${ name } %c${ displayName } %c${
462- parentFiber ? parentDisplayName : ''
492+ `[renderer] %c${ name } %c${ displayName } ( ${ id } ) %c${
493+ parentFiber ? ` ${ parentDisplayName } ( ${ parentID } )` : ''
463494 } `,
464495 'color: red; font-weight: bold;' ,
465496 'color: blue;' ,
@@ -1076,6 +1107,10 @@ export function attach(
10761107 }
10771108
10781109 function recordMount ( fiber : Fiber , parentFiber : Fiber | null ) {
1110+ if ( __DEBUG__ ) {
1111+ debug ( 'recordMount()' , fiber , parentFiber ) ;
1112+ }
1113+
10791114 const isRoot = fiber . tag = = = HostRoot ;
10801115 const id = getFiberID ( getPrimaryFiber ( fiber ) ) ;
10811116
@@ -1130,6 +1165,10 @@ export function attach(
11301165 }
11311166
11321167 function recordUnmount ( fiber : Fiber , isSimulated : boolean ) {
1168+ if ( __DEBUG__ ) {
1169+ debug ( 'recordUnmount()' , fiber ) ;
1170+ }
1171+
11331172 if ( trackedPathMatchFiber !== null ) {
11341173 // We're in the process of trying to restore previous selection.
11351174 // If this fiber matched but is being unmounted, there's no use trying.
@@ -1215,7 +1254,8 @@ export function attach(
12151254 // because we don't want to highlight every host node inside of a newly mounted subtree.
12161255 }
12171256
1218- if ( fiber . tag = = = ReactTypeOfWork . SuspenseComponent ) {
1257+ const isSuspense = fiber . tag = = = ReactTypeOfWork . SuspenseComponent ;
1258+ if ( isSuspense ) {
12191259 const isTimedOut = fiber . memoizedState !== null ;
12201260 if ( isTimedOut ) {
12211261 // Special case: if Suspense mounts in a timed-out state,
0 commit comments