Skip to content

Conversation

@devongovett
Copy link
Member

Fixes #6182, fixes #7535

There were two issues with our collection implementation with Suspense:

  1. React sets display: none on items inside a suspense boundary, while the fallback is visible. We didn't implement this, so it resulted in the loading indicator being displayed alongside the existing items rather than replacing them. I fixed this by tracking whether an element is hidden. Hidden elements are kept in our fake DOM, but they are removed from the collection.
  2. The previous transaction count could get out of sync with react if a render was aborted. Turned out we don't need this anymore after fix: Improve collection update performance #7905, which now relies on React to queue the render instead. When triggering an update, we just return a clone of the previous collection, which forces React to re-render due to object inequality. When React actually does re-render, we update the collection. This way there's no inconsistent states due to partial updates.

@rspbot
Copy link

rspbot commented Mar 12, 2025

snowystinger
snowystinger previously approved these changes Mar 12, 2025
Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

lgtm, tested in macos chrome/ff/safari

@selrond
Copy link

selrond commented Mar 12, 2025

@devongovett thank you! Any idea when this will be released?

reidbarber
reidbarber previously approved these changes Mar 12, 2025
@devongovett devongovett dismissed stale reviews from reidbarber and snowystinger via 571b46e March 17, 2025 17:32
@rspbot
Copy link

rspbot commented Mar 17, 2025

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM, Table story seems to behave properly with reactTransition turned on/off, approving for further testing

@devongovett devongovett added this pull request to the merge queue Mar 17, 2025
Merged via the queue into main with commit bcc12ad Mar 17, 2025
30 checks passed
@devongovett devongovett deleted the collection-suspense branch March 17, 2025 19:26
@Danieljs-codes
Copy link

Is there a way to use this now?

@yihuiliao
Copy link
Member

@Danieljs-codes you should be able to use the nightly to get this fix

@selrond
Copy link

selrond commented Apr 1, 2025

@yihuiliao how should one install it? @nightly refers to version 3.0.0 according to npm

@snowystinger
Copy link
Member

The nightly is an exact version, all dependencies you use from our libraries should point to the same nightly version. That is says '3.anything' is irrelevant and more has to do with ease of tracking the same nightly across the entire repo where our first packages happened to be 3.0's for legacy reasons.

3.0.0-nightly-cfe79d329-250401, to read a nightly version, just ignore the 3.0.0, then 'nightly', then the git commit hash to main, then the date it was merged. You can choose the latest one, or a more specific one that you're looking for based on that information. There are some skipped git hashes because the nightly only builds once a day.

@selrond
Copy link

selrond commented Apr 2, 2025

@snowystinger thanks for the clarification!

Would it be ok to include this info somewhere in the readme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in collection rendering [RAC] Table components do not play well with Suspense

9 participants