Skip to content

Conversation

@eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Sep 5, 2025

Reading from the StoreContext for suspense related stuff is quite the footgun right now because the Store is mutable. I'm going with a single Hook for reading Suspense related data for now that ensures a re-render until I come up with a better factoring.

Still dangerous to close over useSuspenseStore in memoized functions. But that can be avoided with putting suspenseRevision into deps.

@meta-cla meta-cla bot added the CLA Signed label Sep 5, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 5, 2025

function getDocumentBoundingRect(
store: Store,
shells: $ReadOnlyArray<SuspenseNode['id']>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming was confusing. The Shell is a slice from Root to the first boundaries. The Root is a single element.

function handleFocus() {
const suspense = timeline[value];

dispatch({type: 'SELECT_ELEMENT_BY_ID', payload: suspense.id});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by. Felt odd to not select the element when you tab/click in but then start selecting when values change.

@eps1lon eps1lon marked this pull request as ready for review September 5, 2025 07:39
@eps1lon eps1lon requested a review from hoxyq September 5, 2025 07:39
@eps1lon eps1lon removed the request for review from hoxyq September 5, 2025 08:50
@eps1lon eps1lon marked this pull request as draft September 5, 2025 08:50
@eps1lon eps1lon force-pushed the sebbie/09-05-_devtools_avoid_renders_of_stale_suspense_store branch from beae8b5 to 7bedd05 Compare September 5, 2025 10:27
@eps1lon eps1lon requested a review from hoxyq September 5, 2025 10:27
@eps1lon eps1lon marked this pull request as ready for review September 5, 2025 10:27
@eps1lon eps1lon merged commit 3fb190f into facebook:main Sep 8, 2025
244 checks passed
@eps1lon eps1lon deleted the sebbie/09-05-_devtools_avoid_renders_of_stale_suspense_store branch September 8, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants