fix(immutable): remove Immutable (option 2)#5755
Open
smouillour wants to merge 14 commits intomasterfrom
Open
Conversation
🦋 Changeset detectedLatest commit: 78e74a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
Contributor
|
Storybook for this PR deployed on this github page |
Contributor
jmfrancois
reviewed
Mar 12, 2026
Comment on lines
-9505
to
-9509
| immutable@^3.8.2: | ||
| version "3.8.3" | ||
| resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.3.tgz#0a8d2494a94d4b2d4f0e99986e74dd25d1e9a859" | ||
| integrity sha512-AUY/VyX0E5XlibOmWt10uabJzam1zlYjwiEgQSDc5+UIkFNaF9WM0JxXKaNMGf+F/ffUF+7kRKXM9A7C0xXqMg== | ||
|
|
65df9fa to
fe6e8cd
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the remaining ImmutableJS v3 usage across multiple packages and migrates state access/manipulation to plain JS objects/arrays, including CMF selector updates and related test/story changes.
Changes:
- Replaced
.get()/.getIn()/.set()/.mergeIn()/.toJS()patterns with plain object access/spreads acrossflow-designer,containers,components,cmf, andcmf-cqrs. - Introduced new CMF
selectors.components.*helpers and alignedselectors.toJSto be an identity wrapper for plain JS stores. - Updated Vitest setups/configs (notably
localStoragehandling for newer Node+jsdom behavior) and refreshed snapshots.
Reviewed changes
Copilot reviewed 222 out of 235 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/flow-designer/src/selectors/linkSelectors.ts | Migrate link/port selectors from Immutable Map APIs to plain object iteration/filtering. |
| packages/flow-designer/src/selectors/snapshots/nodeSelectors.test.ts.snap | Snapshot updates reflecting Set {} output instead of Immutable.Set. |
| packages/flow-designer/src/reducers/state-utils.ts | Adds setIn/deleteIn helpers for immutable-style updates on plain JS objects. |
| packages/flow-designer/src/reducers/port.reducer.test.ts | Updates reducer tests to use plain objects and new record wrappers. |
| packages/flow-designer/src/reducers/nodeType.reducer.ts | Migrates nodeType reducer update logic to object spread. |
| packages/flow-designer/src/reducers/flow.reducer.test.ts | Updates flow reducer tests to plain JS state construction. |
| packages/flow-designer/src/constants/flowdesigner.proptypes.ts | Replaces react-immutable-proptypes record validators with PropTypes.shape. |
| packages/flow-designer/src/components/port/PortsRenderer.test.tsx | Updates ports renderer test data from Immutable Map to object map. |
| packages/flow-designer/src/components/port/PortsRenderer.component.tsx | Iterates ports via Object.values instead of .toArray(). |
| packages/flow-designer/src/components/node/NodesRenderer.test.tsx | Updates node renderer tests from Immutable Map/List to plain objects. |
| packages/flow-designer/src/components/node/NodesRenderer.component.tsx | Iterates nodes via Object.values instead of .toArray(). |
| packages/flow-designer/src/components/node/AbstractNode.component.tsx | Migrates port positioning logic off Immutable structures; updates Node position access. |
| packages/flow-designer/src/components/link/LinksRenderer.test.tsx | Updates link renderer tests from Immutable maps to plain maps. |
| packages/flow-designer/src/components/link/LinksRenderer.component.tsx | Switches link/port lookups to object indexing. |
| packages/flow-designer/src/components/FlowDesigner.container.tsx | Updates mapStateToProps to access plain JS slice; updates setNodeTypes typing. |
| packages/flow-designer/src/components/FlowDesigner.container.test.tsx | Updates FlowDesigner tests to pass plain node/port/link maps. |
| packages/flow-designer/src/api/size/size.ts | Replaces Immutable record getters/setters with property access and record reconstruction. |
| packages/flow-designer/src/api/size/size.test.ts | Updates size API tests and expected exception formatting for plain objects. |
| packages/flow-designer/src/api/position/position.ts | Replaces Immutable record getters/setters with property access and record reconstruction. |
| packages/flow-designer/src/api/position/position.test.ts | Updates position API tests and expected exception formatting for plain objects. |
| packages/flow-designer/src/api/port/port.test.ts | Updates port API tests to use plain objects instead of Map(). |
| packages/flow-designer/src/api/node/node.test.ts | Updates node API tests to use plain objects instead of Map()/fromJS. |
| packages/flow-designer/src/api/link/link.test.ts | Updates link API tests to use plain objects instead of Map(). |
| packages/flow-designer/src/actions/port.actions.test.ts | Updates mocked CMF store state from Immutable maps to plain objects. |
| packages/flow-designer/src/actions/nodeType.actions.ts | Updates nodeTypes action to accept Record<string, any> instead of Immutable Map. |
| packages/flow-designer/src/actions/nodeType.actions.test.ts | Updates nodeTypes action test to use plain object input. |
| packages/flow-designer/src/actions/link.actions.test.ts | Updates mocked CMF store state from Immutable maps to plain objects. |
| packages/flow-designer/package.json | Removes immutable dep/peerDep and react-immutable-proptypes dep. |
| packages/faceted-search/vitest.config.ts | Renames setup file reference to test-setup.js. |
| packages/faceted-search/test-setup.js | Adds vitest setup with jest-compat and jsdom localStorage workaround. |
| packages/faceted-search/jest.setup.js | Removes old setup file. |
| packages/containers/src/test-setup.js | Adds jsdom localStorage override workaround. |
| packages/containers/src/Typeahead/Typeahead.test.js | Updates tests away from Immutable; adjusts click target guarding. |
| packages/containers/src/Typeahead/Typeahead.container.jsx | Replaces DEFAULT_STATE Immutable.Map with plain object and updates state access. |
| packages/containers/src/TabBar/TabBar.test.js | Updates CMF component state fixture to plain objects. |
| packages/containers/src/TabBar/TabBar.selectors.js | Uses CMF selector API for component state; supports both legacy .get and plain objects. |
| packages/containers/src/TabBar/TabBar.connect.js | Replaces DEFAULT_STATE Immutable.Map with plain object. |
| packages/containers/src/SubHeaderBar/SubHeaderBar.test.js | Updates fixtures to plain objects. |
| packages/containers/src/SubHeaderBar/SubHeaderBar.selectors.js | Replaces .getIn with optional chaining for component state access. |
| packages/containers/src/SubHeaderBar/SubHeaderBar.container.jsx | Replaces DEFAULT_STATE Immutable.Map and .toJS() usage with plain objects. |
| packages/containers/src/Slider/snapshots/Slider.test.js.snap | Updates snapshot output due to rendered markup changes. |
| packages/containers/src/Slider/Slider.test.js | Updates slider state fixtures to plain objects. |
| packages/containers/src/Slider/Slider.stories.jsx | Updates story state fixtures to plain objects. |
| packages/containers/src/Slider/Slider.selectors.js | Updates selector to use plain object component state access. |
| packages/containers/src/Slider/Slider.container.jsx | Replaces Immutable-based state manipulation with plain object patches. |
| packages/containers/src/SidePanel/SidePanel.container.jsx | Replaces DEFAULT_STATE Map and .get usage with plain objects. |
| packages/containers/src/ShortcutManager/ShortcutManager.test.js | Updates CMF components fixture to plain object. |
| packages/containers/src/SelectObject/SelectObject.connect.test.js | Updates collections/components fixtures from Immutable to plain JS. |
| packages/containers/src/SelectObject/SelectObject.connect.js | Uses CMF collection selector and plain component state access. |
| packages/containers/src/SelectObject/SelectObject.component.test.js | Adapts tests to non-Immutable shape (adds minimal compat shims). |
| packages/containers/src/SelectObject/SelectObject.component.jsx | Updates item access from .get() to property indexing; updates prop types. |
| packages/containers/src/PieChartButton/PieChartButton.test.js | Migrates state fixtures from Immutable fromJS to plain objects. |
| packages/containers/src/PieChartButton/PieChartButton.connect.jsx | Replaces DEFAULT_STATE Map and uses plain object state reads. |
| packages/containers/src/ObjectViewer/ObjectViewer.test.jsx | Updates assertions from Immutable List/Map APIs to arrays/objects. |
| packages/containers/src/ObjectViewer/ObjectViewer.container.jsx | Replaces DEFAULT_STATE and update helpers with array/object operations. |
| packages/containers/src/Notification/pushNotification.js | Migrates notifications state update to plain object structure + CMF selector property access. |
| packages/containers/src/Notification/clearNotifications.js | Migrates clear logic to plain object structure + CMF selector property access. |
| packages/containers/src/Notification/Notification.stories.jsx | Updates story state fixture from Immutable to plain arrays/objects. |
| packages/containers/src/Notification/Notification.sagas.test.js | Removes Immutable conversion; asserts dispatched actions directly. |
| packages/containers/src/Notification/Notification.sagas.js | Replaces Immutable updateIn/push with array-spread based append. |
| packages/containers/src/Notification/Notification.container.jsx | Replaces DEFAULT_STATE Map/List and .toJS() with plain objects. |
| packages/containers/src/Notification/Notification.connect.js | Replaces Immutable list delete with array slice/spread. |
| packages/containers/src/List/List.stories.jsx | Migrates story fixtures from Immutable fromJS/Map to plain JS arrays/objects. |
| packages/containers/src/List/List.sagas.test.js | Migrates CMF state fixtures from Immutable to plain objects/arrays. |
| packages/containers/src/List/List.container.jsx | Removes Immutable propTypes and updates selection logic to arrays. |
| packages/containers/src/List/List.connect.js | Migrates state derivation logic from Immutable .size/.setIn/.mergeIn to object merges. |
| packages/containers/src/HomeListView/HomeListView.stories.jsx | Migrates story items fixture to plain array. |
| packages/containers/src/HomeListView/HomeListView.connect.test.js | Migrates test items fixture to plain array. |
| packages/containers/src/HeaderBar/HeaderBar.test.js | Updates container/connect test fixtures from Immutable to plain objects/arrays. |
| packages/containers/src/HeaderBar/HeaderBar.container.jsx | Replaces DEFAULT_STATE Map and .get usage with plain objects. |
| packages/containers/src/GuidedTour/GuidedTour.test.js | Migrates state fixture to plain object. |
| packages/containers/src/GuidedTour/GuidedTour.stories.jsx | Migrates story state fixture to plain object. |
| packages/containers/src/GuidedTour/GuidedTour.container.jsx | Replaces .get('show') with direct property access. |
| packages/containers/src/GuidedTour/GuidedTour.connect.js | Replaces DEFAULT_STATE Map with plain object. |
| packages/containers/src/Form/Form.test.js | Migrates fixtures from Immutable to plain objects; updates assertion expectations. |
| packages/containers/src/Form/Form.container.jsx | Replaces DEFAULT_STATE Map and .toJS() usage with plain objects. |
| packages/containers/src/FilterBar/FilterBar.selectors.js | Replaces Immutable checks with optional chaining + plain property reads. |
| packages/containers/src/FilterBar/FilterBar.container.jsx | Replaces DEFAULT_STATE Map and toggling logic with plain object patches. |
| packages/containers/src/EditableText/EditableText.selectors.js | Migrates state access from .get to optional chaining. |
| packages/containers/src/EditableText/EditableText.container.jsx | Replaces DEFAULT_STATE Map and .toJS() spread with plain objects. |
| packages/containers/src/DeleteResource/sagas.test.js | Migrates fixtures from Immutable Map to plain object resources. |
| packages/containers/src/DeleteResource/sagas.js | Replaces resource.get(...) with plain property access. |
| packages/containers/src/DeleteResource/DeleteResource.test.js | Migrates collections/resource fixtures from Immutable to plain objects/arrays. |
| packages/containers/src/DeleteResource/DeleteResource.container.jsx | Replaces resource.get(...) with plain property access. |
| packages/containers/src/DeleteResource/DeleteResource.connect.js | Uses CMF collection selector to find a collection item by id. |
| packages/containers/src/ConfirmDialog/showHideConfirmDialog.js | Replaces Immutable .setIn updates with nested object spreads. |
| packages/containers/src/ConfirmDialog/ConfirmDialog.stories.jsx | Migrates story state fixture to plain object. |
| packages/containers/src/ConfirmDialog/ConfirmDialog.container.jsx | Replaces DEFAULT_STATE Map and .toJS() with plain object usage. |
| packages/containers/src/ConfirmDialog/ConfirmDialog.connect.js | Replaces cmfProps.state.get(...) with optional chaining property reads. |
| packages/containers/src/ComponentForm/ComponentForm.test.js | Migrates fixtures from Immutable to plain objects. |
| packages/containers/src/ComponentForm/ComponentForm.selectors.test.js | Updates CMF components fixtures to plain objects. |
| packages/containers/src/ComponentForm/ComponentForm.selectors.js | Migrates selector from .get to property access. |
| packages/containers/src/ComponentForm/ComponentForm.sagas.js | Removes Immutable fromJS/setIn usage; uses plain object patches. |
| packages/containers/src/ComponentForm/ComponentForm.saga.test.js | Updates saga tests for plain object component state payloads. |
| packages/containers/src/ComponentForm/ComponentForm.component.jsx | Replaces DEFAULT_STATE Map and .get/.getIn/.toJS() usage with plain objects. |
| packages/containers/src/Breadcrumbs/Breadcrumbs.stories.jsx | Migrates story state fixture to plain object. |
| packages/containers/src/Breadcrumbs/Breadcrumbs.connect.jsx | Migrates state access from .get to property access; defaultState to plain object. |
| packages/containers/src/AppLoader/AppLoader.connect.test.js | Migrates collections fixtures from Immutable Map to plain objects. |
| packages/containers/src/AppLoader/AppLoader.connect.jsx | Migrates collection existence checks off Map.has to plain object membership. |
| packages/containers/src/ActionDropdown/ActionDropdown.stories.jsx | Migrates story items from Immutable fromJS to plain arrays. |
| packages/containers/src/ActionDropdown/ActionDropdown.connect.jsx | Removes immutable propTypes and simplifies items prop contract to arrays. |
| packages/containers/src/AboutDialog/AboutDialog.test.js | Migrates collections fixture from Immutable structures to plain objects. |
| packages/containers/src/AboutDialog/AboutDialog.container.jsx | Replaces DEFAULT_STATE Map and .get usage with plain objects. |
| packages/containers/package.json | Removes published immutable and react-immutable-proptypes dependencies. |
| packages/containers/.storybook/cmfModule/index.js | Migrates Storybook preloaded CMF collections from Immutable fromJS to plain objects. |
| packages/components/src/test-setup.js | Adds jsdom localStorage override workaround for Node v25+. |
| packages/components/src/DataViewer/Managers/TreeManager/TreeManager.test.jsx | Updates tests from Immutable Maps/Lists to objects/arrays. |
| packages/components/src/DataViewer/Managers/TreeManager/TreeManager.container.js | Migrates expanded/collapsed path collections from Immutable to objects/arrays. |
| packages/components/src/Actions/ActionDropdown/Dropdown.stories.jsx | Migrates items fixture away from Immutable and adjusts story copy. |
| packages/components/src/Actions/ActionDropdown/ActionDropdown.test.jsx | Adds regression test ensuring plain array items render post-Immutable removal. |
| packages/components/src/Actions/ActionDropdown/ActionDropdown.snapshot.test.jsx | Removes Immutable parity snapshot test and Immutable fixtures. |
| packages/components/src/Actions/ActionDropdown/ActionDropdown.component.jsx | Removes Immutable guards/propTypes support; expects plain arrays only. |
| packages/components/package.json | Removes published immutable and react-immutable-proptypes dependencies. |
| packages/cmf/vitest.config.ts | Expands esbuild/test include patterns; sets jsdom URL; includes __tests__. |
| packages/cmf/src/test-setup.ts | Adds jsdom localStorage override workaround for Node v25+. |
| packages/cmf/src/selectors/toJS.js | Makes toJS wrapper an identity function; updates docstring to new store model. |
| packages/cmf/src/selectors/index.test.js | Adds tests validating selectors index exports include components. |
| packages/cmf/src/selectors/index.js | Exposes new selectors.components alongside collections and toJS. |
| packages/cmf/src/selectors/components.test.js | Adds unit tests for new components selector helpers. |
| packages/cmf/src/selectors/components.js | Introduces getComponentState* selectors for component state access. |
| packages/cmf/src/selectors/collections.js | Migrates collections selectors to lodash.get + adds helpers for plain collections/items. |
| packages/cmf/src/reducers/componentsReducers.js | Migrates component state reducer from Immutable to nested object updates. |
| packages/cmf/src/onEvent.js | Migrates handler state access from Immutable to plain objects; removes Immutable initial state. |
| packages/cmf/src/mock/index.js | Updates mock docs to reflect plain-object CMF state shape. |
| packages/cmf/src/mock/components.js | Exports plain JS components state fixture instead of fromJS. |
| packages/cmf/src/mock/collections.js | Exports plain JS collections fixture instead of Immutable Map. |
| packages/cmf/src/localStorage.js | Removes Immutable rehydration; uses lodash.get/set to persist selected paths. |
| packages/cmf/src/expressions/oneOf.js | Migrates expression evaluation to plain JS array access via lodash.get. |
| packages/cmf/src/expressions/index.md | Updates doc examples to plain state objects and property access. |
| packages/cmf/src/expressions/includes.js | Migrates includes expression to plain arrays with lodash.get. |
| packages/cmf/src/expressions/getInState.js | Migrates getInState to lodash.get on plain objects. |
| packages/cmf/src/expressions/allOf.js | Migrates allOf expression to plain arrays; clarifies subset semantics. |
| packages/cmf/src/componentState.js | Migrates componentState helpers/initState merging to plain objects. |
| packages/cmf/src/cmfConnect.jsx | Migrates getState and spreadCMFState behavior to plain objects; updates propTypes. |
| packages/cmf/package.json | Removes published immutable and react-immutable-proptypes dependencies. |
| packages/cmf/tests/store.test.js | Migrates jest mocks to vitest vi for consistency. |
| packages/cmf/tests/selectors/toJS.test.js | Updates tests to reflect toJS identity behavior and vitest mocks. |
| packages/cmf/tests/sagas/putActionCreator.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf/tests/sagas/collection.test.js | Migrates collections fixtures from Immutable to plain objects. |
| packages/cmf/tests/registry.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf/tests/reducers/settingsReducers.test.js | Migrates jest mocks to vitest vi; updates thrown error expectations. |
| packages/cmf/tests/reducers/componentsReducers.test.js | Migrates component reducer tests from Immutable to plain objects; vitest mocks. |
| packages/cmf/tests/onEvent.test.js | Migrates onEvent tests to vitest + plain object state. |
| packages/cmf/tests/onError.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf/tests/middlewares/error.test.js | Migrates jest mocks to vitest vi and normalizes imports. |
| packages/cmf/tests/middlewares/cmf.test.js | Migrates jest mocking to vitest vi. |
| packages/cmf/tests/middlewares/snapshots/http.test.js.snap | Snapshot header/name updates for Vitest output. |
| packages/cmf/tests/localStorage.test.js | Migrates fixtures from Immutable to plain objects; updates assertions. |
| packages/cmf/tests/expression.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf/tests/componentState.test.js | Migrates fixtures from Immutable to plain objects; updates assertions. |
| packages/cmf/tests/cmfModule.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf/tests/actions/http.test.js | Migrates jest mocks to vitest vi; minor formatting. |
| packages/cmf/tests/actions/collectionsActions.test.js | Migrates collection fixtures from Immutable to plain objects. |
| packages/cmf/tests/actionCreator.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf/tests/action.test.js | Migrates jest mocks to vitest vi. |
| packages/cmf-cqrs/src/reducers/ack.test.js | Migrates ack reducer tests from Immutable to plain objects. |
| packages/cmf-cqrs/src/reducers/ack.js | Replaces Immutable Map-based ACK state with plain object reducer logic. |
| packages/cmf-cqrs/src/reducers/snapshots/ack.test.js.snap | Snapshot updates reflecting plain object output. |
| packages/cmf-cqrs/src/middleware/socketMiddleware.test.js | Migrates test state fixtures from Immutable maps to plain objects. |
| packages/cmf-cqrs/src/components/ACKDispatcher/snapshots/ACKDispatcher.test.jsx.snap | Snapshot updates reflecting plain object ACK map. |
| packages/cmf-cqrs/src/components/ACKDispatcher/ACKDispatcher.test.jsx | Migrates ACKDispatcher tests from Immutable to plain objects. |
| packages/cmf-cqrs/src/components/ACKDispatcher/ACKDispatcher.container.js | Migrates ACKDispatcher state iteration from Iterable/Map to Object.entries. |
| packages/cmf-cqrs/package.json | Removes published immutable dependency. |
| docs/migration-guides/vote-presentation-immutable-strategy.md | Adds decision proposal document comparing upgrade vs full removal strategy. |
| docs/migration-guides/remove-immutable/migration-guide-remove-immutable-stepper.md | Adds stepper migration note (dependency cleanup only). |
| docs/migration-guides/remove-immutable/migration-guide-remove-immutable-sagas.md | Adds sagas per-package migration guide for plain JS returns. |
| docs/migration-guides/remove-immutable/migration-guide-remove-immutable-flow-designer.md | Adds flow-designer per-package migration guide (plain object internal state). |
| docs/migration-guides/remove-immutable/migration-guide-remove-immutable-components.md | Adds components per-package migration guide (ActionDropdown items array-only). |
| docs/migration-guides/remove-immutable/migration-guide-remove-immutable-cmf-cqrs.md | Adds CMF-CQRS per-package migration guide (ACK state plain object). |
| docs/migration-guides/migration-guide-remove-immutable.md | Adds index migration guide + quick reference table/grep patterns. |
| .changeset/remove-immutable.md | Adds changeset for major bumps and migration notes across affected packages. |
packages/flow-designer/src/components/node/AbstractNode.component.tsx
Outdated
Show resolved
Hide resolved
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.
What is the problem this PR is trying to solve?
What is the chosen solution to this problem?
Please check if the PR fulfills these requirements
yarn changesetto a request a release from the CI if wanted.[ ] This PR introduces a breaking change