Conversation
| }; | ||
| /* eslint-enable tree-shaking/no-side-effects-in-initialization */ | ||
|
|
||
| const AdminGuesserWithError = ({ |
There was a problem hiding this comment.
We no longer need this wrapper as react-admin v5 has a global error boundary
There was a problem hiding this comment.
component extracted to its own file for clarity
| ); | ||
| }; | ||
|
|
||
| /* eslint-disable tree-shaking/no-side-effects-in-initialization */ |
There was a problem hiding this comment.
react-admin v5 no longer has propTypes, React 18.3 warns against them, so I removed them
| * If child components are passed (usually `<ResourceGuesser>` or `<Resource>` components, but it can be any other React component), they are rendered in the given order. | ||
| * If no children are passed, a `<ResourceGuesser>` component is created for each resource type exposed by the API, in the order they are specified in the API documentation. | ||
| */ | ||
| export const AdminResourcesGuesser = ({ |
There was a problem hiding this comment.
extracted to its own file for clarity
| SchemaAnalyzer, | ||
| } from './types.js'; | ||
|
|
||
| const ResourcesIntrospecter = ({ |
There was a problem hiding this comment.
Moved to its own file for clarity
|
I'm blocked. For a reason I don't understand, the jest tests fail at reading the I've verified that:
If someone wants to give it a try, be my guest. That being said, the storybook runs the test admin with greetings, so we're probably close. |
| const embeddedsField = await screen.findByLabelText( | ||
| 'resources.users.fields.embeddeds', |
There was a problem hiding this comment.
This is due to a change in RA v5: ArrayInputs with scalar value no longer have a label of the form resources.users.fields.embeddeds.0. The recommendation is now to provide your own label (which I did).
| '^@tanstack/react-query$': | ||
| '<rootDir>/node_modules/@tanstack/react-query/build/modern/index.cjs', |
There was a problem hiding this comment.
For some reason, Jest resolved imports to @tanstack/react-query to the ESM code when imported from the test file, and to the CJS code when imported from ra-core. This caused the issue about QueryClient because the references to the context object were not equal.
This line forces the resolution to the CJS code all the time, which solves the issue.
There was a problem hiding this comment.
Isn't it a problem react-admin users may be facing, too?
There was a problem hiding this comment.
Indeed it could be, if they are using Jest with NODE_OPTIONS=--experimental-vm-modules. But I'm not sure it's react-admin's responsibility to document this, as this rather looks like a Jest bug to me...
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
package.json
Outdated
| { | ||
| "name": "@api-platform/admin", | ||
| "version": "3.4.8", | ||
| "version": "4.0.0", |
There was a problem hiding this comment.
To revert, this will be handled by yarn version during the release process: https://github.com/api-platform/admin/blob/main/CONTRIBUTING.md#tag-a-new-version-contributors-only
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
|
Great! Can someone with NPM credentials trigger the publication of the package? |
Closes #569