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

Colab Spike: Investigate Moving GWE from Using Nextjs to Vite #616

Open
PhotoNomad0 opened this issue Dec 13, 2023 · 7 comments
Open

Colab Spike: Investigate Moving GWE from Using Nextjs to Vite #616

PhotoNomad0 opened this issue Dec 13, 2023 · 7 comments
Assignees

Comments

@PhotoNomad0
Copy link
Contributor

PhotoNomad0 commented Dec 13, 2023

Determine what it will take to convert GWE from Using Nextjs to Vite. See if that improves/accelerates development.

@PhotoNomad0 PhotoNomad0 self-assigned this Dec 13, 2023
@PhotoNomad0
Copy link
Contributor Author

PhotoNomad0 commented Dec 13, 2023

Notes

  • Attempted:

    • Failed: tried using latest Vite 5 and then had to switch to node 18 and react 18. But we had to problems with older material UI. Went back to Vite 4.5 and node 16 and react 16 - now making progress. Maybe it is just the react version that caused problems
  • Steps:

    • Created a clean vite app and copied over config files and dependencies to GWE
    • Removed next dependency and all usages
    • Renamed files that have jsx elements from *.js to *.jsx (typically components and custom hooks)
    • Changed references to process.env to use import.meta.env
      • also have to rename any environment variables you want to share with app and add VITE_ to the start of the name
    • Removed next dependencies in code
      • Replaced useRouter with state
    • make a tweak to single-scripture-rcl - moved the exported types definition from useScriptureAlignmentEdit.tsx to types/index.ts
  • Setting up vitest:

    • version 1.0.0 requires vite 5.0.0 and node 18
    • trying vitest 0.34.6
  • Still do do:

    • Fix jest to work with Vite
      • do we remove babel compiler?
    • Fix page changing
      • Settings page
      • Error page
      • Feedback page
    • fix feedback API

@larsgson
Copy link
Contributor

Maybe this s.o. thread is of help re. using babel, or not:
https://stackoverflow.com/questions/72344723/is-it-required-babel-configuration-when-i-use-vite-in-place-of-webpack

I think it would be good to remove babel in order to reduce complexity... or what would be the benefit of keeping it?

Would this maybe be of help for jest migration:
https://vitest.dev/guide/migration.html#migrating-from-jest

@larsgson
Copy link
Contributor

Re downgrading vite, node and react

  • ok, this is probably a different issue in the code somewhere, so better to delay such upgrades to later and get vite to work as a first step.

@abelpz
Copy link
Member

abelpz commented Dec 13, 2023

@larsgson it was @material-ui's ThemeProvider it was generating all sort of compatibility issues

@PhotoNomad0
Copy link
Contributor Author

Would this maybe be of help for jest migration: https://vitest.dev/guide/migration.html#migrating-from-jest

@larsgson - It looks like what we want, but looks like it could be significant work converting from jest to vitest.

@PhotoNomad0
Copy link
Contributor Author

Would this maybe be of help for jest migration: https://vitest.dev/guide/migration.html#migrating-from-jest

@larsgson - It looks like what we want, but looks like it could be significant work converting from jest to vitest.

OK, was able to get it working for now.

@elsylambert
Copy link
Contributor

Note: Test by deploying to Netlify to a new site(for testing)

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

4 participants