-
-
Notifications
You must be signed in to change notification settings - Fork 480
[Tech] Update to Vite 4 #2628
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
[Tech] Update to Vite 4 #2628
Conversation
src/backend/wine/manager/downloader/__tests__/main/getter.test.ts
Outdated
Show resolved
Hide resolved
`discord-rpc`, which `discord-rich-presence-typescript` depends on, always tries to polyfill `fetch`, which in turn tries to assign to the global object. This doesn't go well in Vite (not sure why this wasn't an issue before actually) Opting for our own implementation means we have control over such decisions in the future as well
b7a3ee5
to
690dcfc
Compare
I do see build time and file sizes are pretty big compared to vite 3 the preload.js with vite 3:
With vite 4:
I agree that 4mb is not that much for the main.js in a 100mb file, but I wonder what's the impact of that when the browser has to parse that, it's a lot of javascript. |
You're building the main backend (
I personally haven't noticed any impact on startup times. I plan on combing through our dependency list to find these problematic packages and possibly find/write replacements, but that would balloon this PR up to "nobody-wants-to-review-it" range pretty fast |
Superseded by #3218 |
TODO:
main
application is rather large (500KB before update, ~4.5MB now), find out why this is happening if possible. Probably something to do with Vite 4 itself, along withvite-plugin-electron
changesUpdate: This is most likely caused by some dependency of ours including extra code when not built for the browser. Since this same option also makes other packages work, we can't just disable it either. In the grand scheme of things, +4MB isn't that bad, considering a final bundle for any platform can easily approach 100MB
src/backend/logger/ipc_handler.ts
seems to be imported/ran twice when running the development build (not happening in production-built version), causing Electron to error about trying to handle the same event twice. No idea at all why this is happeningUpdate: Seems like this is caused by Vite getting confused about our circular import issues (which to be fair, I don't blame it for). So that looks like it's also better to be untangled in another PR
Use the following Checklist if you have changed something on the Backend or Frontend: