Skip to content

feat(collections): add async and optimistic reactive collection factories - #1061

Open
Monkeylordz wants to merge 9 commits into
solidjs-community:nextfrom
Monkeylordz:feat/collections
Open

Monkeylordz wants to merge 9 commits into
solidjs-community:nextfrom
Monkeylordz:feat/collections

Conversation

@Monkeylordz

@Monkeylordz Monkeylordz commented Sep 17, 2026 •

Copy link
Copy Markdown

Adds @solid-primitives/collections with createReactiveMap, createReactiveSet, createReactiveWeakMap, and createReactiveWeakSet. Each collection supports mutable entries and compute functions while preserving lazy, independent subscriptions to individual keys or members.

  • Compute functions can mutate an initially empty draft, return replacement contents, await a result, or yield async updates. Collections integrate with Solid loading, refresh, optimistic actions, and SSR/hydration.
  • Strong collections preserve insertion order and live iteration. Weak collections use weak key/value storage, with an optional SSR codec exported from @solid-primitives/collections/serialization.
  • The existing map/set packages link to the new package for discoverability. Collection-specific tests, benchmarks, scripts, and implementation notes live in the collections package.
  • Ten Storybook examples cover basic usage, async computes, async iterables, optimistic acceptance/rollback, and weak variants for both Map and Set.

These are explicitly NOT in the map/set packages, because they use a shared backend. I considered re-exporting them in those packages but decided against it - this collections would still need to be published to prevent duplicate code, and then we would be exporting the same thing in two different packages.

Validation: collection build, type checks, lint, story formatting, and the full shared Storybook production build pass.

@changeset-bot

changeset-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a7212f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

👷 Deploy request for solid-primitives-v2 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit a7212f6

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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: 22974bb5-720a-4237-aa32-545de1e39bcf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@Monkeylordz
Monkeylordz marked this pull request as ready for review October 20, 2026 05:21
@davedbase

Copy link
Copy Markdown
Member

Hi there, would you like to run an agent to cleanup and and correct conflicts with the latest version of the next branch?

…mitives into feat/collections

# Conflicts:
#	pnpm-workspace.yaml
Patch Solid web rc.21 to preserve untouched cyclic serialization graphs and shared object keys. Flatten the collections test layout, retain SSR-before-hydration execution, and align manual-write coverage with Solid batching.

Validation: 40 SSR, 150 client, and 102 GC tests pass; type checks, lint, formatting, package build, and frozen lockfile checks pass.
Use unmodified Solid rc.21 and retain the enabled hydration regressions to track upstream behavior. Remove the patch, its dependency metadata, and patch-specific documentation.

This branch has not been deployed

No deployments
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.

2 participants