Hi there! This is a very simple demo of what Electron can do. There are several branches:
Hello-Electron
: This sets up a development server, which allows for hot-reloading. This also displays a "Hello, Electron!" inside of Electron. Neat!Add-IPC
: IPC is the glue by which the "frontend" and the "backend" communicate. A retrieval of all files in the current directory of the Electron application is implemented to demonstrate this. jQuery is added, too because everything needs jQuery.Deploy-App
: Electron comes with powerful deploy tools which can deploy an Electron application as an executable file across Linux, OS X, and any modern version of Windows. This will set up webpack andelectron-packager
to deploy an Electron application.Add-Tooling
: Add esLint using Airbnb's popular ruleset and extensions for React.
Clone this repo.
git clone https://github.com/robertjmarlow/electron-demo
Change working directory.
cd electron-demo
Check out a branch.
git checkout Hello-Electron
Install the node modules.
npm install
(optional but recommended) Install Electron globally.
npm install -g electron
Run the webpack dev server.
npm run dev
(in another command window) Run the application!
electron .
Run esLint.
npm run lint
esLint will get angry if it finds any problems.
npm run lint
> [email protected] lint C:\git\robertjmarlow\electron-demo
> eslint -c ./.eslintrc.js main.js ./src/js/** ./src/jsx/*
C:\git\robertjmarlow\electron-demo\src\jsx\hello.jsx
3:22 error Trailing spaces not allowed no-trailing-spaces
✖ 1 problem (1 error, 0 warnings)
renderer process
: The "frontend", or the V8 process. Think of it like a Chrome window.main process
: The "backend, or the node process.webpack
: Used by this project to put all the js and css into one big javascript file. Other tools that can do the same thing include Gulp and Grunt.esLint
: Static code analyzer that enforces good programming practices and code styling.