feat(solid-virtual): support Solid 2 #1350
main fromrefs/pull/1350/head·opened 🎯 Changes#
Solid 2 support for @tanstack/solid-virtual, set up as a pre-release line the way @tanstack/solid-query 6 and @tanstack/solid-router 2 were. It targets a solid-v2-pre branch, so main stays on Solid 1.
createVirtualizerandcreateWindowVirtualizerkeep their API.mergereplacesmergeProps. A render effect replacescreateComputed: its compute half reads every option and its effect half applies them. The virtualizer mounts inonSettledinstead ofonMount, and the constructor's one-time read of the options is untracked.getVirtualItems()is now a projection store reconciled byindex. It re-reads on each virtualizer change through a version signal written withownedWrite, so rows keep their identity while scrolling and measuring.getTotalSize()is a memo over the same version.- The package peers on
solid-js(>=2.0.0-rc.19 <3.0.0) only. It tests and builds with@solidjs/vite-plugin, which needs vite 8, so it gets its ownvite,vitestand@tanstack/vite-config0.6 (through a pnpm override), the same way Query's Solid 2 line does it.sherifignoresviteand@tanstack/vite-configfor that reason. - The test now flushes after writes, and there is a new test that items keep their identity across count changes and resizes.
- Changesets enters pre mode with the
rctag, and the release workflow also runs on*-prebranches.solid-virtualgets a major bump, giving4.0.0-rc.0. The installation docs now say which versions go with which Solid major.
Locally: @tanstack/solid-virtual tests, tsc, eslint, vite build, publint, sherif, knip and test:docs. In Chromium I also ran a 1,000-row list with dynamic row heights. It renders the right window, follows scrolling, re-measures rows to update the total size, and grows when the count changes, with no console errors.
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested this code locally with
pnpm run test:pr.
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
Summary by CodeRabbit#
- New Features
@tanstack/solid-virtual4.x now supports Solid 2, with virtual items and total size updating reactively as data or measurements change.
- Documentation
- Installation guidance clarifies that Solid 2 users should install version 4.x, while Solid 1 users should remain on version 3.x.
- Added notes on Solid 2 reactivity and virtual item updates, including when signal reads reflect changes made outside a reactive scope.
- 1
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0a9c909e-8a43-470f-9347-0fb7fd9abf7d
Commits-
Reviewing files that changed from the base of the PR and between 03941bdaec6e554fcbd1f7f4cea067627631665b and c0048501d92e077fa8351ad164f8a4ea570219ac.
Files ignored due to path filters: 1-
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing: 1-
packages/solid-virtual/package.json
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
-
Walkthrough
-
The Solid virtualizer package now targets Solid 2, with updated reactive option handling and virtual-item updates. The PR updates package tooling and tests, adds Solid-version installation guidance, and configures
rcpre-releases and release-branch triggers.Changes: Solid 2 adapter release
Priority:Layer / File(s) Summary Solid 2 package and tooling setup
packages/solid-virtual/package.json,packages/solid-virtual/tsconfig.json,packages/solid-virtual/vite.config.ts,pnpm-workspace.yaml,package.jsonThe package updates its Solid peer dependency, development dependencies, JSX import source, and Vite plugin. The workspace adds a Vite override, and the Sherif command excludes Vite-related packages. Reactive adapter and test updates
packages/solid-virtual/src/index.tsx,packages/solid-virtual/tests/index.test.tsThe adapter applies reactive option snapshots to the core virtualizer and derives virtual items and total size from a version signal. Mount setup uses onSettled. Tests flush reactive updates and check item identity and sizing.Solid 2 release and installation guidance
.changeset/pre.json,.changeset/solid-virtual-solid-2.md,.github/workflows/release.yml,docs/installation.mdChangesets configure an rcpre-release and declare a major Solid 2 package release. The workflow includes*-prebranches, and installation docs distinguish Solid 2 and Solid 1 package versions. NormalEstimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Sequence Diagram(s)#
sequenceDiagram participant SolidScope participant SolidAdapter participant CoreVirtualizer participant SolidStores participant Consumers SolidScope->>SolidAdapter: Provide reactive option snapshot SolidAdapter->>CoreVirtualizer: Apply snapshot with setOptions CoreVirtualizer->>SolidAdapter: Invoke onChange callback SolidAdapter->>SolidStores: Increment version signal SolidStores->>Consumers: Provide virtualItems and totalSizeSuggested reviewers:
tannerlinsley,piecyk
Merge Risk:
Minimal · up toc0048-
No concrete merge-blocking issue is established in the selected Solid 2 dependency updates. Merge readiness remains subject to normal build and test checks.
Pre-merge checks:
5-
Check name Status Explanation Title check The title "feat(solid-virtual): support Solid 2" names the main change: adding Solid 2 support to @tanstack/solid-virtual. The changeset covers the adapter rewrite, the peer range change to solid-js >…Description check The description follows the repository template. It has the Changes section with a detailed explanation of the Solid 2 migration, the pre-release setup, and the local verification steps. The Checklist… Docstring Coverage No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title "feat(solid-virtual): support Solid 2" names the main change: adding Solid 2 support to
@tanstack/solid-virtual. The changeset covers the adapter rewrite, the peer range change to solid-js >=2.0.0-rc.19 <3.0.0, the dependency and tooling updates, and the pre-release setup. The title is specific and concise, and it follows the conventional commit form. It does not list every detail, which is expected.
Full details: Description check
-
Explanation
The description follows the repository template. It has the Changes section with a detailed explanation of the Solid 2 migration, the pre-release setup, and the local verification steps. The Checklist section is present, and the Release Impact section marks the changeset box. The contributing-guide and test:pr checklist items are unchecked. The description says the author ran the test suite, tsc, eslint, and other checks locally, but the checklist does not mark that pnpm run test:pr ran. This gap is minor and does not block the check.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment `@coderabbitai help` to get the list of available commands.-
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
Diff Package Supply Chain
SecurityVulnerability Quality Maintenance License @tanstack/vite-config@0.6.0 vite@8.3.5 @solidjs/web@2.0.0-rc.19 solid-js@2.0.0-rc.19 @solidjs/vite-plugin@3.0.0-next.51
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: c0048501d92e077fa8351ad164f8a4ea570219ac
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR