Draft
Conversation
- 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>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase A of the Redux → Zustand migration: the planner no longer uses
reduxorreact-redux. State remains the existing ImmutableStatedriven by the same root reducer and action creators.Changes
src/store/createPlannerStore.js: Vanilla Zustand slice holdingplannerState;dispatch(action)runssrc/reducers/reducer.jsand updates the slice. ExposesgetState,subscribe, and bound namespaces (projectActions,viewer2DActions,viewer3DActions, …) matching the previous connect output.src/store/bindActionCreators.js: Small replacement for ReduxbindActionCreators(plain actions only; same as before).src/react-planner.jsx: Removedconnect; subscribes to the planner store and re-renders whenplannerStatereference changes. OptionalplannerStore,initialPlannerState, andlocaleprops.stateExtractordefaults to identity when omitted (host no longer needs an outer Immutable map).demo/src/renderer.jsx: Creates onecreatePlannerStoreinstance and passes it asplannerStore; removedProvider/createStore.package.json: Addedzustand, removedreduxandreact-redux.build-demoandstartsetNODE_OPTIONS=--openssl-legacy-providerso webpack 4 runs on Node 17+.demo/webpack.config.js: Vendor chunk useszustandinstead of redux packages.Plugin API
Plugins still receive
(store, stateExtractor)wherestorehasdispatch,getState(returns planner Immutable state), andsubscribe.Builds
npm run build(clean + demo + lib + es) succeeds in this environment.