Closed fzaninotto closed 4 months ago
I am aligned with the changes and what is out of scope. Useful parts for us :
Thanks for your very nice work !
there are a few tickets that mentioned implementing them in v5. one of them is moving title to context. that would be a good change. https://github.com/marmelab/react-admin/issues/8872
Change how setFilters
work to make it more convenient to use:
setFilters
into setFilters
and setDisplayedFilters
- most of the time, I either need to update filters or update displayed filters, but not both(current_values)=>current_values
(similar to setState
):
setFilter
statements without worry of using outdated filters inside useEffect.setState
when we want to increment current value by one twice: Instead of running setState(n+1); setState(n+1)
, we need to run setState((v)=v+1); setState((v)=v+1);
I know that this example is over-simplified and no-one would write something like that; however I've been throw situations where calling setFilters
(and setState
) suffered concurrency issues. setFilter(filter_name, value | (value)=>newValue )
and clearFilter(filter_name)
functions to control individual filters.The reference to the filterValues object is not updated when it changes, so we must stringify it to compare it by value and also compare the reference.
)Remove cloneElement in inputs by introducing an input name prefix context
. maybe an example?Make all input width 100% by default (to make this page nicer)
do you really want to have this huge stylistic breaking change as an implementation rather than documenting how to change theme/use grids to achieve it? i feel this will be the most annoying change for us (developers).
- could you please elaborate more on this one
Remove cloneElement in inputs by introducing an input name prefix context
. maybe an example?
As far as I can remember cloneElement
is used to augment the path of nested form controls e.g. inside ReferenceManyInput
to have a unique location for the purpose of react-hook-forms useController
. One thing that cost me hours was the inability to nest layout elements inside certain components as they would expect the direct children to be the input/field components. This would be fixed with this change right?
Does the rework of the stricter Typescript types include generics for input components? Those would save a lot of issues and if registered Resources could be types, this help a lot during development
Evaluate migration to future.v7_relativeSplatPath
flag that react-router team implemented to address breaking change that they made in 6.19.0.
https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md#6210
As far as I can remember
cloneElement
is used to augment the path of nested form controls e.g. insideReferenceManyInput
to have a unique location for the purpose of react-hook-formsuseController
. One thing that cost me hours was the inability to nest layout elements inside certain components as they would expect the direct children to be the input/field components. This would be fixed with this change right?
Yes, that's the plan. Some high level components might still inspect children though, Datagrid for instance.
Does the rework of the stricter Typescript types include generics for input components? Those would save a lot of issues and if registered Resources could be types, this help a lot during development
Yes, we have plans for this. Not necessarily in v5.0 though
Consider switching to https://github.com/TanStack/router?
Consider switching to https://github.com/TanStack/router?
Why would we want to do that? What problems does react-router have that tanstack router would solve?
This blog post explains all the advantages
https://swizec.com/blog/tanstack-router-modern-react-for-the-rest-of-us/
@milutinovici I don't understand the pain points that TanStack router would solve in react-admin apps.
Hey! Material UI has announced its v6 release for 2024 focusing on a new style engine: https://github.com/mui/material-ui/issues/38137
The timeline (kind of) aligns with React-admin's v5, and I thought you might be interested, especially given there won't be any other major version until 2026.
Let us know! 😊
They announce v6 for Q2 2024... Which is late for us. It could mean up to 7 months without a new minor release for react-admin, which is too much. Besides, we'll need to wait until the dust settles e bit before using it, so I don't see our development on the new MUI starting before fall 24.
IMO, their schedule isn't compatible with ours, and react-admin v5 won't use MUI v6.
Make all input width 100% by default (to make this page nicer)
Finally!
I suggest we also update the documentation website to show the documentation for a specific branch (e.g. next as unreleased) in the dropdown selection before v5 is officially released. After v5 release we can then decide whether to remove that item from the dropdown list.
I propose we can do something like ESLint documentation in https://github.com/eslint/eslint/pull/18139
This feature request may be a breaking change for the current ci pipeline, but it will be particularly helpful for early adopters to try and give feedbacks without the need to build and serve the documentation locally. During the upgrade cycle from v3 to v4 we don't have such thing for a better developer experience and a smoother migration.
Hi @fzaninotto any plans on updating the docs on the https://marmelab.com/react-admin/documentation.html for v5 alpha?
@smeng9 No, we don't have such plans. The docs on the react-admin website will only be updated when we release v5 stable. In the meantime, you can browse the V5 docs at https://github.com/marmelab/react-admin/tree/next/docs.
Hello thank you for all your hard and amazing work
I see that you're planning on updating dependencies to their last major does that include date-fns
? I can work on a PR.
@MohammedFaragallah yes, good idea! PR welcome.
On the issue of dynamic title #5893 If I understand correctly, the goal is to automatically update the document title from the title in TitlePortal. The PR that implemented this behaviour #6119 was reverted in #6357 because of an hidden breaking changes. So may be the v5 is the right time to re-introduce this patch/PR?
@fzaninotto what do you think about updating these packages
@MohammedFaragallah I'm all for it, please feel free to open one PR per dependency
On the issue of dynamic title #5893 If I understand correctly, the goal is to automatically update the document title from the title in TitlePortal. The PR that implemented this behaviour #6119 was reverted in #6357 because of an hidden breaking changes. So may be the v5 is the right time to re-introduce this patch/PR?
Yes, it's a good time. Would you like to try and solve the issue?
@tauqeer-trailfive Do you know when it is supposed to be released?
We hope to release react-admin v5 not too far in the future (ideally in a month from now). I doubt React 19 will be up at that time.
Also, which react 19 features do you think would benefit to react-admin ?
what do you think about adding generics to infer the returned props types from sanitize rest functions?
something like this
const sanitizeRestProps = <T extends Record<string, unknown>>({
record,
resource,
initialValues,
translate,
...rest
}: T) => rest;
rest
here is typed Omit<T, "record" | "resource" | "initialValues" | "translate">
which is far more useful than the previous any
I can work on a PR
what do you think about adding generics to infer the returned props types from sanitize rest functions?
I don't see the interest for the end user, and I don't see it as a breaking change. We do a v5 especially for breaking changes. So while your suggestion might bring some improvements to the core team, it won't be a priority.
I don't see the interest for the end user, and I don't see it as a breaking change.
I disagree i just noticed this while writing a custom input and I thought my experience would have been better if I had the returned props types and also if the sanitizers were exported instead of having to copy-paste them and keep them in sync
I understand if this is not a priority RN though 🤝
When can we expect 5.0.0-beta.1 release?
When can we expect 5.0.0-beta.1 release?
Today! https://github.com/marmelab/react-admin/releases/tag/v5.0.0-beta.1
@fzaninotto I noticed that RA v5 still shows a few TS errors when strict: true
, it only works with strict: false
and strictNullChecks: true
. Is it possible to go full strict
mode before final v5 release? Looks like you're extremely close to achieving that.
@fzaninotto I noticed that RA v5 still shows a few TS errors when
strict: true
, it only works withstrict: false
andstrictNullChecks: true
. Is it possible to go fullstrict
mode before final v5 release? Looks like you're extremely close to achieving that.
This is not in our target for v5. However, if you want to submit a PR and it's small enough to be merged quickly, we'll take a look at it.
5.0.0-beta.2 is out: https://github.com/marmelab/react-admin/releases/tag/v5.0.0-beta.2
5.0.0-beta.3 is out: https://github.com/marmelab/react-admin/releases/tag/v5.0.0-beta.3
5.0.0-rc.0 is out: https://github.com/marmelab/react-admin/releases/tag/v5.0.0-rc.0
This version will likely become 5.0 stable this Thursday, unless we receive some regression reports.
I tried V5.0.0-rc.0:
node: v20.12.2 macOSX 14.5
How can I resolve this?
❯ npm init react-admin@next my-project Need to install the following packages: create-react-admin@5.0.0-rc.0 Ok to proceed? (y) Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem. Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
ERROR Cannot read properties of null (reading 'useReducer')
/Users/username/.npm/_npx/f03da9ea442c06c6/node_modules/create-react-admin/node_modules/react/cjs/react.development .js:1626:21
1623: } 1624: function useReducer(reducer, initialArg, init) { 1625: var dispatcher = resolveDispatcher(); 1626: return dispatcher.useReducer(reducer, initialArg, init); 1627: } 1628: function useRef(initialValue) { 1629: var dispatcher = resolveDispatcher();
@kztmk reproduced, thanks. We'll soon release a fix.
v5.0.0-rc.1 is out. It fixes create-react-admin
.
https://github.com/marmelab/react-admin/releases/tag/v5.0.0-rc.1
There is still a problem if you choose FakeRest as your data provider because of a typo in a dependency list, fixed in 795cd74f628071a4200eea79bb856b5654e2653d but not part of rc.1.
React-admin v5 is out! https://github.com/marmelab/react-admin/releases/tag/v5.0.0
Rationale
It's been a year and a half since version 4.0. The React ecosystem has evolved a lot since then, and we must accept a few breaking changes in the react-admin codebase to keep up-to-date. So we're starting the work on the next major version, react-admin v5.
The main constraint of this version is to be a painless migration from v4. The 3.0 to 4.0 migration was costly for many developers, we don't want to reiterate that. The migration should take at most a day on a moderate size admin app.
Breaking Changes
Admin
andLayout
components (layout
,appBar
,menu
,error
,catchAll
) (#9591)defaultProps
with default params values (#9586)<Admin history>
prop and use react-router's Data Router (#9657)cloneElement
that we can replace with context9533
9707
9719
9805
9473
9657
9763
9924
9801
9804
9811
9819
9818
9822
9823
9874
9908
#9812(reverted in #9871 because it causes compilation problems)9644
9741
9743
9760
9761
9790
9795
9797
See the progress in the following milestones:
Out Of Scope
Roadmap
We intend to release version 5 in early 2024.
There won't be any other major version until 2026, so we must include in v5 all the breaking changes that are necessary to last until then.
Version 5 is now the primary focus of the core team, so there won't be any new minor until we release v5. V4.16 is the last minor release in the 4.x branch. Every new feature will be added to the
next
branch, which will become react-admin v5.https://github.com/github/release-radar
We need your feedback
Are there other breaking changes that you think should make it to v5? Please give us your feedback by commenting on this issue.
Note: Please don't comment with feature requests that don't imply any breaking change. For those, simply open a new issue.