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

RFC: Using React #3246

Open
dandlezzz opened this issue Jul 2, 2019 · 4 comments

Comments

Projects
None yet
5 participants
@dandlezzz
Copy link

commented Jul 2, 2019

The problem

The solidus admin frontend does not use a modern JS framework in its implementation. This is problematic for several reasons. 


  1. Aspiring frontend contributors can not rely on their accumulated knowledge of something like React or Vue to make contributions.

  2. Our frontend dependencies are quickly falling out of fashion. This makes it more difficult to leverage the rest of the current JS ecosystem.

  3. Most importantly, modern JS frameworks increase productivity allowing for more rapid development of the Solidus admin frontend.

Proposal

Assuming we resolve #3077, relatively soon. We should move to adopt React as the Solidus Javascript framework. The transition to a frontend fully powered by React will take considerable effort. But we can do it one component at a time. React can play nicely with other javascript frameworks and dependencies. By taking an incremental approach, we can avoid the need for a massive rebuild. Additionally, by opening up issues for contributors to rewrite existing frontend components, it should help us attract a whole new crop of frontend developers, attracted to the prospect of small straightforward tasks.

@dandlezzz dandlezzz changed the title Using React RFC: Using React Jul 2, 2019

@ericsaupe

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

I think the long term goal of the Solidus frontend is to separate it out into various projects of various flavors, HTML, React, Vue, etc. I agree a new frontend is definitely needed but a new solidus_frontend_react gem could be started today.

@kennyadsl

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

Hey @dandlezzz, thanks for your input. The problems with using React for our Admin frontend, as reported in #3077, are:

  1. there's no way to distribute a JavaScript package via a RubyGems. This means that we should create one or more external npm packages along with the Solidus gem and users will need to take care of keeping them in sync, which is far from ideal.
  2. It's not super clear how we could use extensions and host application code to eventually change what would be shipped in core. I mean, what if I want to change how a component provided by Solidus behaves on my store using Webpack and React? Now we have this procedure, what should be alternative?
@dandlezzz

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

@kennyadsl Those are some valuable points. What about if we leverage something like, https://github.com/reactjs/react-rails. This would allow us to distribute react components and use them in views without having to maintain a seperate npm package. Additionally, this should provide some nice override functionality. Granted, you won't be able to customize individual components but you will be able to use all of the components bundled by the rails app to compose a view.

@dhonig

This comment has been minimized.

Copy link

commented Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.