-
-
Notifications
You must be signed in to change notification settings - Fork 208
Description
Clear and concise description of the problem
When building a complex Electron app that has a lot of logic in the main process, it becomes a less-than-ideal DevX to have the entire application either a) completely restart on every change to the main process or b) require a manual restart after changes.
On the other hand, full-stack app frameworks like Tanstack Start support HMR across the entire stack, by utilizing the latest Vite APIs for both SSR and Client-side environments.
It would be great if electron-vite could support HMR in the main and preload processes, in addition to the existing renderer HMR support.
Suggested solution
There have been projects like vite-node that have proven the ability to enable HMR in non-frontend apps. The vite-node solution in particular has laid the foundation for the new vite Environment API, which can be used by the electron-vite project to enable HMR in server-side apps.
The main process would need to be broken up into parts that would be able to be hot reloaded (e.g. changes to ipc handler implementations) and state that would persist between hot reloads.
Alternative
No response
Additional context
No response
Validations
- Follow the Code of Conduct.
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.