{{ message }}
Repository navigation
test(react-virtual): add e2e test for React Compiler with directDomUpdates, bump react to 19 - #1187
Merged
piecyk merged 1 commit intoJun 2, 2026
Conversation
…dates, bump react to 19
|
View your CI Pipeline Execution ↗ for commit 534fa4e
☁️ Nx Cloud last updated this comment at |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/react-virtual/e2e/app/react-compiler/main.tsx (1)
73-77: ⚡ Quick winConsider adding a comment to clarify the conditional styling logic.
The triple-nested ternary controlling
topandtransformis correct but complex. WhendirectDomUpdatesis enabled, the virtualizer writes positioning directly to the DOM:
mode='transform': virtualizer writestransform: translate3d(...), so we providetop: 0as a basemode='position': virtualizer writestop: ...px, so we omit it from the initial styleA brief inline comment would help future maintainers understand why the styles differ by mode.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/react-virtual/e2e/app/react-compiler/main.tsx` around lines 73 - 77, Add a brief inline comment explaining the nested ternary that sets top and transform based on directDom (or directDomUpdates) and mode: clarify that when directDom is true and mode === 'transform' we set top: 0 because the virtualizer will write translate3d to the DOM, whereas when mode === 'position' we omit top because the virtualizer will set top directly; likewise note the fallback for non-directDom that sets both top: 0 and transform using v.start. Place this comment next to the expression that uses directDom, mode, and v.start to make the intent clear for future maintainers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/react-virtual/e2e/app/react-compiler/main.tsx`:
- Around line 73-77: Add a brief inline comment explaining the nested ternary
that sets top and transform based on directDom (or directDomUpdates) and mode:
clarify that when directDom is true and mode === 'transform' we set top: 0
because the virtualizer will write translate3d to the DOM, whereas when mode ===
'position' we omit top because the virtualizer will set top directly; likewise
note the fallback for non-directDom that sets both top: 0 and transform using
v.start. Place this comment next to the expression that uses directDom, mode,
and v.start to make the intent clear for future maintainers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6de9e63b-97a8-48b9-9347-555ab33db9fb
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (21)
benchmarks/package.jsonexamples/react/chat/package.jsonexamples/react/dynamic/package.jsonexamples/react/fixed/package.jsonexamples/react/infinite-scroll/package.jsonexamples/react/padding/package.jsonexamples/react/pretext/package.jsonexamples/react/pretext/src/main.tsxexamples/react/scroll-padding/package.jsonexamples/react/smooth-scroll/package.jsonexamples/react/sticky/package.jsonexamples/react/table/package.jsonexamples/react/variable/package.jsonexamples/react/window/package.jsonknip.jsonpackages/react-virtual/e2e/app/react-compiler-vite.config.tspackages/react-virtual/e2e/app/react-compiler/index.htmlpackages/react-virtual/e2e/app/react-compiler/main.tsxpackages/react-virtual/e2e/app/test/react-compiler.spec.tspackages/react-virtual/package.jsonpackages/react-virtual/playwright.config.ts
3 of 4 tasks
kklem0
added a commit
to kklem0/virtual
that referenced
this pull request
Jul 27, 2026
…mpatibility React Compiler skips any component calling useVirtualizer as a known-incompatible API: the hook returns a stable instance whose getVirtualItems()/getTotalSize() read mutable internal state during render, so a memoizing compiler caches the first result keyed on the stable instance and the list never updates (TanStack#736, TanStack#743). The skip keeps apps correct but leaves every consuming component un-memoized (TanStack#1119). useVirtualizerSnapshot (and useWindowVirtualizerSnapshot) return the render-facing values as immutable snapshot data instead, via useSyncExternalStore (official shim, preserving the React >=16.8 peer range): virtualItems and totalSize change identity exactly when the computed geometry changes, while the stable virtualizer instance rides along for imperative APIs (measureElement, scrollToIndex, ...). Because the compiler's skip is keyed on the imported property name, components consuming the snapshot hooks compile - and memoize correctly - today. - snapshot cache rebuilt lazily on onChange, with part-comparison so notifications that change nothing visible (isScrolling flips) publish the same reference and skip the re-render - user onChange still chained; useFlushSync semantics preserved - unit tests pin the identity contract (stable across unrelated re-renders, fresh on geometry change), StrictMode, and SSR via getServerSnapshot - compiler-contract tests run babel-plugin-react-compiler in CI: snapshot consumers emit the _c() memo cache, useVirtualizer consumers stay skipped - e2e: a compiled snapshot-hook page under the existing react-compiler build (TanStack#1187 infra) proving the TanStack#736 scenario now passes with the consumer compiled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🎯 Changes
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
New Features
Bug Fixes