Skip to content

Commit 5bbf9be

Browse files
authored
[DevTools] Model Hidden Offscreen Boundaries as Unmounts (facebook#34062)
This is modeling Offscreen boundaries as the thing that unmounts a tree in the frontend. This will let us model this as a "hide" that preserves state instead in a follow up but not yet. By doing it this way, we don't have to special case suspended Suspense boundaries, at least not for the modern versions that use Offscreen as the internal node. It's still special cased for the old React versions. Instead, this is handled by the Offscreen fiber getting hidden. By giving this fiber an FilteredFiberInstance, we also have somewhere to store the children on (separately from the parent children set which can include other siblings too like the loading state). One consequence is that Activity boundary content now disappears when they're hidden which is probably a good thing since otherwise it would be confusing and noisy when it's used to render multiple pages at once.
1 parent 8de7aed commit 5bbf9be

File tree

2 files changed

+142
-96
lines changed

2 files changed

+142
-96
lines changed

packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,11 @@ describe('Store component filters', () => {
207207
);
208208

209209
expect(store).toMatchInlineSnapshot(`
210-
[root]
211-
▾ <Activity>
212-
<div>
213-
▾ <Activity>
214-
<div>
215-
`);
210+
[root]
211+
▾ <Activity>
212+
<div>
213+
<Activity>
214+
`);
216215

217216
await actAsync(
218217
async () =>
@@ -222,10 +221,9 @@ describe('Store component filters', () => {
222221
);
223222

224223
expect(store).toMatchInlineSnapshot(`
225-
[root]
226-
<div>
227-
<div>
228-
`);
224+
[root]
225+
<div>
226+
`);
229227

230228
await actAsync(
231229
async () =>
@@ -235,12 +233,11 @@ describe('Store component filters', () => {
235233
);
236234

237235
expect(store).toMatchInlineSnapshot(`
238-
[root]
239-
▾ <Activity>
240-
<div>
241-
▾ <Activity>
242-
<div>
243-
`);
236+
[root]
237+
▾ <Activity>
238+
<div>
239+
<Activity>
240+
`);
244241
}
245242
});
246243

@@ -262,12 +259,12 @@ describe('Store component filters', () => {
262259
);
263260

264261
expect(store).toMatchInlineSnapshot(`
265-
[root]
266-
▾ <ViewTransition>
267-
<div>
268-
▾ <ViewTransition>
269-
<div>
270-
`);
262+
[root]
263+
▾ <ViewTransition>
264+
<div>
265+
▾ <ViewTransition>
266+
<div>
267+
`);
271268

272269
await actAsync(
273270
async () =>
@@ -277,12 +274,12 @@ describe('Store component filters', () => {
277274
);
278275

279276
expect(store).toMatchInlineSnapshot(`
280-
[root]
281-
▾ <ViewTransition>
282-
<div>
283-
▾ <ViewTransition>
284-
<div>
285-
`);
277+
[root]
278+
▾ <ViewTransition>
279+
<div>
280+
▾ <ViewTransition>
281+
<div>
282+
`);
286283

287284
await actAsync(
288285
async () =>
@@ -292,12 +289,12 @@ describe('Store component filters', () => {
292289
);
293290

294291
expect(store).toMatchInlineSnapshot(`
295-
[root]
296-
▾ <ViewTransition>
297-
<div>
298-
▾ <ViewTransition>
299-
<div>
300-
`);
292+
[root]
293+
▾ <ViewTransition>
294+
<div>
295+
▾ <ViewTransition>
296+
<div>
297+
`);
301298
}
302299
});
303300

0 commit comments

Comments
 (0)