Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0 Roadmap #5933

Closed
fzaninotto opened this issue Feb 17, 2021 · 128 comments
Closed

4.0 Roadmap #5933

fzaninotto opened this issue Feb 17, 2021 · 128 comments

Comments

@fzaninotto
Copy link
Member

fzaninotto commented Feb 17, 2021

We're starting to think about the next major milestone for react-admin. It'll mostly be a cleanup release, removing all the deprecated features and the compatibility layers we put in place. It should also be the occasion to use the latest major version of our dependencies.

Breaking Changes

These items didn't make it into the release:

We won't break BC for another year or two after 4.0, so we'd better wait to incorporate the new major releases of our dependencies. This causes the following releases to be blockers:

Timeline

Work on v4 started in September 2021, and is expected to end in early 2022.

Note: Please don't post comments with feature requests that don't need a breaking change here. React-admin releases new features on a monthly basis, and doesn't need a major release for that. This discussion is only for backwards-incompatible changes.

@smeng9
Copy link
Contributor

smeng9 commented Feb 18, 2021

Hi I have a question, what drives the decision to replace redux-form to react-final-form during v2->v3 and then switch to formik from v3->v4? License? Render speed?

I know the main interface of form components won't change much, but some of the attributes of the components may get changed.

@smeng9
Copy link
Contributor

smeng9 commented Feb 18, 2021

You also mentioned removing redux-saga. Currently there are still a lot of parts related to the saga in the codebase, including handling of authentications and data fetchings.

Is the alternative going to be using react contexts? That is probably the only method to replace saga. Thanks!

@smeng9
Copy link
Contributor

smeng9 commented Feb 18, 2021

In terms of this major release, will ra-enterprise version also receive new versions in parallel? I am pretty interested in the paid version so I have so many questions to discuss here.

@fzaninotto
Copy link
Member Author

Hi I have a question, what drives the decision to replace redux-form to react-final-form during v2->v3 and then switch to formik from v3->v4? License? Render speed?

The same reason: library maintenance. redux-form isn't maintained anymore, and react-final-form is taking the same path. some bugs in react-admin can't be fixed because they are caused by bugs in final-form that don't get fixed.

On the other hand, formik is actively maintained and has a positive contribution curve.

Finally, react-final-form has 6k stars on GitHub, while Formik has 26k stars. When we made the choice to go with final-form, they were at the same level.

Currently there are still a lot of parts related to the saga in the codebase, including handling of authentications and data fetchings.

No, 100% of the side effects are handled by pure React side effects and contexts in the curent codebase. The sagas are just here for backwards compatibility.

will ra-enterprise version also receive new versions in parallel?

We'll make re-enterprise modules compatible with 4.0 as soon as it's released. If this can be done without breaking change, then this will be a minor release, otherwise it'll be a major release.

@Luwangel Luwangel pinned this issue Feb 23, 2021
@huijiewei
Copy link

huijiewei commented Feb 27, 2021

react-hook-form

Suggest

@djhi
Copy link
Collaborator

djhi commented Mar 1, 2021

It would probably be nice to introduce hooks to trigger side effects which could update the store. It would help implementing custom data providers methods which may have to update the data, delete it, etc.

For example see #5959. With a useDeleteFromStore or similar, it would be trivial to implement

@m4theushw
Copy link
Contributor

The <AutocompleteInput /> could be rewritten to use the <Autocomplete /> from Material-UI. In V5 it will not be in beta anymore.

@wmwart
Copy link

wmwart commented Mar 4, 2021

Extend the permissions action to more components. In particular, the <Fields> and <Inputs> components.
A fairly common task is to restrict user fields based on access.
Now, each of my <Fields> and <Inputs> components is wrapped in an accessor function. This makes the components <List>, <Show>, <Edit> and others very cumbersome.
It would be nice if as many components as possible support the access property.
Or, for example, for example, to be able to specify access in the style of validation of both the form and individual fields.

@capJavert
Copy link

Replace react-final-form with formik

Did you think about integrating https://github.com/react-hook-form/react-hook-form instead of formik? react-final-form and formik are crazy slow and unoptimized when working with semi large and large forms (10+ inputs or array input).

react-hook-form is really fast with hundreds of inputs and also isolates rerenders based on the state chunks that changed. Main difference is uncontrolled approach but that can be solved with https://react-hook-form.com/advanced-usage#ControlledmixedwithUncontrolledComponents.

Aside from that APIs are similar (we recently replaced formik with react-hook-form in one of our projects with no issues).

People are already moving from formik based on the reasons above so maybe think about jumping to react-hook-form?

@ValentinnDimitroff
Copy link
Contributor

It is not a huge difference but I was wondering why do you depend on classnames when material-ui (and probably some others) already depend on clsx ?

Passed my mind when thought about reducing dependencies list.

@fzaninotto
Copy link
Member Author

@ValentinnDimitroff No idea when they migrated to clsx. When we started using material-ui, they were using classnames.

I guess we focus more on backwards compatibility and they prefer to move fast and break things ;)

@andrico1234
Copy link
Contributor

andrico1234 commented Mar 8, 2021

You mention that you plan on removing redux-saga and saga-based side effects. While I don't pass through any customSagas to the Admin component yet, I am looking at ways to dispatch notification actions from whenever a specific event occurs. For instances like this useNotify isn't a viable option.

Is there a migration strategy for those that are using customSagas in such a way, or will the customSagas property still be supported?

@fzaninotto
Copy link
Member Author

I am looking at ways to dispatch notification actions whenever a specific event occurs

Do like we do in the react-admin codebase: combine useNotify and useEffect.

@henrik-d
Copy link

Remove redux-saga and saga-based side effects

May I ask what lead to the decision to remove redux-saga? What was it used for and how is it replaced now?

@fzaninotto
Copy link
Member Author

It was used for side effects, and we now use useSideEffect for that. Besides, when we first built react-admin, Redux was the cornerstone of the state and change management. Today, Redux isn't so central, and some newer parts of the framework simply don't rely on it at all (e.g. authentication).

As an example, the react-admin demo doesn't use saga at all.

@fzaninotto
Copy link
Member Author

@sidescraper please don't post feature requests here. We're adding new features in minor versions. 4.0 will probably add no new feature, but just change the underlying layers that have become a problem. It's all about breaking backwards compatibility.

@rassie
Copy link
Contributor

rassie commented Mar 29, 2021

Does moving to formik mean that any custom forms will need to be rewritten more or less from scratch? Or will there be a compatibility layer for a couple of versions?

@fzaninotto
Copy link
Member Author

The move to formik will be a breaking change, but for most custom forms, the required change will reduce to changing the package name as the APIs are mostly compatible:

-import { Form, Field } from 'react-final-form'; 
+import { Form, Field } from 'formik';

@zero-shubham
Copy link

zero-shubham commented Mar 29, 2021

what does the community think about react-hook-form ? I think it's more user friendly when compared to formik.

@smeng9
Copy link
Contributor

smeng9 commented Mar 29, 2021

I would prefer formik since it it introduces minimal breaking change

EDIT 8/3/2021:
After more evaluation of react-hook-form 5 month later after the initial post, it seems the react-hook-form's development is more active, and it also has smaller bundle size. We have already switched to react-hook-form on some other projects.

@lukin
Copy link

lukin commented Mar 31, 2021

What do you think about removing extra styles? This change will make the components more clearer and compatible with the Material-UI API.

I will try to explain in more detail.

For example, when using <SearchInput />, I expect the position on the page to be similar to the <TextField />, without additional margin.

Or when using <SelectInput />, responsiveness sometimes breaks on small screens due to min-width.

Other components have similar additional styles. makeStyles can be overridden, but it seems to me that in some cases the components would be more convenient without them.

@fzaninotto
Copy link
Member Author

@lukin I don't understand the problem you're trying to solve. Could you elaborate?

@fzaninotto
Copy link
Member Author

@lukin If I understand your suggestion correctly this would break the default FormLayouts. Or do you expect these layouts to inject the custom styles?

@lukin
Copy link

lukin commented Apr 1, 2021

@fzaninotto Yes, that's right. I often have to use custom complex form layouts. By injecting these styles into included layouts (e.g. SimpleForm, TabbedForm), field and input components would be more flexible.

@andrico1234
Copy link
Contributor

andrico1234 commented Apr 3, 2021

Extend the permissions action to more components. In particular, the <Fields> and <Inputs> components.
A fairly common task is to restrict user fields based on access.
Now, each of my <Fields> and <Inputs> components is wrapped in an accessor function. This makes the components <List>, <Show>, <Edit> and others very cumbersome.
It would be nice if as many components as possible support the access property.
Or, for example, for example, to be able to specify access in the style of validation of both the form and individual fields.

@wmwart I know this isn't the best place for this message, but I just open sourced this handy package to do just that: https://github.com/andrico1234/ra-acl. It's inspired by Marmelab's ra-auth-acl, and adds hooks and declarative components.

@DataHippo93
Copy link

Please make HRM work with React-Admin!

#495

@VinayaSathyanarayana
Copy link

Please support next-auth as authentication provider

@fzaninotto
Copy link
Member Author

@VinayaSathyanarayana Please don't post comments with feature requests that don't need a breaking change here. React-admin releases new features on a daily basis, and doesn't need a major release for that. This discussion is only for backwards-incompatible changes.

@fzaninotto
Copy link
Member Author

@Romej We haven't planned to write an upgrade guide from 2 to 4. If you want one, I suggest you get in touch with Marmelab to buy some Professional Services.

@CezaryTarnowski-TomTom
Copy link

Hi, with the migration to 4.0 I've noticed that my app contains multiple nested views on entities that are dependent on other entities. A simple example would be groups and users that are parts of those groups, to attach a user to a group we're using route:
/#/groups/:groupId/users/create
for the list of users in the group we have:
/#/groups/:groupId/users
which we have defined as custom routes, it is working but it makes the groupUser resource handling substandard.
I've started thinking that maybe it would be good to have an ability to nest tags so that on the react-admin level some entities can be considered as dependent on others.
I'm wondering if you foresee such a use case, if this is something that you would like to be a part of v4 I could try to prepare a PR.

@fzaninotto
Copy link
Member Author

@CezaryTarnowski-TomTom interesting use case, for which react-admin wasn't originally designed. But it should become more straightforward if you wrap your users page with a ResourceContextProvider.

As for your PR, could you elaborate on what you have in mind ?

@CezaryTarnowski-TomTom
Copy link

CezaryTarnowski-TomTom commented Feb 2, 2022

I would think about an ability to nest a users resource within groups:

<Resource name="groups">
   <Resource name="groupUsers" />
</Resource>

which would make the routes like:
#/groups/:groupId/groupUsers/ - for list
#/groups/:groupId/groupUsers/:id - for edit
etc...
that would also somehow set the groupId in the context of a groupUsers resource.
I'm planning to deliver such a feature and I believe that it could be easier to create that within the library itself, I could also use some of your expertise.

@fzaninotto
Copy link
Member Author

@CezaryTarnowski-TomTom nice idea. I don't think this requires a breaking change, so it's something we can add later. Your PR will be welcome!

@WesleyKapow
Copy link

WesleyKapow commented Feb 7, 2022

Would love to be able to modify a resource's routes as I'd like /resource/:id to point to show and /resource/:id/edit to point to edit. I believe this aligns with many conventions like seen in rails. From a user perspective, they could copy and paste id's into the URL and that should go to the show page!

From the doc:

The routing will map the component as follows:

/posts/ maps to PostList
/posts/create maps to PostCreate
/posts/:id maps to PostEdit
/posts/:id/show maps to PostShow

@TCM5
Copy link

TCM5 commented Feb 7, 2022

*offtopic alert . Just for curiosity, have you guys considered using zero-installs philosophy?

@fzaninotto
Copy link
Member Author

*offtopic alert . Just for curiosity, have you guys considered using zero-installs philosophy?

I don't know what it is, can you please elaborate?

@cuong-nguyen
Copy link

Thank you all contributors and @fzaninotto on this v4. We're using v3 for one internal project and we're starting new one in few weeks. Is v4 beta production ready? or should I stick with v3 for now? If v4 is not ready, any specific timeline as to when it will be? Thanks 🙏

@djhi
Copy link
Collaborator

djhi commented Feb 8, 2022

No it's not ready yet. We plan to release a beta very soon though

@fzaninotto
Copy link
Member Author

I've removed this item from the list:

The rationale for not doing it in v4 is explained in the linked PR.

@fzaninotto
Copy link
Member Author

I've removed this item from the list:

We're not ready for that and the tradeoff isn't clear - some might say that the trend goes the other way around.

@fzaninotto
Copy link
Member Author

I've removed this item from the list:

After a few tests, I can't implement it. The mui Drawer component requires a fixed width for its main content.

So we'll fall back to the theme (with a custom theme property) that developers can tweak to adjust the menu width. Unforty-unately, this will require a bit of documentation.

@fzaninotto
Copy link
Member Author

Great news: we've published the first beta release for v4: https://github.com/marmelab/react-admin/releases/tag/v4.0.0-beta.1.0

Please test and report bugs, and regressions as new GitHub issues!

@fzaninotto
Copy link
Member Author

I'll speak about the changes and new features of react-admin v4 in about a week from now, during a 30 minutes online event. It's free, so feel free to join if you're curious about the future major release of react-admin!

https://www.eventbrite.com/e/preview-of-react-admin-v4-tickets-274058445187

@giorgiPapava
Copy link

Hey,
thanks for this awesome tool for community. I'm wondering when v4 will be production ready and available on NPM. I will be starting new project in around 1 month and I don't think it would be good idea to start with v3. What would be needed to migrate from v3 to v4? Will there be migration guide?

@djhi
Copy link
Collaborator

djhi commented Mar 7, 2022

Hi,

We released several beta already. As for the upgrade guide, it's here and the documentation is here

@giorgiPapava
Copy link

giorgiPapava commented Mar 7, 2022

@djhi
Thanks 🥰 Is is planned when you will be releasing production ready version? Also is it safe to start implementing beta version? Will there be breaking changes from beta to production?

@fzaninotto
Copy link
Member Author

We've announced a public release of react-admin v4 in April. As for the beta, we're following semver, so there should not be any more breaking changes since the stable release.

@TCM5
Copy link

TCM5 commented Mar 23, 2022

Ohhh, I missed the V4 preview event at preview-of-react-admin-v4.

Can this be published on youtube or something else?

@fzaninotto
Copy link
Member Author

We didn't record the presentation. But we'll soon publish a blog post with essentially the same content.

@DVGY
Copy link

DVGY commented Mar 25, 2022

@fzaninotto I saw just now that, your team will also remove redux. In our app, we are using custom reducers and our own state in the whole app to manage some data.

Can you pls answer these 2 questions taking into consideration the redux thing?

  1. How hard will it be to upgrade our app to react admin v 4.0.0?
  2. What are the things that we may need to change?

@fzaninotto
Copy link
Member Author

@DVGY We've written an extensive Upgrade guide, it contains all the anwsers you need.

https://github.com/marmelab/react-admin/blob/next/UPGRADE.md#redux-is-gone

@fzaninotto
Copy link
Member Author

We've published react-admin v4 today!

https://github.com/marmelab/react-admin/releases/tag/v4.0.0

@fzaninotto fzaninotto unpinned this issue Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests