Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Jul 10, 2024
1 parent 213badd commit b15efb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.0.0

* Compatibility with react-admin v5

## 3.4.5

* Fix validation errors shown as "Server communication error" when creating an entity
Expand Down
25 changes: 4 additions & 21 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
# Upgrade to 3.0
# Upgrade to 4.0

First of all, read the [UPGRADE guide from react-admin](https://marmelab.com/react-admin/doc/4.0/Upgrade.html).
API Platform Admin 4.0 has the same API as API Platform admin 3.4, but now requires react-admin v5.

Since API Platform Admin is built on top of react-admin, almost everything in the react-admin upgrade guide applies to API Platform Admin as well.
If your application only uses components from the '@api-platform/admin' package, it should work out of the box with API Platform Admin 4.0.

This UPGRADE guide will only cover the specific changes for API Platform Admin.

## Authentication Support

Since the way to define custom routes has completely changed in react-admin, the way to add authentication support in API Platform Admin has also been modified.

In short, you need to use the `<CustomRoutes>` component inside the `<HydraAdmin>` or `<AdminGuesser>` component, with a redirect condition on its child.
The condition is taken from a state variable, and the state updater function is given to the data provider and will be used when there is an unauthorized error.

To see the full updated example, please [go to the related documentation page](https://api-platform.com/docs/main/admin/authentication-support/).

## Mercure Support

Since react-admin does not use Redux anymore, it's also the case for Mercure in API Platform Admin.

Instead it uses react-query cache to update the received changes in real time.

You will not see the Redux data action when a resource is updated by Mercure anymore.
If you have done some customization based on the 'react-admin' package, you will probably have to make some changes. Read the [UPGRADE guide from react-admin](https://marmelab.com/react-admin/doc/5.0/Upgrade.html) for further details.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api-platform/admin",
"version": "3.4.8",
"version": "4.0.0",
"description": "Automatic administration interface for Hydra-enabled APIs.",
"files": [
"*.md",
Expand Down

0 comments on commit b15efb6

Please sign in to comment.