Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): upgrade @tanstack/react-virtual to v3.11.2 #8062

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Dec 14, 2024

Description

Moves the dependency out of the beta range, and brings React 19 support which is why this is happening now.

@binoy14 There were some minor crashes in the array input after upgrading - the observeElementOffset seems to need a second argument, isScrolling. I assumed that since we were calling this from a scroll handler it would be safe to set this to always be true, but we're also calling it once on "mount", at which point I am giving it false. Additionally, the virtual items seems to start at an empty array now, which crashed when attempting to use the first element in the styles. Can you see that things works as expected? I did some testing and to my eyes it appears to work fine.

@robinpyon I am requesting a review from you since you have been involved in multiple components that utilize this library: scheduled publishing and CommandList being the two I can find. CommandList is being used quite a number of places, and from what I can tell things seems to work fine - but would really appreciate a quick run through to double check.

What to review

That things still work as expected. Surfaces affected are (at least):

  • "New document" list (scrollable list of schema types)
  • Scheduled publishing tool (list of schedules)
  • Array of objects input
  • Comments/tasks mentions list
  • Search (add filter)
  • Search (recent searches)
  • Search (results)
  • Document list pane
  • List panes
  • Document timeline (history)

Testing

No new tests were added - relying on existing tests and manual review.

Notes for release

None

@rexxars rexxars requested review from robinpyon and binoy14 December 14, 2024 06:51
Copy link

vercel bot commented Dec 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:44pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:44pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:44pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:44pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:44pm

@rexxars rexxars marked this pull request as ready for review December 14, 2024 06:51
@rexxars rexxars requested a review from a team as a code owner December 14, 2024 06:51
@rexxars rexxars requested review from cngonzalez and removed request for a team December 14, 2024 06:51
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Dec 14, 2024

Component Testing Report Updated Dec 16, 2024 10:38 PM (UTC)

❌ Failed Tests (2) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 11s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 41s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 56s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 16s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ❌ Failed (Inspect) 1m 48s 4 0 2
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 13s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 2m 56s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 48s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 14s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 29s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 53s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Dec 14, 2024

⚡️ Editor Performance Report

Updated Mon, 16 Dec 2024 22:41:02 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 25.0 efps (40ms) 24.4 efps (41ms) +1ms (+2.5%)
article (body) 71.9 efps (14ms) 75.5 efps (13ms) -1ms (-/-%)
article (string inside object) 26.3 efps (38ms) 27.0 efps (37ms) -1ms (-2.6%)
article (string inside array) 23.3 efps (43ms) 23.3 efps (43ms) +0ms (-/-%)
recipe (name) 55.6 efps (18ms) 54.1 efps (19ms) +1ms (+2.8%)
recipe (description) 62.5 efps (16ms) 62.5 efps (16ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 17.5 efps (57ms) 18.2 efps (55ms) -2ms (-3.5%)
synthetic (string inside object) 17.5 efps (57ms) 19.4 efps (52ms) -6ms (-9.6%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 40ms 43ms 55ms 288ms 541ms 10.6s
article (body) 14ms 16ms 20ms 55ms 46ms 4.7s
article (string inside object) 38ms 39ms 43ms 145ms 131ms 6.9s
article (string inside array) 43ms 45ms 47ms 74ms 231ms 7.0s
recipe (name) 18ms 20ms 21ms 23ms 0ms 7.0s
recipe (description) 16ms 18ms 20ms 22ms 0ms 4.4s
recipe (instructions) 5ms 6ms 7ms 8ms 0ms 3.0s
synthetic (title) 57ms 59ms 61ms 63ms 304ms 17.2s
synthetic (string inside object) 57ms 59ms 67ms 425ms 982ms 8.4s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 41ms 42ms 44ms 47ms 15ms 11.9s
article (body) 13ms 15ms 19ms 160ms 192ms 4.9s
article (string inside object) 37ms 39ms 41ms 45ms 0ms 6.2s
article (string inside array) 43ms 45ms 48ms 82ms 163ms 6.9s
recipe (name) 19ms 20ms 21ms 47ms 0ms 6.8s
recipe (description) 16ms 17ms 18ms 21ms 0ms 4.3s
recipe (instructions) 5ms 7ms 8ms 24ms 0ms 3.0s
synthetic (title) 55ms 57ms 60ms 268ms 659ms 12.7s
synthetic (string inside object) 52ms 54ms 58ms 427ms 789ms 8.1s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

@jordanl17
Copy link
Member

Nice! We have a few uses of this in the content releases branch, so just commenting myself here to remember to rebase our branch once this is in :)

@rexxars
Copy link
Member Author

rexxars commented Dec 16, 2024

I see the tests are failing, so need to do some work on that

Edit: tests updated to pass on the new version

@rexxars rexxars force-pushed the fix/upgrade-react-virtual branch from 3c4e600 to 1ebac8a Compare December 16, 2024 21:33
Copy link

socket-security bot commented Dec 16, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@tanstack/[email protected] None +1 215 kB nksaraf, tannerlinsley

View full report↗︎

Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

Tested the array inputs in the debug scenarios and other things, everything looks good to me, thanks for taking care of this!

@rexxars rexxars added this pull request to the merge queue Dec 17, 2024
Merged via the queue into next with commit 04303f7 Dec 17, 2024
58 checks passed
@rexxars rexxars deleted the fix/upgrade-react-virtual branch December 17, 2024 05:28
@jordanl17
Copy link
Member

Nice! We have a few uses of this in the content releases branch, so just commenting myself here to remember to rebase our branch once this is in :)

Well this is unfortunate, I'd mistaken React 19 support for react compiler support... but alas this issue still exists

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.

3 participants