Skip to content

Add support for React 19 - #10437

Merged
slax57 merged 18 commits into
nextfrom
react-19
Jan 10, 2025
Merged

Add support for React 19#10437
slax57 merged 18 commits into
nextfrom
react-19

Conversation

@djhi

@djhi djhi commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

Problem

React 19 is out !

Solution

Add support for React 19. Requires to upgrade MUI to latest v5.

  • react-admin packages will still use v18 in their devDependencies to ensure we don't use v19 only features inadvertently.
  • The tutorial and e-commerce demo will use v19 so that we have an easy way to test v19

TODO

  • Fix CRM demo
  • Upgrade react-is

How To Test

  • Run each app and check that they work as before
  • Run the tests

Additional Checks

  • The PR targets master for a bugfix, or next for a feature

@djhi djhi added RFR Ready For Review WIP Work In Progress and removed WIP Work In Progress RFR Ready For Review labels Jan 8, 2025
@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Jan 8, 2025
@djhi djhi mentioned this pull request Jan 8, 2025
1 task
@djhi djhi added WIP Work In Progress and removed RFR Ready For Review labels Jan 9, 2025
@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Jan 9, 2025
@slax57
slax57 self-requested a review January 9, 2025 09:49
@djhi djhi mentioned this pull request Jan 9, 2025
3 tasks
Comment thread examples/crm/package.json Outdated
Comment thread examples/crm/vite.config.ts
Comment thread examples/no-code/package.json Outdated
Comment thread examples/demo/package.json
Comment thread packages/ra-input-rich-text/package.json
Comment thread packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx Outdated
Comment thread packages/ra-ui-materialui/package.json
Comment thread examples/demo/src/products/ProductEdit.tsx Outdated
Comment on lines +34 to +35
"little-state-machine": "^4.8.1",
"react-simple-animate": "^3.5.3",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to add those manually (hookform devtools depends on them) to have react-19 support

Comment thread yarn.lock
languageName: node
linkType: hard

"@types/d3-array@npm:^3.0.3":

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of duplicates I can't resolve here with d3. This is because of recharts and one of its dependency (victory) that have conflicting types deps

Comment thread examples/demo/src/App.tsx
return (
<Admin
title=""
title="Posters Galore Admin"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to access it in custom titles

Comment on lines +69 to +72
const pageTitle = translate('ra.page.edit', {
name: getResourceLabel('categories', 1),
recordRepresentation: `"${record?.name}"`,
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not use usePageTitle here because we want the quotes around the name in titles but not in the record representation

Comment on lines +43 to +46
const pageTitle = translate('ra.page.edit', {
name: getResourceLabel('products', 1),
recordRepresentation: `"${record?.reference}"`,
});

@djhi djhi Jan 9, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not use usePageTitle here because we want the quotes around the reference in titles but not in the record representation

rowClick={rowClick}
rowSx={rowSx}
rowStyle={rowStyle}
resource={resource}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes an issue we somehow missed before: SimpleList was not propagating its resource prop

@slax57 slax57 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

Comment thread examples/demo/src/segments/Segments.tsx Outdated
@slax57 slax57 added this to the 5.5.0 milestone Jan 10, 2025
@slax57
slax57 merged commit 40bda09 into next Jan 10, 2025
@slax57
slax57 deleted the react-19 branch January 10, 2025 09:05
@slax57 slax57 changed the title Supports react 19 React 19 support Jan 10, 2025
@slax57 slax57 changed the title React 19 support Add support for React 19 Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants