Skip to content

Commit

Permalink
Supports react 19
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Jan 7, 2025
1 parent 5fc1098 commit 53de163
Show file tree
Hide file tree
Showing 18 changed files with 211 additions and 315 deletions.
8 changes: 4 additions & 4 deletions examples/crm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"type": "module",
"dependencies": {
"@hello-pangea/dnd": "^16.3.0",
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@nivo/bar": "^0.80.0",
"@nivo/core": "^0.80.0",
"clsx": "^2.1.1",
Expand All @@ -15,10 +15,10 @@
"lodash": "~4.17.5",
"papaparse": "^5.4.1",
"ra-data-fakerest": "^5.3.0",
"react": "^18.3.1",
"react": "^19.0.0",
"react-admin": "^5.3.0",
"react-cropper": "^2.3.3",
"react-dom": "^18.3.1",
"react-dom": "^19.0.0",
"react-error-boundary": "^4.0.3",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
Expand Down
19 changes: 12 additions & 7 deletions examples/crm/src/contacts/ContactImportDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { Box, CircularProgress, Stack, Typography } from '@mui/material';
import Alert from '@mui/material/Alert';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import MuiLink from '@mui/material/Link';
import {
Alert,
Box,
CircularProgress,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
Link as MuiLink,
Stack,
Typography,
} from '@mui/material';
import {
Button,
FileField,
Expand Down
2 changes: 1 addition & 1 deletion examples/crm/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig(async () => {
// eslint-disable-next-line prettier/prettier
const packageJson = await import(
path.resolve(__dirname, '../../packages', dirName, 'package.json'),
{ assert: { type: 'json' } }
{ with: { type: 'json' } }
);
aliases[packageJson.default.name] = path.resolve(
__dirname,
Expand Down
8 changes: 4 additions & 4 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"type": "module",
"dependencies": {
"@apollo/client": "^3.3.19",
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@types/recharts": "^1.8.10",
"@vitejs/plugin-react": "^2.2.0",
"clsx": "^2.1.1",
Expand All @@ -26,9 +26,9 @@
"ra-input-rich-text": "^5.0.0",
"ra-language-english": "^5.0.0",
"ra-language-french": "^5.0.0",
"react": "^18.3.1",
"react": "^19.0.0",
"react-admin": "^5.0.0",
"react-dom": "^18.3.1",
"react-dom": "^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"recharts": "^2.1.15"
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig(async () => {
// eslint-disable-next-line prettier/prettier
const packageJson = await import(
path.resolve(__dirname, '../../packages', dirName, 'package.json'),
{ assert: { type: 'json' } }
{ with: { type: 'json' } }
);
aliases[packageJson.default.name] = path.resolve(
__dirname,
Expand Down
6 changes: 3 additions & 3 deletions examples/no-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"serve": "vite preview"
},
"dependencies": {
"@mui/material": "^5.15.20",
"@mui/material": "^5.16.12",
"ra-data-local-storage": "^5.0.0",
"ra-no-code": "^5.0.0",
"react": "^18.3.1",
"react": "^19.0.0",
"react-admin": "^5.0.0",
"react-dom": "^18.3.1"
"react-dom": "^19.0.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
Expand Down
10 changes: 4 additions & 6 deletions examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@tanstack/react-query": "^5.21.7",
"@tanstack/react-query-devtools": "^5.21.7",
"jsonexport": "^3.2.0",
Expand All @@ -23,9 +21,9 @@
"ra-input-rich-text": "^5.4.3",
"ra-language-english": "^5.4.3",
"ra-language-french": "^5.4.3",
"react": "^18.3.1",
"react": "^19.0.0",
"react-admin": "^5.4.3",
"react-dom": "^18.3.1",
"react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"dependencies": {
"ra-data-json-server": "^5.0.0",
"react": "^18.3.1",
"react": "^19.0.0",
"react-admin": "^5.0.0",
"react-dom": "^18.3.1"
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"lolex": "~2.3.2",
"prettier": "~3.2.5",
"raf": "~3.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"storybook": "^8.4.4",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"ink-text-input": "^6.0.0",
"lodash": "~4.17.5",
"meow": "^9.0.0",
"react": "^18.3.1",
"react": "^19.0.0",
"yn": "^5.0.0"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/ra-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
"expect": "^27.4.6",
"ignore-styles": "~5.0.1",
"jscodeshift": "^0.15.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
"react-test-renderer": "^18.2.0",
"recharts": "^2.1.15",
"rimraf": "^3.0.2",
"typescript": "^5.1.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/ra-input-rich-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@
"clsx": "^2.1.1"
},
"peerDependencies": {
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"ra-core": "^5.0.0",
"ra-ui-materialui": "^5.0.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/material": "^5.16.12",
"@testing-library/react": "^15.0.7",
"@tiptap/extension-mention": "^2.0.3",
"@tiptap/suggestion": "^2.0.3",
"data-generator-retail": "^5.4.3",
"ra-core": "^5.4.3",
"ra-data-fakerest": "^5.4.3",
"ra-ui-materialui": "^5.4.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"rimraf": "^3.0.2",
"tippy.js": "^6.3.7",
Expand Down
8 changes: 4 additions & 4 deletions packages/ra-no-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"cross-env": "^5.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"rimraf": "^3.0.2",
"typescript": "^5.1.3"
},
"peerDependencies": {
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
Expand Down
11 changes: 5 additions & 6 deletions packages/ra-ui-materialui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"watch": "tsc --outDir dist/esm --module es2015 --watch"
},
"devDependencies": {
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/utils": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@mui/utils": "^5.16.12",
"@testing-library/react": "^15.0.7",
"@types/dompurify": "^3.0.2",
"@types/react": "^18.3.3",
Expand All @@ -42,13 +42,12 @@
"ra-core": "^5.4.3",
"ra-i18n-polyglot": "^5.4.3",
"ra-language-english": "^5.4.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"react-is": "^18.2.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
"react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2",
"typescript": "^5.1.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ describe('<ArrayInput />', () => {
});

describe('used within a form with global validation', () => {
it('should display an error if the array is required and empty', async () => {
it.only('should display an error if the array is required and empty', async () => {
render(<GlobalValidation />);
await screen.findByDisplayValue('Leo Tolstoy');
const RemoveButtons = screen.getAllByLabelText('Remove');
Expand All @@ -393,12 +393,11 @@ describe('<ArrayInput />', () => {
await waitFor(() => {
expect(screen.queryAllByLabelText('Remove')).toHaveLength(0);
});
await screen.findByText('Required');
const SaveButton = screen.getByText('Save');
fireEvent.click(SaveButton);
await screen.findByText(
'The form is not valid. Please check for errors',
undefined,
{ timeout: 3000 }
'The form is not valid. Please check for errors'
);
});
it('should display an error if one of the required field is empty', async () => {
Expand Down
1 change: 0 additions & 1 deletion packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ If you provided a React element for the optionText prop, you must also provide t
onInputChange={handleInputChange}
renderOption={(props, record: RaRecord) => {
// We have to extract the key because react 19 does not allow to spread the key prop
// @ts-expect-error The key is indeed inside props but MUI does not provide the correct type
const { key: ignoredKey, ...rest } = props;
// We don't use MUI key which is generated from the option label because we may have options with the same label but with different values
const key = getChoiceValue(record);
Expand Down
6 changes: 2 additions & 4 deletions packages/react-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@
"react-dom": "^18.0.0 || ^19.0.0"
},
"dependencies": {
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"ra-core": "^5.4.3",
"ra-i18n-polyglot": "^5.4.3",
"ra-language-english": "^5.4.3",
Expand Down
Loading

0 comments on commit 53de163

Please sign in to comment.