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

Use React #271

Closed
RonitNath opened this issue Oct 28, 2021 · 8 comments
Closed

Use React #271

RonitNath opened this issue Oct 28, 2021 · 8 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@RonitNath
Copy link
Contributor

We're using vue. Shall we use react instead?

Open for comments.

@RonitNath RonitNath added help wanted Extra attention is needed question Further information is requested labels Oct 28, 2021
@RonitNath
Copy link
Contributor Author

Or just make a react branch

@ethanwu10
Copy link
Member

ethanwu10 commented Oct 28, 2021

My view of the situation:

  • Gridsome is basically dead—<g-link> doesn't actually change pages on build - Hydration issue gridsome/gridsome#650 (which we ran into with Navigation bar doesn't work till after reload #210) has been open for 2+ years now with exactly 0 comments from any Gridsome maintainers
  • Gatsby (a React SSG—Gridsome is essentially "Gatsby for Vue") is not dead and won't be for the foreseeable future, since it's backed by Gatsby Inc. (which is based in Berkeley apparently) with both VC funding and a revenue stream
  • All of our Gridsome plugins are based off of existing Gatsby plugins, so they should be mostly painless to migrate
  • There's not actually that much logic in the Vue code, most of the code is just plumbing data into templates, so migrating from Vue to React should mostly be mindless/busywork and not require too much thinking (the SSO integration is a bit of a different story, but very little actually uses it)
  • All of the current styling is done via traditional CSS and not CSS-in-JS, so there's nothing to port to React (however we probably want to stop using Bulma anyways, but that's a topic for a different issue)
  • dwqs/vue-to-react exists which hopefully can handle a big portion of the busywork, however it hasn't been updated in 4 years so I have no idea how well it actually works; also it outputs React class components, so there'd still need to be another pass to switch to hooks (but that at least can be put off for a bit)

Obviously a React port is a good amount of effort, however using Gridsome just doesn't seem sustainable. React also has a richer ecosystem and more active community than Vue does.

Finally, if we are to go forward with porting everything to React, a branch is probably necessary so that we can keep bugfixes going for the current version, since people do still use it for searching docs. However it would be a good idea to do a full feature freeze on master to avoid duplicate work, i.e. all "new" code goes to the React branch (which evenutally will get promoted to master).

@nikhiljha
Copy link
Member

nikhiljha commented Oct 29, 2021

I think Ethan pretty much said it all, although also of note is the fact that more people are familiar with React both within the OCF and probably in Berkeley in general. I'm a little sad that we will never get svelte ocfweb but I think React is worth it for maintainability and ecosystem support.

@ethanwu10
Copy link
Member

Just wanted to add we've hit more problems with Gridsome already: Node 17 broke webpack's hashing function, and a fix landed in webpack 5, however webpack maintainers have stated that it's not getting fixed for webpack 4. Meanwhile, a pull for webpack 5 in Gridsome has already been merged, however the last Gridsome release was a year ago (!!), so it has never been published.

...and of course more hydration problems have cropped up...

@RonitNath
Copy link
Contributor Author

RonitNath commented Nov 5, 2021 via email

@Kalissaac
Copy link
Member

How much would break if we removed Gridsome?

The only Gridsome-specific feature that I know of is the docs, since that uses Gridsome's data ingestion and then a search component.

@RonitNath
Copy link
Contributor Author

#279

@Kalissaac
Copy link
Member

Completed (partially) in #325

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants