Skip to content

Bump react-admin to 5.15.5 - #706

Open
erwanMarmelab wants to merge 7 commits into
api-platform:mainfrom
erwanMarmelab:bump-react-admin
Open

erwanMarmelab wants to merge 7 commits into
api-platform:mainfrom
erwanMarmelab:bump-react-admin

Conversation

@erwanMarmelab

Copy link
Copy Markdown

Problem

API Platform Admin still depends on react-admin ^5.8.3. That blocks compatibility with recent react-admin releases and their new features.

Solution

Bump react-admin to ^5.15.5. The new version brings MUI 9 and TanStack Query 5.106, which required a few changes:

  • useOnSubmit: pass the MutationFunctionContext ({ client, meta }), now the 4th argument of onSuccess / onError
  • Stories: MUI 9 removed system props such as gap and width, so they move to sx
  • useOnSubmit.test.tsx: react-hotkeys-hook v5, a react-admin dependency, is ESM-only, so the test uses jest.unstable_mockModule instead of jest.requireActual
  • yarn.lock: bump nwsapi to 2.2.28 so jsdom can parse the CSS selectors MUI 9 generates

@api-platform/admin doesn't pin MUI, so new installs will now resolve MUI 9 through react-admin.

yarn build, yarn lint and yarn test pass locally.

Keep API Platform Admin compatible with recent react-admin releases.
The bump pulls MUI 9 and a newer TanStack Query, which required:
- passing the mutation context to onSuccess/onError in useOnSubmit
- replacing removed MUI system props with sx in stories
- using ESM module mocking since react-hotkeys-hook is now ESM-only
- updating nwsapi so jsdom can parse MUI 9 selectors
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.

2 participants