Skip to content

upgrade: flux-store package upgrade for Solid 2.0#917

Open
davedbase wants to merge 1 commit into
solidjs-community:nextfrom
davedbase:update/v2/flux-store
Open

upgrade: flux-store package upgrade for Solid 2.0#917
davedbase wants to merge 1 commit into
solidjs-community:nextfrom
davedbase:update/v2/flux-store

Conversation

@davedbase
Copy link
Copy Markdown
Member

@davedbase davedbase commented May 23, 2026

Upgrades @solid-primitives/flux-store to Solid 2.0 beta.14. No design changes were needed — the primitive has no async reactivity, no directives, and no lifecycle hooks. The migration is entirely mechanical.


What changed

ImportscreateStore and StoreSetter (formerly SetStoreFunction) now come from solid-js directly; solid-js/store no longer exists as a separate module.

Store setter is now draft-first — The setState passed to actions no longer accepts path-style arguments. Users must pass a draft mutator instead:

// Before
setState("value", p => p + 1);

// After
setState(s => { s.value += 1; });

produce removed — Solid 2.0 stores are draft-first by default, so produce is gone. Replace setState(produce(s => ...)) with setState(s => ...).

batch removed from createAction — All writes are auto-batched in Solid 2.0, so the explicit batch() wrap was dropped. Actions remain untracked.


Other fixes

  • Corrected primitive.list entry from "createFluxFactory""createFluxStoreFactory"
  • README rewritten: import added to factory example, createAction/createActions documented, createFluxStoreFactory example expanded to show independent instances and both override forms

Summary by CodeRabbit

  • Breaking Changes

    • setState now requires draft-first mutations via callbacks instead of path-style arguments
    • Removed produce helper in favor of inline draft mutations
    • Removed automatic batching from createAction
    • Updated peer dependency to Solid.js v2.0.0-beta.14
  • Documentation

    • Updated API guides and usage examples with new patterns

Review Change Stack

@davedbase davedbase added this to the Solid 2.0 Migration milestone May 23, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 23, 2026

🦋 Changeset detected

Latest commit: c50bb56

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solid-primitives/flux-store Major

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Important

Review skipped

Draft detected.

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

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b327764-22d2-4065-8b61-71a7417b595d

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:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@davedbase davedbase marked this pull request as ready for review May 23, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant