Skip to content

Commit a5fa9c8

Browse files
authored
Merge pull request #11091 from marmelab/merge-master-5.13.4
Merge `master` for `5.13.4` into `next`
2 parents d66b56e + 6065878 commit a5fa9c8

File tree

177 files changed

+2549
-969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+2549
-969
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ cypress/downloads
2626
!.yarn/versions
2727
.env
2828
.claude/settings.local.json
29+
.npmrc

CHANGELOG.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,123 @@
11
# Changelog
22

3+
## 5.13.4
4+
5+
* Fix `useAugmentedForm` resets the form one too many time ([#11085](https://github.com/marmelab/react-admin/pull/11085)) ([slax57](https://github.com/slax57))
6+
* Fix `<BulkDeleteWithConfirmButton>`: prevent `mutationOptions` from being passed to DOM ([#11077](https://github.com/marmelab/react-admin/pull/11077)) ([devserkan](https://github.com/devserkan))
7+
* Fix regression in `memoryStore` ([#11075](https://github.com/marmelab/react-admin/pull/11075)) ([djhi](https://github.com/djhi))
8+
* [Doc] Update RA Core EE documentation ([#11078](https://github.com/marmelab/react-admin/pull/11078)) ([jonathanarnault](https://github.com/jonathanarnault))
9+
* [Doc] Fix `<ReferenceOneField>` doc incorrectly mentions one of `children` or `render` is required ([#11072](https://github.com/marmelab/react-admin/pull/11072)) ([slax57](https://github.com/slax57))
10+
* Bump @tiptap/extension-link from 2.0.3 to 2.10.4 ([#11074](https://github.com/marmelab/react-admin/pull/11074)) ([dependabot[bot]](https://github.com/apps/dependabot))
11+
12+
## 5.13.3
13+
14+
* Replace deprecated `<ListItemSecondaryAction>` component by `secondaryAction` prop ([#11033](https://github.com/marmelab/react-admin/pull/11033)) ([smeng9](https://github.com/smeng9))
15+
* Fix `memoryStore` does not support nested-looking keys ([#11070](https://github.com/marmelab/react-admin/pull/11070)) ([slax57](https://github.com/slax57))
16+
* Fix `<Datagrid>` does not show the correct number of selected items ([#11069](https://github.com/marmelab/react-admin/pull/11069)) ([djhi](https://github.com/djhi))
17+
* Fix values from location are not applied on Forms ([#11067](https://github.com/marmelab/react-admin/pull/11067)) ([djhi](https://github.com/djhi))
18+
19+
## 5.13.2
20+
21+
* Fix `<SelectAllButton>` ignores the `storeKey` ([#11060](https://github.com/marmelab/react-admin/pull/11060)) ([slax57](https://github.com/slax57))
22+
* Fix package exports ([#11059](https://github.com/marmelab/react-admin/pull/11059)) ([djhi](https://github.com/djhi))
23+
* Fix `<DataTable>` may duplicate ids in its selection state ([#11047](https://github.com/marmelab/react-admin/pull/11047)) ([Jszigeti](https://github.com/Jszigeti))
24+
* [Doc] Update `<ReferenceManyInputBase>` props table ([#11055](https://github.com/marmelab/react-admin/pull/11055)) ([jonathanarnault](https://github.com/jonathanarnault))
25+
* [Doc] Fix Youtube integrations ([#11053](https://github.com/marmelab/react-admin/pull/11053)) ([slax57](https://github.com/slax57))
26+
* [Doc] Fix headless FormDataConsumer doc still references react-admin, and mention SimpleFormIteratorBase ([#11050](https://github.com/marmelab/react-admin/pull/11050)) ([slax57](https://github.com/slax57))
27+
* [Doc] Update RA Core EE documentation ([#11037](https://github.com/marmelab/react-admin/pull/11037)) ([jonathanarnault](https://github.com/jonathanarnault))
28+
* [TypeScript] Fix usage of `ReactElement` when it should be `ReactNode` ([#11046](https://github.com/marmelab/react-admin/pull/11046)) ([djhi](https://github.com/djhi))
29+
* [website] Remove banner to announce Shadcn Admin Kit - master ([#11048](https://github.com/marmelab/react-admin/pull/11048)) ([slax57](https://github.com/slax57))
30+
* [chore] Bump astro from 5.15.6 to 5.15.9 ([#11057](https://github.com/marmelab/react-admin/pull/11057)) ([dependabot[bot]](https://github.com/apps/dependabot))
31+
* [chore] Stabilize flaky unit tests ([#11056](https://github.com/marmelab/react-admin/pull/11056)) ([djhi](https://github.com/djhi))
32+
33+
## 5.13.1
34+
35+
* Fix imports from directory ([#11039](https://github.com/marmelab/react-admin/pull/11039)) ([djhi](https://github.com/djhi))
36+
* Fix `<ReferenceFieldBase>` considers zero-index reference as empty ([#11042](https://github.com/marmelab/react-admin/pull/11042)) ([fzaninotto](https://github.com/fzaninotto))
37+
* [Storybook] Fix `<ArrayInputBase>` story issue when adding back a removed item ([#11041](https://github.com/marmelab/react-admin/pull/11041)) ([djhi](https://github.com/djhi))
38+
* [Storybook] Fix `<SaveButton>` Dirty story ([#11040](https://github.com/marmelab/react-admin/pull/11040)) ([djhi](https://github.com/djhi))
39+
* Bump astro from 5.15.3 to 5.15.6 ([#11043](https://github.com/marmelab/react-admin/pull/11043)) ([dependabot[bot]](https://github.com/apps/dependabot))
40+
* [chore] Fix release script copies invalid node_modules subfolder ([#11038](https://github.com/marmelab/react-admin/pull/11038)) ([slax57](https://github.com/slax57))
41+
42+
## 5.13.0
43+
44+
* Introduce `<ArrayInputBase>`, `<SimpleFomIteratorBase>` and `<SimpleFormIteratorItemBase>` ([#10955](https://github.com/marmelab/react-admin/pull/10955)) ([djhi](https://github.com/djhi))
45+
* Introduce separate selection states for lists with distinct `storeKey` ([#10953](https://github.com/marmelab/react-admin/pull/10953)) ([mikhail-fedosenko](https://github.com/mikhail-fedosenko))
46+
* Speed up ArrayInput ([#10926](https://github.com/marmelab/react-admin/pull/10926)) ([fzaninotto](https://github.com/fzaninotto))
47+
* Improve packages exports ([#10995](https://github.com/marmelab/react-admin/pull/10995)) ([djhi](https://github.com/djhi))
48+
* Export guessers views ([#10981](https://github.com/marmelab/react-admin/pull/10981)) ([djhi](https://github.com/djhi))
49+
* Add empty property to ListBase and InfiniteListBase ([#10940](https://github.com/marmelab/react-admin/pull/10940)) ([Madeorsk](https://github.com/Madeorsk))
50+
* Fix `useExpanded` does not have a stable `defaultValue` ([#11028](https://github.com/marmelab/react-admin/pull/11028)) ([djhi](https://github.com/djhi))
51+
* [Doc] Explain how to set up Jest for RA 5.13 ([#11036](https://github.com/marmelab/react-admin/pull/11036)) ([slax57](https://github.com/slax57))
52+
* [Doc] Fix data provider options in Create React Admin documentation ([#11032](https://github.com/marmelab/react-admin/pull/11032)) ([slax57](https://github.com/slax57))
53+
* [Doc] Update README to use React 18 createRoot API ([#11031](https://github.com/marmelab/react-admin/pull/11031)) ([hamed-zeidabadi](https://github.com/hamed-zeidabadi))
54+
* [Doc] Update RA Core EE documentation ([#11023](https://github.com/marmelab/react-admin/pull/11023)) ([jonathanarnault](https://github.com/jonathanarnault))
55+
* [Doc] Fix `<LockOnMount>` invalid example ([#11019](https://github.com/marmelab/react-admin/pull/11019)) ([djhi](https://github.com/djhi))
56+
* [Doc] Fix incorrect documentation of EditInDialogButton ([#10943](https://github.com/marmelab/react-admin/pull/10943)) ([Madeorsk](https://github.com/Madeorsk))
57+
* [TypeScript] Fix usage of `ReactElement` when it should be `ReactNode` ([#11030](https://github.com/marmelab/react-admin/pull/11030)) ([djhi](https://github.com/djhi))
58+
* [Demo] Update lists to allow sorting by reference ([#11021](https://github.com/marmelab/react-admin/pull/11021)) ([fzaninotto](https://github.com/fzaninotto))
59+
* [Storybook] Fix array input stories ([#11002](https://github.com/marmelab/react-admin/pull/11002)) ([djhi](https://github.com/djhi))
60+
* [chore] Update `ra-core` Test UI ([#11020](https://github.com/marmelab/react-admin/pull/11020)) ([djhi](https://github.com/djhi))
61+
* [Chore]: Update react-admin to use ReactNode instead of ReactElement where applicable ([#10996](https://github.com/marmelab/react-admin/pull/10996)) ([jonathanarnault](https://github.com/jonathanarnault))
62+
* Bump min-document from 2.19.0 to 2.19.1 ([#11029](https://github.com/marmelab/react-admin/pull/11029)) ([dependabot[bot]](https://github.com/apps/dependabot))
63+
* Bump vite from 6.3.6 to 6.4.1 ([#11026](https://github.com/marmelab/react-admin/pull/11026)) ([dependabot[bot]](https://github.com/apps/dependabot))
64+
* Bump astro from 5.13.7 to 5.14.3 ([#11025](https://github.com/marmelab/react-admin/pull/11025)) ([dependabot[bot]](https://github.com/apps/dependabot))
65+
66+
### React-hook-form version bump
67+
68+
This release bumps the minimum required version of `react-hook-form` to `7.65.0`.
69+
70+
### Jest configuration update
71+
72+
This release changed the way react-admin exports its modules to be fully compatible with ESM (PR [#10995](https://github.com/marmelab/react-admin/pull/10995)). This may require you to update your Jest configuration if you are using Jest in CJS mode (the default).
73+
74+
See https://marmelab.com/react-admin/UnitTesting.html#working-with-jest for more details.
75+
76+
### Webpack configuration update
77+
78+
If you use MUI v5 or MUI v6, you may need to update your Webpack config by adding the following rules:
79+
80+
```js
81+
{
82+
// Your config
83+
modules: {
84+
rules: [
85+
// Your other rules
86+
{
87+
test: /\.m?js/,
88+
type: "javascript/auto",
89+
},
90+
{
91+
test: /\.m?js/,
92+
resolve: {
93+
fullySpecified: false,
94+
},
95+
},
96+
]
97+
}
98+
}
99+
```
100+
101+
### Vite configuration update
102+
103+
If you use MUI v5, you may have to add the following alias:
104+
105+
```js
106+
export default defineConfig(({ mode }) => ({
107+
// Your config
108+
resolve: {
109+
// Your resolve config
110+
alias: [
111+
// Your other aliases
112+
{
113+
find: /^@mui\/icons-material\/(.*)/,
114+
replacement: "@mui/icons-material/esm/$1",
115+
},
116+
]
117+
}
118+
});
119+
```
120+
3121
## 5.12.3
4122

5123
* Fix optimistic query invalidation and avoid invalidating the same query twice ([#11017](https://github.com/marmelab/react-admin/pull/11017)) ([slax57](https://github.com/slax57))

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ build-create-react-admin:
112112
@echo "Transpiling create-react-admin files...";
113113
@cd ./packages/create-react-admin && yarn build
114114

115-
build: build-ra-core build-ra-data-fakerest build-ra-ui-materialui build-ra-data-json-server build-ra-data-local-forage build-ra-data-local-storage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-ra-i18n-i18next build-ra-i18n-polyglot build-react-admin build-ra-no-code build-create-react-admin ## compile ES6 files to JS
115+
update-package-exports: ## Update the package.json "exports" field for all packages
116+
@echo "Updating package exports..."
117+
@yarn tsx ./scripts/update-package-exports.ts
118+
119+
build: build-ra-core build-ra-data-fakerest build-ra-ui-materialui build-ra-data-json-server build-ra-data-local-forage build-ra-data-local-storage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-ra-i18n-i18next build-ra-i18n-polyglot build-react-admin build-ra-no-code build-create-react-admin update-package-exports ## compile ES6 files to JS
116120

117121
doc: ## compile doc as html and launch doc web server
118122
@yarn doc

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ yarn add react-admin
4747
```jsx
4848
// in app.js
4949
import * as React from "react";
50-
import ReactDOM from 'react-dom';
50+
import { createRoot } from 'react-dom/client';
5151
import { Admin, Resource } from 'react-admin';
5252
import restProvider from 'ra-data-simple-rest';
5353

5454
import { PostList, PostEdit, PostCreate, PostIcon } from './posts';
5555

56-
ReactDOM.createRoot(document.getElementById('root')!).render(
56+
createRoot(document.getElementById('root')!).render(
5757
<Admin dataProvider={restProvider('http://localhost:3000')}>
5858
<Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon} />
5959
</Admin>

cypress/e2e/edit.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('Edit Page', () => {
215215
);
216216
});
217217

218-
it('should intialize the form correctly when cloning from edit', () => {
218+
it('should initialize the form correctly when cloning from edit', () => {
219219
EditPostPage.navigate();
220220
cy.get(EditPostPage.elements.input('title')).should(el =>
221221
expect(el).to.have.value('Sed quo et et fugiat modi')

cypress/e2e/list.cy.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,37 @@ describe('List Page', () => {
170170
);
171171
});
172172

173+
it('should not create duplicate selections when checking page after individual selections', () => {
174+
cy.contains('1-10 of 13'); // wait for data
175+
cy.get('input[type="checkbox"]').eq(1).click();
176+
cy.get('input[type="checkbox"]').eq(2).click();
177+
cy.contains('2 items selected');
178+
ListPagePosts.toggleSelectAll();
179+
cy.contains('10 items selected');
180+
cy.get(ListPagePosts.elements.selectedItem).should(els =>
181+
expect(els).to.have.length(10)
182+
);
183+
});
184+
185+
it('should handle uncheck and recheck without duplicates', () => {
186+
cy.contains('1-10 of 13'); // wait for data
187+
cy.get('input[type="checkbox"]').eq(1).click();
188+
cy.get('input[type="checkbox"]').eq(2).click();
189+
cy.get('input[type="checkbox"]').eq(3).click();
190+
cy.contains('3 items selected');
191+
ListPagePosts.toggleSelectAll();
192+
cy.contains('10 items selected');
193+
ListPagePosts.toggleSelectAll();
194+
cy.get(ListPagePosts.elements.bulkActionsToolbar).should(
195+
'not.be.visible'
196+
);
197+
ListPagePosts.toggleSelectAll();
198+
cy.contains('10 items selected');
199+
cy.get(ListPagePosts.elements.selectedItem).should(els =>
200+
expect(els).to.have.length(10)
201+
);
202+
});
203+
173204
it('should allow to trigger a custom bulk action on selected items', () => {
174205
cy.contains('1-10 of 13'); // wait for data
175206
ListPagePosts.toggleSelectAll();

docs/Actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "Querying the API"
77

88
React-admin provides special hooks to emit read and write queries to the [`dataProvider`](./DataProviders.md), which in turn sends requests to your API. Under the hood, it uses [React Query](https://tanstack.com/query/v5/) to call the `dataProvider` and cache the results.
99

10-
<iframe src="https://www.youtube-nocookie.com/embed/c8tw2sUhKgc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;"></iframe>
10+
<iframe src="https://www.youtube-nocookie.com/embed/c8tw2sUhKgc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
1111

1212
## Getting The `dataProvider` Instance
1313

@@ -670,7 +670,7 @@ The following hooks accept a `mutationMode` option:
670670

671671
## Forcing A Partial Refresh
672672

673-
<iframe src="https://www.youtube-nocookie.com/embed/kMYA9E9Yhbc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;"></iframe>
673+
<iframe src="https://www.youtube-nocookie.com/embed/kMYA9E9Yhbc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
674674

675675
If you need to refresh part of the UI after a user action, you can use TanStack Query's [`invalidateQueries`](https://tanstack.com/query/latest/docs/framework/react/guides/query-invalidation) function. This function invalidates the cache for a specific query key, forcing a refetch of the data.
676676

docs/Admin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The `<Admin>` component is the root component of a react-admin app. It allows to
1010

1111
`<Admin>` creates a series of context providers to allow its children to access the app configuration. It renders the main routes and layout. It delegates the rendering of the content area to its `<Resource>` children.
1212

13-
<iframe src="https://www.youtube-nocookie.com/embed/StCR3gB7nKU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;"></iframe>
13+
<iframe src="https://www.youtube-nocookie.com/embed/StCR3gB7nKU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
1414

1515
## Usage
1616

docs/ArrayInput.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ storybook_path: ra-ui-materialui-input-arrayinput--basic
88

99
To edit arrays of data embedded inside a record, `<ArrayInput>` creates a list of sub-forms.
1010

11-
<iframe src="https://www.youtube-nocookie.com/embed/-8OFsP7CiVc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;"></iframe>
11+
<iframe src="https://www.youtube-nocookie.com/embed/-8OFsP7CiVc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
1212

1313
## Usage
1414

docs/Community.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ On our [Youtube channel](https://www.youtube.com/@react-admin), you can find som
4545

4646
<div class="iframe-wrapper">
4747
<iframe
48-
src="https://www.youtube.com/embed/videoseries?si=-m56_m4W9dEcJjw5&amp;list=PLBCskKfEEuGvgjdpfvH4ZAIGx4UJAUNwP">
48+
src="https://www.youtube.com/embed/videoseries?si=-m56_m4W9dEcJjw5&amp;list=PLBCskKfEEuGvgjdpfvH4ZAIGx4UJAUNwP"
49+
referrerpolicy="strict-origin-when-cross-origin">
4950
</iframe>
5051
</div>
5152

0 commit comments

Comments
 (0)