Skip to content
Source
Sign inSign up
TanStack/virtual

feat(solid-virtual): support Solid 2 #1350

Openryansolid(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/1350/headopened

🎯 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.

  • createVirtualizer and createWindowVirtualizer keep their API. merge replaces mergeProps. A render effect replaces createComputed: its compute half reads every option and its effect half applies them. The virtualizer mounts in onSettled instead of onMount, and the constructor's one-time read of the options is untracked.
  • getVirtualItems() is now a projection store reconciled by index. It re-reads on each virtualizer change through a version signal written with ownedWrite, 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 own vite, vitest and @tanstack/vite-config 0.6 (through a pnpm override), the same way Query's Solid 2 line does it. sherif ignores vite and @tanstack/vite-config for 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 rc tag, and the release workflow also runs on *-pre branches. solid-virtual gets a major bump, giving 4.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-virtual 4.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. changeset-bot[bot](GitHub profile, opens in a new tab)commented

      🦋 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
      NameType
      @tanstack/solid-virtualMajor

      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

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.yaml is 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 rc pre-releases and release-branch triggers.

      Changes: Solid 2 adapter release

      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.json
      The 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.ts
      The 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.md
      Changesets configure an rc pre-release and declare a major Solid 2 package release. The workflow includes *-pre branches, and installation docs distinguish Solid 2 and Solid 1 package versions.
      Priority: Normal

      Estimated 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 totalSize

      Suggested reviewers: tannerlinsley, piecyk

      Merge Risk: Minimal · up to c0048

      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: Passed 5
      Check nameStatusExplanation
      Title checkPassedThe 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 checkPassedThe 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 CoveragePassedNo 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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 &gt;=2.0.0-rc.19 &lt;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.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. socket-security[bot](GitHub profile, opens in a new tab)commented

      Review the following changes in direct dependencies. Learn more about Socket for GitHub.

      Diff Package Supply Chain
      Security
      Vulnerability Quality Maintenance License
      Added@​tanstack/​vite-config@​0.6.0831006692100
      Addedvite@​8.3.5991008296100
      Added@​solidjs/​web@​2.0.0-rc.19891008397100
      Addedsolid-js@​2.0.0-rc.191001009596100
      Added@​solidjs/​vite-plugin@​3.0.0-next.519810010096100

      View full report

Sign in to join this conversation.