-
Notifications
You must be signed in to change notification settings - Fork 1
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
Vite migration #154
base: develop
Are you sure you want to change the base?
Vite migration #154
Conversation
Thanks for the proposal. What are the advantages to change the build worflow (again)? |
As I mentioned
So again I would assume this also translates into better dev experience when working on the project. |
I remember CRA was notoriously impossible to configure without ejecting the project (this is why I used CRA rewired or something). If the configuration is easier with vite, that would be interesting. For the build speed, it's always appreciable, but I don't remember it was a real issue. I'll try it on my machine. |
I just tested it. It seems to work nice, but in dev mode, vite eats all my memory and crashes after 1 minute:
I saw some issues related to this problem on the vite repo. |
As @odrling said, Vite (and swr) introduces a lot of QoL and CI improvements, notably less dependencies overall, faster
All the configuration happens in vite.config.js. I tried to match the most the previous CRA config. I also added
Can you reproduce it on the latest LTS (node 20)? I also found this issue on the vite-plugin-checker repo which leads me to believe that the 234 eslint errors reported on our project may be a little too overwhelming for it. Can you try again after removing the plugin from vite.config.js? |
Seems better with node 20. There are a lot of linter errors (246) and warnings (14), they didn't show up before. We cannot leave it like that, but some of them seem inherent to (what I know on how to use) React. By instance, importing React in every file without using it, and assigning classes. |
Do you want me to fix these errors and warnings in this PR? Or in a separate one? I didn't want to touch any existing React code in this PR so I let all the eslint errors and warnings. |
I think Vite imports it implicitly in every JSX file now.
I am not familiar with the previous class-based components system but maybe we can ignore this error globally if all the assignments are actually safe. |
It would be nice to find a linter config tailored for React, to begin with. |
I already merged the Vite default React config with your custom plugins and rules. |
It's more about the eslint/stylecheck configuration. |
Sounds fair to do it in another PR. Please create an issue for that. |
jsconfig.json was loaded by editors such as vscode so their LSP could resolve aliases
Migrate the project to Vite + swr (in replacement of CRA + webpack).
eslint
/stylecheck
configurations are unmodified but have been moved out ofpackage.json
.