[pull] main from react:main - #596
Merged
Merged
Conversation
#36912) ## Summary #34493 added `@tanstack/react-virtual`'s `useVirtualizer` to the known incompatible libraries, but not `useWindowVirtualizer`. Both hooks are thin wrappers around the same internal `useVirtualizerBase`, so they return the same referentially-stable virtualizer instance. Its methods (e.g. `getVirtualItems()`, `getTotalSize()`) return internally-mutated values rather than new ones, which is exactly the "interior mutability" pattern that breaks memoization described in the module type provider. Because only `useVirtualizer` was registered, code using `useWindowVirtualizer` is silently compiled with the same unsafe memoization. In our app this froze `getVirtualItems()` to its first-render value (an empty `[]` before measurement), producing permanently-empty virtualized lists — the same class of bug #34493 fixed, just via the window variant. This registers `useWindowVirtualizer` alongside `useVirtualizer` with the identical shape, in **both** implementations: - `compiler/packages/babel-plugin-react-compiler/src/HIR/DefaultModuleTypeProvider.ts` - `compiler/crates/react_compiler_hir/src/default_module_type_provider.rs` (Rust port) See also the community report referenced in #34493: TanStack/virtual#736 (comment) ## How did you test this change? Each addition mirrors the existing `useVirtualizer` entry exactly (same kind, params, return type, and `knownIncompatible` message shape); both are data-only additions to the module type providers, following the precedent set by #34493 which changed only the TS file. The Rust change keeps the two providers in sync.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )