Remove Redux Toolkit from @trrack/core and expand core coverage#76
Remove Redux Toolkit from @trrack/core and expand core coverage#76
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the @reduxjs/toolkit dependency from @trrack/core by introducing a local action-creator implementation and refactoring the provenance graph “store” to a lightweight in-module reducer/update mechanism, alongside a sizable expansion of the core test suite.
Changes:
- Removed Redux Toolkit from
@trrack/core(deps + bundling config) and replaced RTK action utilities with local equivalents. - Replaced the RTK store/slice/listener setup for the provenance graph with a local reducer + manual listener notification.
- Expanded
packages/coretests to cover traversal, recording strategy, registry behavior, node construction, and import/export fidelity.
Reviewed changes
Copilot reviewed 20 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Removes RTK/redux-related lock entries. |
| packages/core/vite.config.ts | Removes RTK externals/globals from library build config. |
| packages/core/package.json | Drops @reduxjs/toolkit from dependencies/peerDependencies. |
| packages/core/src/action.ts | Adds local PayloadAction/createAction implementation. |
| packages/core/src/index.ts | Re-exports local action utilities from the package entrypoint. |
| packages/core/src/registry/reg.ts | Switches registry action creator creation from RTK to local createAction and adjusts typing overloads. |
| packages/core/src/registry/action.ts | Replaces RTK PayloadAction type import and loosens StateChangeFunction return typing. |
| packages/core/src/provenance/types.ts | Replaces RTK PayloadAction import and fixes NodeId import location. |
| packages/core/src/provenance/trrack.ts | Fixes patch-vs-checkpoint detection logic and replaces RTK PayloadAction import. |
| packages/core/src/graph/graph-slice.ts | Replaces RTK slice with local action creators + reducer function. |
| packages/core/src/graph/provenance-graph.ts | Replaces RTK store/listener middleware with local backend state + listener notification. |
| packages/core/src/graph/components/node.ts | Replaces RTK PayloadAction import with local type. |
| packages/core/tests/node.spec.ts | Replaces placeholder with real node construction tests. |
| packages/core/tests/registry.spec.ts | Adds registry/action-creator behavior tests. |
| packages/core/tests/recording.spec.ts | Adds tests for patch vs checkpoint storage decisions. |
| packages/core/tests/traversal.spec.ts | Adds tests for branch traversal, redo policies, and side-effect replay. |
| packages/core/tests/current-change.spec.ts | Adds tests for current-change listener semantics/unsubscribe behavior. |
| packages/core/tests/event.spec.ts | Adds unsubscribe behavior test for the event manager. |
| packages/core/tests/import_export.test.ts | Adds round-trip tests for branched graphs with metadata/artifacts/annotations/bookmarks. |
| packages/core/dist/action.d.ts | Updates generated type declarations for the new local action module. |
| packages/core/dist/index.d.ts | Updates generated entrypoint typings to export local action module. |
| packages/core/dist/index.js | Updates built CJS bundle to remove RTK usage. |
| packages/core/dist/index.mjs | Updates built ESM bundle to remove RTK usage. |
| packages/core/dist/index.umd.js | Updates built UMD bundle to remove RTK usage/globals. |
| packages/core/dist/registry/reg.d.ts | Updates generated registry typing to remove RTK helper types. |
| packages/core/dist/registry/action.d.ts | Updates generated registry action types to use local PayloadAction. |
| packages/core/dist/provenance/types.d.ts | Updates generated provenance typings to remove RTK import and use local NodeId. |
| packages/core/dist/graph/graph-slice.d.ts | Updates generated graph slice typings to reflect local reducer/action creators. |
| packages/core/dist/graph/provenance-graph.d.ts | Updates generated provenance-graph typings to reflect local update API. |
| packages/core/dist/graph/components/node.d.ts | Updates generated node typings to use local PayloadAction. |
| apps/dummy-testing-library/src/app/App.tsx | Updates dummy app imports to use PayloadAction from @trrack/core instead of RTK. |
| apps/docs/pages/api-reference/functions/createAction.md | Updates createAction docs for the local implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR removes the @reduxjs/toolkit dependency from @trrack/core by replacing the small RTK usages (action creator types + provenance graph store/listeners) with local implementations, and expands packages/core test coverage around traversal, recording, registry behavior, and import/export.
Changes:
- Replace RTK
createAction/PayloadActionusage with a localpackages/core/src/action.tsimplementation and re-export from@trrack/core. - Replace the RTK store/slice + listener middleware backing the provenance graph with a local reducer +
immer-based update pipeline. - Add/expand core tests for traversal, listeners, import/export, recording strategy (patch vs checkpoint), registry behavior, and unsubscribe behavior.
Reviewed changes
Copilot reviewed 21 out of 36 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Removes RTK/redux-related lock entries after dependency removal. |
| packages/core/vite.config.ts | Drops RTK externals/globals from library build config. |
| packages/core/tests/traversal.spec.ts | Adds traversal/branch navigation + side-effect replay tests. |
| packages/core/tests/registry.spec.ts | Adds registry behavior tests (creator shape, config, errors). |
| packages/core/tests/recording.spec.ts | Adds patch vs checkpoint storage strategy test coverage. |
| packages/core/tests/node.spec.ts | Replaces placeholder test with node construction/metadata/artifact tests. |
| packages/core/tests/import_export.test.ts | Adds import/export immutability + branched graph round-trip tests. |
| packages/core/tests/event.spec.ts | Adds unsubscribe behavior test for the event manager. |
| packages/core/tests/current-change.spec.ts | Adds currentChange listener + backend reference update tests. |
| packages/core/src/registry/reg.ts | Switches from RTK createAction to local action module; refines register typings/overloads. |
| packages/core/src/registry/action.ts | Switches PayloadAction import and broadens reducer return typing to allow void. |
| packages/core/src/provenance/types.ts | Switches PayloadAction import and fixes NodeId import location. |
| packages/core/src/provenance/trrack.ts | Switches PayloadAction import and fixes patch-path key detection for save strategy. |
| packages/core/src/index.ts | Re-exports local action module instead of RTK createAction. |
| packages/core/src/graph/provenance-graph.ts | Replaces RTK store/listener middleware with local reducer + immer update + manual listener notification. |
| packages/core/src/graph/graph-slice.ts | Replaces RTK slice with local action creators + reducer; adds graph cloning helper/types. |
| packages/core/src/graph/components/node.ts | Switches PayloadAction import to local action module. |
| packages/core/src/action.ts | Adds local PayloadAction/PayloadActionCreator types and createAction implementation. |
| packages/core/package.json | Removes @reduxjs/toolkit from dependencies and peerDependencies. |
| packages/core/dist/registry/reg.d.ts | Updates emitted types to reference local action creator types. |
| packages/core/dist/registry/action.d.ts | Updates emitted types to reference local PayloadAction and StateChangeFunction return type. |
| packages/core/dist/provenance/types.d.ts | Updates emitted provenance types to reference local action types and corrected NodeId import. |
| packages/core/dist/index.umd.js | Updates bundled output to remove RTK and include local implementations. |
| packages/core/dist/index.mjs | Updates ESM bundle to remove RTK and include local implementations. |
| packages/core/dist/index.js | Updates CJS bundle to remove RTK and include local implementations. |
| packages/core/dist/index.d.ts | Updates top-level typings to export from local action module. |
| packages/core/dist/graph/provenance-graph.d.ts | Updates store action creator typings and update signature away from RTK dispatch types. |
| packages/core/dist/graph/graph-slice.d.ts | Updates slice typings to local reducer/action creator types and adds cloneGraph typing. |
| packages/core/dist/graph/components/node.d.ts | Updates node typing import to local PayloadAction. |
| packages/core/dist/action.d.ts | Adds emitted type declarations for the new local action module. |
| apps/react-trrack-example/src/app/store/trrack.spec.tsx | Adds a React test ensuring backend subscription re-renders properly with currentChange. |
| apps/dummy-testing-library/src/app/App.tsx | Updates dummy app imports to use PayloadAction type from @trrack/core instead of RTK. |
| apps/docs/pages/api-reference/functions/createAction.md | Updates API docs to describe the local createAction implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
4996bd9 to
5e597cf
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the @reduxjs/toolkit dependency from @trrack/core by introducing local action-creator/types and replacing the RTK-backed provenance graph store/slice/listener wiring with a local reducer/update implementation. It also expands/adjusts core tests and updates docs/example usage accordingly.
Changes:
- Drop RTK from
@trrack/coreand add localPayloadAction/PayloadActionCreator/createAction. - Replace the provenance graph “store” with an Immer-based in-memory backend + local action creators/reducer.
- Add/extend tests for traversal, recording strategy, registry behavior, current-change listeners, and import/export behavior; update docs + example app.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/vite.config.ts | Removes RTK from build externals for the core package. |
| packages/core/package.json | Removes RTK dependency (but needs dependency follow-up for new direct imports). |
| packages/core/src/action.ts | Adds local RTK-like action types and createAction. |
| packages/core/src/index.ts | Re-exports the new local action API from the package entrypoint. |
| packages/core/src/registry/reg.ts | Switches registry to local createAction and updates typing for state reducers. |
| packages/core/src/registry/action.ts | Updates action-related types to use local PayloadAction and allow void-returning state reducers. |
| packages/core/src/graph/graph-slice.ts | Replaces RTK slice with local action creators + reducer and adds cloneGraph. |
| packages/core/src/graph/provenance-graph.ts | Replaces RTK store/listener middleware with local backend + update/notify logic. |
| packages/core/src/graph/components/node.ts | Updates PayloadAction imports/types for side effects. |
| packages/core/src/provenance/types.ts | Updates imports to local action types and internal graph exports. |
| packages/core/src/provenance/trrack.ts | Adjusts apply/record/traversal/import logic to work with the local graph backend and action types. |
| packages/core/tests/traversal.spec.ts | Adds traversal/branching/side-effect replay tests (currently missing required Vitest imports). |
| packages/core/tests/registry.spec.ts | Adds registry behavior tests (currently missing required Vitest imports). |
| packages/core/tests/recording.spec.ts | Adds patch-vs-checkpoint recording tests (currently missing required Vitest imports). |
| packages/core/tests/current-change.spec.ts | Adds current-change listener/unsubscribe/backend-ref tests (currently missing required Vitest imports). |
| packages/core/tests/import_export.spec.ts | Expands import/export tests (currently has a syntax error and missing Vitest imports). |
| apps/react-trrack-example/src/main.tsx | Adjusts render typing to satisfy TS. |
| apps/react-trrack-example/src/app/store/trrack.spec.tsx | Adds React subscription test (currently missing required Vitest imports). |
| apps/docs/pages/api-reference/functions/createAction.md | Updates docs for local createAction (currently contains an absolute local path and incorrect type parameter docs). |
Comments suppressed due to low confidence (2)
packages/core/tests/import_export.spec.ts:4
- This test file uses
describe/it/expectbut no longer imports them fromvitest, and the Vitest config for this package doesn’t enable globals. Re-add thevitestimports at the top (or enableglobals).
import { createStateNode, NodeId } from '../src/graph/components';
import { initializeTrrack } from '../src/provenance/trrack';
import { Registry } from '../src/registry';
apps/docs/pages/api-reference/functions/createAction.md:30
- The generated docs contain an absolute local filesystem path in the “Defined in” link, which will be broken in the published docs. Update the Typedoc/markdown generation so it emits repo-relative links instead of
/Users/...paths.
#### Defined in
[packages/core/src/action.ts](/Users/jwilburn/Projects/trrackjs/packages/core/src/action.ts#L19)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
b0b8504 to
3761adf
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the Redux Toolkit dependency from @trrack/core by introducing local RTK-like action types/creators and replacing RTK store/slice usage in the provenance graph with a local reducer/update mechanism. It also updates docs and expands/adjusts tests around registry/action typing.
Changes:
- Added
packages/core/src/action.tsimplementing localcreateActionand related action-typing utilities, and updated core imports away from RTK. - Replaced RTK-based provenance graph store/listener middleware with an internal
reduce+updateflow. - Updated build config, package dependencies, and API docs to reflect the RTK removal (adding
immeras a direct dependency).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/vite.config.ts | Updates Rollup externals to remove RTK and externalize immer. |
| packages/core/src/registry/reg.ts | Switches to local createAction and expands register overload typings. |
| packages/core/src/registry/reg.spec.ts | Adds typing-focused tests for createAction and Registry.register inference. |
| packages/core/src/registry/action.ts | Replaces RTK PayloadAction import with local action type. |
| packages/core/src/provenance/types.ts | Replaces RTK PayloadAction import with local action type. |
| packages/core/src/provenance/trrack.ts | Replaces RTK PayloadAction import with local action type. |
| packages/core/src/index.ts | Re-exports createAction from local implementation instead of RTK. |
| packages/core/src/graph/provenance-graph.ts | Replaces RTK store + listener middleware with local state + reducer update flow. |
| packages/core/src/graph/graph-slice.ts | Replaces createSlice with local actions + switch-based reducer using immer. |
| packages/core/src/graph/components/node.ts | Replaces RTK PayloadAction import with local action type. |
| packages/core/src/action.ts | New local action module providing PayloadAction* types and createAction. |
| packages/core/package.json | Removes @reduxjs/toolkit dependency and adds immer. |
| apps/docs/pages/api-reference/functions/createAction.md | Updates API reference “Defined in” link to point at local implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR removes the Redux Toolkit dependency from @trrack/core by introducing local action utilities and refactoring the provenance graph store to use a local reducer/state instead of an RTK store, alongside expanded test coverage around graph behavior and immutability.
Changes:
- Added a local
createAction/PayloadActionimplementation and migrated core internals off RTK types/utilities. - Replaced the RTK store + listener middleware in
initializeProvenanceGraphwith a local reducer and listener dispatch. - Added/expanded tests (including deep-freeze/immutability expectations) and updated docs to point at the local implementation.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/vite.config.ts | Updates bundler externals to drop RTK and include immer. |
| packages/core/package.json | Removes @reduxjs/toolkit, adds runtime dependency on immer. |
| packages/core/src/action.ts | Adds local action/types and createAction implementation. |
| packages/core/src/action.spec.ts | Adds tests for prepared action creators and match. |
| packages/core/src/index.ts | Switches createAction export to local implementation. |
| packages/core/src/graph/provenance-graph.ts | Replaces RTK store/middleware with local reducer-driven state updates and listener triggering. |
| packages/core/src/graph/graph-slice.ts | Replaces RTK slice with local actions + reducer using Immer, adds deep-freeze behavior. |
| packages/core/src/graph/components/node.ts | Migrates PayloadAction import to local action module. |
| packages/core/src/provenance/trrack.ts | Migrates PayloadAction import to local action module. |
| packages/core/src/provenance/types.ts | Migrates PayloadAction import to local action module. |
| packages/core/src/registry/action.ts | Migrates PayloadAction import and updates state change typing to allow void. |
| packages/core/src/registry/reg.ts | Migrates createAction import and tightens register overload return typing. |
| packages/core/src/registry/reg.spec.ts | Adds typing-focused tests for createAction and Registry.register. |
| packages/core/tests/graph.spec.ts | Adds test asserting initial state is frozen to prevent external mutation. |
| packages/core/tests/import_export.spec.ts | Adds test asserting imported/exported graph objects are frozen to prevent store rewriting. |
| apps/docs/pages/api-reference/functions/createAction.md | Updates “Defined in” links to local action.ts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This PR removes the Redux Toolkit dependency from @trrack/core and replaces the small amount of RTK functionality the package was using with local implementations.
It also fixes a couple of core typing/runtime issues uncovered during the refactor and significantly expands the packages/core test suite.
What changed
Expanded packages/core coverage with new and improved tests for:
Compatibility notes
Potential compatibility risks: