-
Notifications
You must be signed in to change notification settings - Fork 34
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
Migrate from Webpack and Jest to Vite and Vitest #3104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mostly me trying to merge our old tsconfig with what was provided by their template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes me so happy that can swap out testing frameworks this easily now.
Note that this PR changes one of the environment variables used when building the bundle -- - SINGLE_SERVER
+ KINTO_ADMIN_SINGLE_SERVER we'll need to account for this in the build process. |
This PR all started when I was investigating mozilla/remote-settings#522
I suspected some rerendering was causing elements to go stale, so I fired up Kinto Admin and went to look at the profiler only to discover that React thought we were running a production build.
I went to make the necessary configuration changes to enable a development build, but I quickly became disheartened by the task of modifying Webpack config.
I then though about how Webpack is pretty slow in general, compared to newer tools. I tried out a few different bundlers (esbuild, parcel, Vite), and Vite seemed to be the easiest to use and was faster that Webpack.
I made that change, but then quickly found out that
Jest
is incompatible with Vite. I searched for answers there as well and found https://vitest.dev/, which is the "part 2" of this PR. Migrating to Vitest also seemed to expose some errors in our testsOverall after this PR, we have:
Some of the changes in this PR required mass find-and-replaces (d84f5f3 and e0d1815), so I'd recommend stepping through by commit.