This is wishlist for developing Electron apps in React
I want to take an existing React app and “wrap” it in Electron
and also customise it for Electron by:
- adding IPC communication
- adding menu’s
The objective is to:
- maximum code reuse across the React and the Electron app
- add web and desktop specific features. css, js or components which are loaded based on the context
- Electron app is always updated like how a website is always updated. can sacrifice offline for this ie. load a url and not a file. and even for supporting offline, it works like a react app (ie. service workers) rather than a file url (ie. the electron app)
PS: for (2) above can assume that, files are named with an electron prefix or a web prefix
ie. header.web.css and header.electron.css
electron-forge is nice but it has its own opinion on how to transpile code.
it seems good for a new app. But when we have an existing React app with its own unique
build process, eg. with its own babel plugins etc. Then not sure how electron-forge will work
It does not work with node-sass as well. I also like how it always uses electron-rebuild
Basically want to warp an existing React codebase without assuming anything about the web build process
some common patterns can be transpiled hopefully:
- use electron-devtools-installer automatically
- use hashHistory for react-router rather than borwserHistory
The other project which i like is electron-react-boilerplate
But it is a bit too complicated for my taste. And I do not use/like some of the parts:
- file organization
But these are all nitpicks and
electron-react-boilerplate rocks React + Electron
The author has put in lot of effort and thought into it.
On the other hand, would have liked the developer UX to have been similar to create-react-app
So i want to merge these three projects:
Would people be interested in something like this ?
TL;DR: My question is:
- What is easiest way to wrap an existing React app in an Electron app. and add Electron specific features
- Is there anything similar to electron-react-boilerplate + electron-forge + create-react-app ?