Skip to content

Commit

Permalink
Merge branch 'marmelab:master' into feature/login-avatar-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarosch committed Jun 29, 2024
2 parents 7755320 + ff8d315 commit cbb73f2
Show file tree
Hide file tree
Showing 215 changed files with 7,651 additions and 4,633 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# These are supported funding model platforms

github: marmelab
open_collective: react-admin

51 changes: 32 additions & 19 deletions .storybook/main.js → .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
const fs = require('fs');
const path = require('path');
import { StorybookConfig } from '@storybook/react-webpack5';
import fs from 'fs';
import path, { dirname, join } from 'path';

const packages = fs.readdirSync(path.resolve(__dirname, '../packages'));
module.exports = {
stories: [`../packages/${process.env.ONLY || '**'}/**/*.stories.@(tsx)`],

const config: StorybookConfig = {
stories: [
path.resolve(
__dirname,
`../packages/${process.env.ONLY || '**'}/**/*.stories.@(tsx)`
),
],
addons: [
{
name: '@storybook/addon-storysource',
options: {
loaderOptions: {
injectStoryParameters: false,
parser: 'typescript',
},
},
},
'@storybook/addon-webpack5-compiler-babel',
'@storybook/addon-actions',
'@storybook/addon-controls',
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'none',
reactDocgen: false,
},
babel: async options => {
const { plugins = [] } = options;
Expand Down Expand Up @@ -54,6 +53,16 @@ module.exports = {
};
},
webpackFinal: async (config, { configType }) => {
config.module?.rules?.push({
test: /\.stories\.tsx?$/,
use: [
{
loader: require.resolve('@storybook/source-loader'),
options: { parser: 'typescript' },
},
],
enforce: 'pre',
});
return {
...config,
resolve: {
Expand All @@ -72,10 +81,14 @@ module.exports = {
};
},
framework: {
name: '@storybook/react-webpack5',
name: getAbsolutePath('@storybook/react-webpack5'),
options: {},
},
docs: {
autodocs: false,
},
docs: {},
};

export default config;

function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
139 changes: 139 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,132 @@
# Changelog

## v5.0.2

* Fix `useUpdate` throws an error when record id is a valid falsy value such as zero ([#9957](https://github.com/marmelab/react-admin/pull/9957)) ([djhi](https://github.com/djhi))
* Fix `<DatagridHeader>` Tooltip when using React element as a field label ([#9948](https://github.com/marmelab/react-admin/pull/9948)) ([djhi](https://github.com/djhi))
* Fix Inputs used outside `<Form>` need a `SourceContext` ([#9944](https://github.com/marmelab/react-admin/pull/9944)) ([adguernier](https://github.com/adguernier))
* Backport Changes from 4.x branch ([#9949](https://github.com/marmelab/react-admin/pull/9949)) ([djhi](https://github.com/djhi))
* [Doc] Fix basename usage in routing chapter ([#9956](https://github.com/marmelab/react-admin/pull/9956)) ([djhi](https://github.com/djhi))
* [Doc] Update tutorial for v5 ([#9945](https://github.com/marmelab/react-admin/pull/9945)) ([djhi](https://github.com/djhi))
* [Doc] Explain that `<Form sanitizeEmptyValues>` does not work on nested fields ([#9950](https://github.com/marmelab/react-admin/pull/9950)) ([djhi](https://github.com/djhi))
* [Dev] Fix flaky tests ([#9952](https://github.com/marmelab/react-admin/pull/9952)) ([djhi](https://github.com/djhi))

## v5.0.1

* Fix useFormGroup does not update when its group changes ([#9940](https://github.com/marmelab/react-admin/pull/9940)) ([djhi](https://github.com/djhi))
* Fix useFormGroup does not reflect its fields state ([#9939](https://github.com/marmelab/react-admin/pull/9939)) ([djhi](https://github.com/djhi))
* Bump ws from 8.13.0 to 8.17.1 ([#9938](https://github.com/marmelab/react-admin/pull/9938)) ([dependabot[bot]](https://github.com/apps/dependabot))
* Bump braces from 3.0.2 to 3.0.3 ([#9937](https://github.com/marmelab/react-admin/pull/9937)) ([dependabot[bot]](https://github.com/apps/dependabot))
* Bump vite from 5.0.11 to 5.0.13 ([#9936](https://github.com/marmelab/react-admin/pull/9936)) ([dependabot[bot]](https://github.com/apps/dependabot))
* Bump follow-redirects from 1.15.4 to 1.15.6 ([#9725](https://github.com/marmelab/react-admin/pull/9725)) ([dependabot[bot]](https://github.com/apps/dependabot))

## v5.0.0

This major release introduces new features and some breaking changes. Here are the highlights:

### UI Improvements

- Apps now have a theme switcher and a dark theme by default ([#9479](https://github.com/marmelab/react-admin/pull/9479))
- Inputs now default to full width ([#9704](https://github.com/marmelab/react-admin/pull/9704))
- Links are now underlined ([#9483](https://github.com/marmelab/react-admin/pull/9483))
- List pages restore scroll position when coming back from Edit and Create views ([#9774](https://github.com/marmelab/react-admin/pull/9774))
- Errors in the Layout code now trigger the Error Boundary ([#9799](https://github.com/marmelab/react-admin/pull/9799))
- Button size can be set via props ([#9735](https://github.com/marmelab/react-admin/pull/9735))

### App Initialization

- Simpler custom layout components just need to render their children ([#9591](https://github.com/marmelab/react-admin/pull/9591))
- No more props drilling for Layout, AppBar, Menu, etc ([#9591](https://github.com/marmelab/react-admin/pull/9591))
- useDefaultTitle() hook returns the application title from anywhere in the app ([#9591](https://github.com/marmelab/react-admin/pull/9591))

### Data Providers

- Data providers can now cancel queries for unmounted components (opt-in) ([#9612](https://github.com/marmelab/react-admin/pull/9612))
- GraphQL data providers are easier to initialize (they are now synchronous) ([#9820](https://github.com/marmelab/react-admin/pull/9820))
- GraphQL-Simple data provider supports Sparse Fields in queries ([#9392](https://github.com/marmelab/react-admin/pull/9392))
- GraphQL-Simple data provider supports updateMany and deleteMany mutations ([#9393](https://github.com/marmelab/react-admin/pull/9393))
- withLifecycleCallbacks now supports for wildcard and array of callbacks ([#9577](https://github.com/marmelab/react-admin/pull/9577))
- Middlewares are more powerful and handle errors better ([#9875](https://github.com/marmelab/react-admin/pull/9875))

### List pages

- Datagrid has rowClick enabled by default, it links to the edit or show view depending on the resource definition ([#9466](https://github.com/marmelab/react-admin/pull/9466))
- List bulkActionButtons is now a Datagrid prop ([#9707](https://github.com/marmelab/react-admin/pull/9707))
- setFilters doesn't debounce by default, so custom filters work as expected ([#9682](https://github.com/marmelab/react-admin/pull/9682))
- List parameters persistence in the store can be disabled ([#9742](https://github.com/marmelab/react-admin/pull/9742))

### Forms & Inputs

- Inputs no longer require to be touched to display a validation error ([#9781](https://github.com/marmelab/react-admin/pull/9781))
- ReferenceInputs are now smarter by default as they use the recordRepresentation ([#9902](https://github.com/marmelab/react-admin/pull/9902))
- Server-Side validation is now more robust ([#9848](https://github.com/marmelab/react-admin/pull/9848))
- warnWhenUnsavedChanges works again ([#9657](https://github.com/marmelab/react-admin/pull/9657))
- Smart input components like TranslatableInputs, ArrayInput, or ReferenceManyInput now compose more seamlessly thanks to a new SourceContext. There is no need for getSource in FormDataConsumer. ([#9533](https://github.com/marmelab/react-admin/pull/9533))
- All inputs now have a unique ID - no more duplicate ID warnings ([#9788](https://github.com/marmelab/react-admin/pull/9788))
- Learning Forms is facilitated by a new Form chapter in the doc ([#9864](https://github.com/marmelab/react-admin/pull/9864))

### DX Improvements

- The default Record Representation for resources is now smarter ([#9650](https://github.com/marmelab/react-admin/pull/9650))
- Data provider hooks like useGetOne have a smart return type based on the request state. This will force you to plan for the error case. ([#9743](https://github.com/marmelab/react-admin/pull/9743))
- Stricter TypeScript types will detect more errors at compile time ([#9741](https://github.com/marmelab/react-admin/pull/9741))
- PropTypes are gone, so there is no conflict with TypeScript types ([#9851](https://github.com/marmelab/react-admin/pull/9851))
- create-react-admin can run in non-interactive mode ([#9544](https://github.com/marmelab/react-admin/pull/9544))
- ra-data-fakerest accepts a delay parameter to simulate network delays ([#9908](https://github.com/marmelab/react-admin/pull/9908))
- data-generator-retail now exposes types for the generated data ([#9764](https://github.com/marmelab/react-admin/pull/9764))

### Bump dependencies

- React-admin requires React 18 to leverage Concurrent React ([#9827](https://github.com/marmelab/react-admin/pull/9827))
- React-admin uses the latest version of react-router, react-query, date-fns, fakerest, etc. ([#9657](https://github.com/marmelab/react-admin/pull/9657), [#9473](https://github.com/marmelab/react-admin/pull/9473), [#9812](https://github.com/marmelab/react-admin/pull/9812), [#9801](https://github.com/marmelab/react-admin/pull/9801), [#9908](https://github.com/marmelab/react-admin/pull/9908))
- Internet Explorer is no longer supported ([#9530](https://github.com/marmelab/react-admin/pull/9530))

### Upgrading to v5

We've written a [migration guide](https://marmelab.com/react-admin/doc/5.0/Upgrade.html) to help you upgrade your apps to v5. It covers all the breaking changes and how to adapt your code to the new APIs.

We estimate that a react-admin app with 50,000 lines of code will require about 2 days of work to upgrade to v5.

### Changelog
* Fix useFormGroup does not update when its group changes ([#9940](https://github.com/marmelab/react-admin/pull/9940)) ([djhi](https://github.com/djhi))
* Fix useFormGroup does not reflect its fields state ([#9939](https://github.com/marmelab/react-admin/pull/9939)) ([djhi](https://github.com/djhi))
* Bump ws from 8.13.0 to 8.17.1 ([#9938](https://github.com/marmelab/react-admin/pull/9938)) ([dependabot[bot]](https://github.com/apps/dependabot))
* Bump braces from 3.0.2 to 3.0.3 ([#9937](https://github.com/marmelab/react-admin/pull/9937)) ([dependabot[bot]](https://github.com/apps/dependabot))
* Bump vite from 5.0.11 to 5.0.13 ([#9936](https://github.com/marmelab/react-admin/pull/9936)) ([dependabot[bot]](https://github.com/apps/dependabot))
* Bump follow-redirects from 1.15.4 to 1.15.6 ([#9725](https://github.com/marmelab/react-admin/pull/9725)) ([dependabot[bot]](https://github.com/apps/dependabot))


For a detailed changelog, see the release notes for the following pre-releases:

- [v5.0.0-rc.1](#v500-rc1)
- [v5.0.0-rc.0](#v500-rc0)
- [v5.0.0-beta.3](#v500-beta3)
- [v5.0.0-beta.2](#v500-beta2)
- [v5.0.0-beta.1](#v500-beta1)
- [v5.0.0-beta.0](#v500-beta0)
- [v5.0.0-alpha.1](#v500-alpha1)
- [v5.0.0-alpha.0](#v500-alpha0)

## v5.0.0-rc.1

- Fix `create-react-admin` ([#9926](https://github.com/marmelab/react-admin/pull/9926)) ([djhi](https://github.com/djhi))

## v5.0.0-rc.0

* Ensure React 19 compatibility ([#9919](https://github.com/marmelab/react-admin/pull/9919)) ([djhi](https://github.com/djhi))
* Fix data provider queries are doubled in development when using strict mode ([#9901](https://github.com/marmelab/react-admin/pull/9901)) ([djhi](https://github.com/djhi))
* Fix default `<Error>` background in global `ErrorBoundary` ([#9913](https://github.com/marmelab/react-admin/pull/9913)) ([fzaninotto](https://github.com/fzaninotto))
* Fix `combineDataProvider` throws a runtime error ([#9910](https://github.com/marmelab/react-admin/pull/9910)) ([fzaninotto](https://github.com/fzaninotto))
* Fix `<List>` should not render `<Error>` component on fetch error ([#9912](https://github.com/marmelab/react-admin/pull/9912)) ([fzaninotto](https://github.com/fzaninotto))
* Fix `useDelete` doesn't delete record if its `id` is zero ([#9894](https://github.com/marmelab/react-admin/pull/9894)) ([adguernier](https://github.com/adguernier))
* Update `<ArrayInput>` to use `SourceContext` instead of cloning children ([#9911](https://github.com/marmelab/react-admin/pull/9911)) ([adguernier](https://github.com/adguernier))
* Update `<SelectArrayInput>` to use default record representation when used inside `<ReferenceArrayInput>` ([#9902](https://github.com/marmelab/react-admin/pull/9902)) ([djhi](https://github.com/djhi))
* Upgrade FakeRest to 4.0 ([#9908](https://github.com/marmelab/react-admin/pull/9908)) ([fzaninotto](https://github.com/fzaninotto))
* [TypeScript] Fix types of Field components ([#9903](https://github.com/marmelab/react-admin/pull/9903)) ([slax57](https://github.com/slax57))
* [Dev] Fix `useRegisterMutationMiddleware` stories ([#9899](https://github.com/marmelab/react-admin/pull/9899)) ([djhi](https://github.com/djhi))
* [Dev] Deduplicate `yarn`.lock ([#9897](https://github.com/marmelab/react-admin/pull/9897)) ([fzaninotto](https://github.com/fzaninotto))
* Backport changes from master ([#9923](https://github.com/marmelab/react-admin/pull/9923)) ([slax57](https://github.com/slax57))

## v5.0.0-beta.3

* Fix React requirement is too strict on npm ([#9879](https://github.com/marmelab/react-admin/pull/9879)) ([fzaninotto](https://github.com/fzaninotto))
Expand Down Expand Up @@ -79,6 +206,18 @@
* [TypeScript] Make types more strict in ra-core, part II ([#9743](https://github.com/marmelab/react-admin/pull/9743)) ([fzaninotto](https://github.com/fzaninotto))
* [TypeScript] Make types more strict in ra-core ([#9741](https://github.com/marmelab/react-admin/pull/9741)) ([fzaninotto](https://github.com/fzaninotto))

## v4.16.19

* Fix `<ArrayInput>` ghost error after removing scalar item ([#9918](https://github.com/marmelab/react-admin/pull/9918)) ([djhi](https://github.com/djhi))
* Fix filters with complex object are not removed from the UI ([#9898](https://github.com/marmelab/react-admin/pull/9898)) ([hmatthieu](https://github.com/hmatthieu))
* Fix `<SelectInput resettable>` does not reset the value ([#9895](https://github.com/marmelab/react-admin/pull/9895)) ([fzaninotto](https://github.com/fzaninotto))
* [Doc] Clarify `<SaveButton transform>` usage ([#9915](https://github.com/marmelab/react-admin/pull/9915)) ([slax57](https://github.com/slax57))
* [Doc] Add link to Codesandbox for the simple demo ([#9900](https://github.com/marmelab/react-admin/pull/9900)) ([adguernier](https://github.com/adguernier))
* [Doc] Added Genezio as a data provider ([#9890](https://github.com/marmelab/react-admin/pull/9890)) ([bogdanripa](https://github.com/bogdanripa))
* [Doc] Fix typo in TreeWithDetails props list ([#9884](https://github.com/marmelab/react-admin/pull/9884)) ([wfouche](https://github.com/wfouche))
* [Doc] Fix NextJS API routing snippet ([#9883](https://github.com/marmelab/react-admin/pull/9883)) ([PaulieScanlon](https://github.com/PaulieScanlon))
* [Doc] Update ra-tree documentation ([#9862](https://github.com/marmelab/react-admin/pull/9862)) ([erwanMarmelab](https://github.com/erwanMarmelab))

## v4.16.18

* Fix `<Datagrid>` uses wrong element for "Select All" label ([#9826](https://github.com/marmelab/react-admin/pull/9826)) ([fzaninotto](https://github.com/fzaninotto))
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ build-create-react-admin:
@echo "Transpiling create-react-admin files...";
@cd ./packages/create-react-admin && yarn build

build: build-ra-core build-ra-ui-materialui build-ra-data-fakerest build-ra-data-json-server build-ra-data-localforage build-ra-data-localstorage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-i18n-polyglot build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-ra-i18n-i18next build-react-admin build-ra-no-code build-create-react-admin ## compile ES6 files to JS
build: build-ra-core build-ra-data-fakerest build-ra-ui-materialui build-ra-data-json-server build-ra-data-localforage build-ra-data-localstorage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-i18n-polyglot build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-ra-i18n-i18next build-react-admin build-ra-no-code build-create-react-admin ## compile ES6 files to JS

doc: ## compile doc as html and launch doc web server
@yarn doc
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/mobile.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Mobile UI', () => {
it('should load more items when scrolling to the bottom of the page', () => {
ListPagePosts.navigate();
cy.contains('Sint dignissimos in architecto aut');
cy.contains('Fusce massa lorem').should('exist');
cy.contains('Sed quo et et fugiat modi').should('not.exist');
cy.wait(500);
cy.contains('Sint dignissimos in architecto aut').scrollIntoView();
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export default url => ({
},

login(username = 'login', password = 'password') {
cy.get(this.elements.username).type(username);
cy.get(this.elements.password).type(password);
cy.get(this.elements.username).clear().type(username);
cy.get(this.elements.password).clear().type(password);
cy.get(this.elements.submitButton).click();
},
});
Loading

0 comments on commit cbb73f2

Please sign in to comment.