Skip to content

Enhances React 18/19 compatibility, dependency updates - #22

Open
esitarz wants to merge 17 commits into
ordercloud-api:developmentfrom
esitarz:chore/dependency-upgrades
Open

Enhances React 18/19 compatibility, dependency updates#22
esitarz wants to merge 17 commits into
ordercloud-api:developmentfrom
esitarz:chore/dependency-upgrades

Conversation

@esitarz

@esitarz esitarz commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces significant updates to improve the SDK's compatibility with React 18 and React 19, alongside critical bug fixes and comprehensive CI/testing enhancements.

Key Features & Improvements:

  • React 18 & 19 Support:

    • Expands react and react-dom peer dependency ranges to ^18.3.1 || ^19.0.0.
    • Adds CI matrix testing to validate the SDK against both React 18.3.1 and React 19.
    • Updates README.md to clearly document supported React versions.
  • Enhanced Stability & Error Handling:

    • Repairs Axios request interceptor setup to prevent duplication in React Strict Mode, ensuring proper cleanup.
    • Ensures useAuthMutation correctly invokes the provided onError callback with full mutation context.
    • Guards localStorage access in createAsyncStoragePersister for improved server-side rendering (SSR) compatibility.
    • Simplifies logic for object schema generation.
  • CI/CD & Testing Upgrades:

    • Upgrades GitHub Actions workflows, Node.js to v24, and modernizes npm commands (npm ci).
    • Integrates Vitest for unit and React integration testing.
    • Adds new scripts for npm pack inspection and consumer validation to ensure package integrity and compatibility.
    • Updates .gitignore to include new test-related artifacts.
  • Build & Linting Modernization:

    • Migrates ESLint configuration to the new flat config format, while retaining existing hooks policies.
    • Externalizes axios, react-hook-form, and its resolvers in the library bundle to prevent duplication.
    • Adds path polyfill for Swagger Parser in Vite build configuration.
    • Refreshes general package dependencies to their latest stable versions.

Eric Sitarz and others added 17 commits May 11, 2026 16:33
Expand peer ranges so React 19 consumers can install without
peer conflicts, while keeping 18.3.1 as the minimum.

Co-authored-by: Cursor <cursoragent@cursor.com>
StrictMode remounts left duplicate Axios interceptors, and
useAuthMutation returned onError instead of calling it.
Also import JSX types for React 19 typecheck.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cover provider context, auth query/mutation gating, form wiring,
and StrictMode interceptor lifecycle without deprecated test utils.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run lint/test/build against React 18.3.1 and 19, inspect npm pack
output, and smoke-install the tarball in an isolated consumer.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update install guidance and changelog; migrate ESLint to flat
config so CI lint works on ESLint 9.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add `test:consumer` script to `package.json` to run the packed consumer validation against React 18.3.1 and 19.

Update `scripts/validate-consumer.mjs` to:
- Remove `npm install --legacy-peer-deps`, as peer dependency issues are now resolved.
- Refine version checking to use `includes` for more flexible matching of React and ReactDOM versions, accommodating release candidates.
Upgrades the library to resolve a deprecation warning present in v6.10.0, which incorrectly introduced breaking changes and recommended upgrading to v7.0.0.
Update GitHub Actions to their latest major versions for improved stability and features.
Upgrade Node.js from v20 to v24 (LTS).
Switch to `npm ci` and enable `npm cache` for more reliable and faster dependency installations.
Add `--package-lock=false` to `npm install --no-save` for consistency during matrix testing.
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.

1 participant