electron-wrapper icon indicating copy to clipboard operation
electron-wrapper copied to clipboard

Handle light vs deep integration of Electron

Open zuck opened this issue 8 years ago • 2 comments

With the current implementation of electron-wrapper, launching the command quasar wrap electron simply creates a project structure to launch an Electron shell and executing the packaged application inside of it without deep integration (no access to Electron's renderer API).

I imagine two ways to solve this issue:

  1. Add option to set light vs deep Electron integration to quasar wrap electron command (quasar wrap electron --deep/light).
  2. Make quasar dev/build commands on project root folder (not electron/) more explicit, in order to better handle Electron integration (quasar dev/build electron --deep/light instead of previous quasar dev)

In both cases, with deep integration I mean changing or adding to the webpack conf the target electron-renderer and electron package in dependencies inside package.json of root project. With light integration I mean the current mode (just Electron shell executing an URL without accessing to Electron API).

My personal choice would be no.2, because it should allow us to change dynamically the webpack config to handle both cases without changing code, so that the same codebase could be used for browser (quasar dev/build), Electron (quasar dev/build electron) or Cordova (quasar dev/build cordova).

zuck avatar Feb 22 '17 15:02 zuck

I noticed that current implementation of electron-wrapper does not allow (by default) that I use Node.js Libraries (ex.: File System) inside my components. A deep integration will help with this limitation ?

lucascampelo avatar Jun 12 '17 20:06 lucascampelo

@lucascampelo, although it has been two months I thought I'd still reply. Yes, setting 'target: electron-renderer' will allow usage of File System. As the suggested deep integration adds this target it would solve the problems. I think however it is better to have a separate webpack file as it still allows browser version's and use try-catch to check for 'fs' availability.

Emptyless avatar Aug 19 '17 19:08 Emptyless