Skip to content

Phase A: Zustand store cutover (remove Redux)#2

Draft
iduuck wants to merge 1 commit intomasterfrom
nick/zustand-phase-a-cff3
Draft

Phase A: Zustand store cutover (remove Redux)#2
iduuck wants to merge 1 commit intomasterfrom
nick/zustand-phase-a-cff3

Conversation

@iduuck
Copy link
Copy Markdown

@iduuck iduuck commented Apr 10, 2026

Summary

Implements Phase A of the Redux → Zustand migration: the planner no longer uses redux or react-redux. State remains the existing Immutable State driven by the same root reducer and action creators.

Changes

  • src/store/createPlannerStore.js: Vanilla Zustand slice holding plannerState; dispatch(action) runs src/reducers/reducer.js and updates the slice. Exposes getState, subscribe, and bound namespaces (projectActions, viewer2DActions, viewer3DActions, …) matching the previous connect output.
  • src/store/bindActionCreators.js: Small replacement for Redux bindActionCreators (plain actions only; same as before).
  • src/react-planner.jsx: Removed connect; subscribes to the planner store and re-renders when plannerState reference changes. Optional plannerStore, initialPlannerState, and locale props. stateExtractor defaults to identity when omitted (host no longer needs an outer Immutable map).
  • demo/src/renderer.jsx: Creates one createPlannerStore instance and passes it as plannerStore; removed Provider / createStore.
  • package.json: Added zustand, removed redux and react-redux. build-demo and start set NODE_OPTIONS=--openssl-legacy-provider so webpack 4 runs on Node 17+.
  • demo/webpack.config.js: Vendor chunk uses zustand instead of redux packages.

Plugin API

Plugins still receive (store, stateExtractor) where store has dispatch, getState (returns planner Immutable state), and subscribe.

Builds

npm run build (clean + demo + lib + es) succeeds in this environment.

Open in Web Open in Cursor 

- Add createPlannerStore (vanilla Zustand + existing planner reducer)
- Add bindActionCreators helper for action namespaces
- Refactor ReactPlanner: subscribe to store, child context from bindings
- Support optional plannerStore, initialPlannerState, and locale prop
- Demo: drop Provider/createStore, pass shared plannerStore
- Remove redux/react-redux deps; vendor bundle uses zustand
- build-demo/start: NODE_OPTIONS=--openssl-legacy-provider for Node 17+

Co-authored-by: nick <iduuck@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0d562780-fcc3-4f5a-95bc-824c6aed7461

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

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

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