electron-vite / electron-vite-react

:electron: Electron + Vite + React + Sass boilerplate.
https://electron-vite.github.io
MIT License
1.89k stars 226 forks source link

Resizing of app is very slow #17

Closed yash1200 closed 2 years ago

yash1200 commented 2 years ago

I cloned the project, and tested it for performance and other stuff, the things that's slow here is resizing of the app. I tried this last month too and it was working fine, Maybe some changes in the past weeks broke something. Here's a screenshot for the same. This is on the production build.

Screenshot 2022-02-12 at 4 09 00 PM

caoxiemeihao commented 2 years ago

Thank you feedback. I tried to go back to last month's version, but I didn't see that it would run faster. If you can remember the approximate date, I'll compare the code at that time. Maybe I really inadvertently caused this problem.

yash1200 commented 2 years ago

I don't remember the date, but it was around at the starting of January.

yash1200 commented 2 years ago

Also this error comes after I made some changes in the app. SyntaxError: The requested module '/@fs/Users/yashjohri/Projects/Vite/node_modules/.vite-plugin-resolve/electron.js' does not provide an export named 'remote'

caoxiemeihao commented 2 years ago

Also this error comes after I made some changes in the app. SyntaxError: The requested module '/@fs/Users/yashjohri/Projects/Vite/node_modules/.vite-plugin-resolve/electron.js' does not provide an export named 'remote'

Can you post your modified relevant code?

In fact, remote has been deprecated in electron.
If you still use it in you App. You can export remote in renderer/vite.config.ts

https://github.com/caoxiemeihao/vite-react-electron/blob/a6c9cad8d011348f503068a3375222a32e76a45b/packages/renderer/vite.config.ts#L66

const electron = require("electron");
const {
  clipboard,
  nativeImage,
  shell,
  contextBridge,
  crashReporter,
  ipcRenderer,
  webFrame,
  desktopCapturer,
  deprecate,
+ remote,
} = electron;

export {
  electron as default,
  clipboard,
  nativeImage,
  shell,
  contextBridge,
  crashReporter,
  ipcRenderer,
  webFrame,
  desktopCapturer,
  deprecate,
+ remote,
}