Skip to content

Conversation

@dayhaysoos
Copy link
Owner

@dayhaysoos dayhaysoos commented Nov 1, 2025

  • removed redux
  • Rewrite everything in TypeScript
  • Re-org tests
  • Class based approach instead a state management libraries

Note

Removes Redux and migrates to a TS ShoppingCart class with immutable state, pub/sub, storage, Stripe, and new React provider/hooks; updates tests/build to Vitest and cleans up legacy files.

  • Core (TypeScript):
    • Introduce ShoppingCart class with immutable state updates, pub/sub subscriptions, local storage persistence, input validation, and Stripe checkout helpers.
    • Add utilities: types.ts, Entry.ts, formatters.ts, storage.ts, validation.ts; new core/index.ts API and filterCart helper.
    • Remove legacy Redux slice/middleware and related core entry/tests.
  • React:
    • Add CartProvider and useShoppingCart (uses useSyncExternalStore); update useOptimisticCart and useCartActions to new API; new react/index.ts exports.
  • Tests & Build:
    • Co-locate tests (Vitest + jsdom), add comprehensive unit/integration tests for core and react.
    • Update Rollup config for TS/JSX builds; adjust type tests and serverless typings.
  • Docs:
    • Add guides: immutable state fix, Redux removal plan, Stripe API modernization.
  • Dependencies:
    • Remove Redux-related deps; add Vitest/UI, jsdom, TS presets; update package exports and scripts.

Written by Cursor Bugbot for commit 553ad3c. This will update automatically on new commits. Configure here.

…for state management

- Removed Redux Toolkit and Redux Persist from the project.
- Introduced a standalone TypeScript ShoppingCart class utilizing the pub/sub pattern for state management.
- Updated package.json and pnpm-lock.yaml to reflect the removal of Redux-related packages.
- Added comprehensive tests for the new ShoppingCart implementation.
- Created a detailed Redux removal plan document outlining the transition strategy.
@github-actions github-actions bot added package Changes to use-shopping-cart package tests Changes to tests in use-shopping-cart labels Nov 1, 2025
cursor[bot]

This comment was marked as outdated.

- Eliminated redux-mock-store from package.json and pnpm-lock.yaml.
- Cleaned up type definitions in index.d.ts by removing unused interfaces and types.
- Updated ShoppingCart class methods to return error objects for better error handling.
- Refactored type tests to align with the new ShoppingCart implementation and removed Redux references.
- Added a notification mechanism to inform subscribers when cart data is successfully loaded, ensuring React components re-render with the updated cart state.
cursor[bot]

This comment was marked as outdated.

- Replaced local isClient state with a global utility function to determine client-side rendering.
- Updated comments for clarity on the purpose of the server-side rendering guard in relation to ShoppingCart's storage initialization.
@dayhaysoos dayhaysoos merged commit d38795c into react-19 Nov 1, 2025
2 checks passed
@dayhaysoos dayhaysoos deleted the remove-redux branch November 1, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package Changes to use-shopping-cart package tests Changes to tests in use-shopping-cart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants