SlideShare a Scribd company logo
1 of 59
Download to read offline
© 2016 Priramo
© 2016 Priramo
By Priyaranjan Mohanty
© 2016 Priramo2
Don’t Worry we are not going to talk
Quantum Physics
This is something which we will be using to create
Desktop Applications
© 2016 Priramo3
But Why to create a
Desktop App ?
© 2016 Priramo4
People are not constantly connected.
They don’t want to compromise with their privacy.
They like to experience faster performance.
They would prefer to be the owner instead of a tenant.
Sometimes there is a sophisticated client need.
Most importantly its getting easier to create one now.
Because
© 2016 Priramo5
Offline
Printers, Devices & Other local hardware
On-Premise
Internal, LOB
Edit Local Files
App Store
Kiosk
Desktop > Intranet
Sometimes it “just feels right”
Some of the Business Needs
© 2016 Priramo6
Disconnected Data Entry
Editor
Time Management
Media Player
Email Client
Messaging, Collaboration
Mapping, Route Planner
Social Media Client
And many more that you can think of …
Few Application Ideas
Bulk Media Editor
File Management, Backup
Document Generation, Reading
Audio, Video Conferencing
Games
Personal Assistant
Database Client
Calendar
© 2016 Priramo7
© 2016 Priramo8
Story of Electron
Features
Architecture
Hello World
Hello Universe
Potential
Roadmap
Up Ahead
© 2016 Priramo9
Story of Electron
The journey of an idea to make things simple and easy.
© 2016 Priramo10
It all started with the search for
A foundation for Atom
Github needed a tool to build the text editor on – with
JavaScript, HTML and CSS
© 2016 Priramo11
Path to Electron
node-webkit
nw.js
Chromium Embedded
Framework
Atom Shell
Electron [now]
Cheng Zhao
Lead Electron Developer
Contributor to nw.js
Github [ @zcbenz ]
Tokyo, Japan
© 2016 Priramo12
Journey of Electron so far
Project Began
January 2013
Open Sourced
May 2014
Named Electron
April 2015
Released API 1.0
June 2016
© 2016 Priramo13
Formal Introduction
Electron
A framework for building cross platform desktop
applications with web technology
© 2016 Priramo14
An Artist’s Impression of Electron
© 2016 Priramo15
Features
All the cool things that are happened to be provided
with electron to achieve the native behaviors.
© 2016 Priramo16
Core Features
Web Technology
HTML, CSS, JS
Latest & Greatest
All the chrome goodies
No Native Skills
Unless you want to
One Browser
Design once
© 2016 Priramo17
Core Features
File System
All of Node.js APIs
Three Platforms
Windows, Mac OS X, Linux
Modules
npm ecosystem
Native Menu
Dialogs & Notifications
© 2016 Priramo18
Core Features
Windows Installers
No Configuration
Automatic Updates
Mac & Windows with Squirrel
Crash Reporting
Submit to Remote Server
Debugging & Profiling
Content tracing by Chromium
© 2016 Priramo19
Architecture
Explore the magic box of electron to understand the
components and processes underneath
© 2016 Priramo
5.3.332.37
6.5.0
1.4.0
53.0.2785.113
20
Under the Hood
© 2016 Priramo21
Chromium
• The open-source web browser project from Google.
• Provides tabbed window manager, or shell for the web.
• Have a minimalist user interface.
• Uses V8 as the JavaScript engine.
• Uses Blink as the layout engine.
• Electron uses content module/content API.
© 2016 Priramo22
Node JS
• An open-source JavaScript runtime.
• Uses V8 JavaScript engine.
• Enables you to run JavaScript outside the browser.
• Provides an interactive shell (REPL: read-eval-print-loop)
where you can execute raw JavaScript code.
• Uses an event-driven, non-blocking I/O model that
makes it lightweight and efficient.
• Node.js' package ecosystem, npm, is the largest
ecosystem of open source libraries in the world.
© 2016 Priramo23
V8 JavaScript Engine
• An open-source JavaScript Engine developed by The
Chromium Project.
• Written in C++ and JavaScript.
• Implements ECMAScript as specified in ECMA-262, 3rd
edition.
• Runs on Windows XP or later, Mac OS X 10.5+, and Linux
systems that use IA-32, ARM or MIPS processors.
• Compiles JavaScript into native machine codes.
© 2016 Priramo24
The Two Processes
Main
Application Lifecycle
Renderer
Web Page
Node.js APIs ipc
Electron APIs
ipc DOM Node.js
APIsElectron APIs
Creates
Communicates
© 2016 Priramo25
The Two Processes
Main
Renderer
Renderer
Renderer
Renderer
App
Web Page
© 2016 Priramo26
The Two Processes
Chrome File Edit View
Main
Chrome
Renderer
Each Tab
Older Versions
Newer Versions
© 2016 Priramo27
Hello World
Let’s build the very first desktop application using
electron and get started.
© 2016 Priramo28
Getting Started
package.json main.js index.html
© 2016 Priramo29
package.json
{
"name" : "hello-world-app",
"version": "0.1.0",
"main" : "main.js"
}
© 2016 Priramo30
main.js (Main Process)
const electron = require('electron');
const app = electron.app
const BrowserWindow = electron.BrowserWindow
let mainWindow = null;
app.on('ready', function() {
mainWindow = new BrowserWindow({width: 800, height:600});
mainWindow.loadURL('file://' + __dirname + '/index.html');
mainWindow.on('closed', function () {
mainWindow = null
})
})
© 2016 Priramo31
index.html (Renderer Process)
<html>
<head>
<script>
window.onload = function() {
var fs = require('fs')
var p = document.createElement('p')
p.textContent = fs.readFileSync('dataFile.txt')
document.body.appendChild(p)
}
</script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
© 2016 Priramo32
Global Electron
npm install –g electron
electron .
© 2016 Priramo33
Hurray !!!
© 2016 Priramo34
Power of Chrome to the App
© 2016 Priramo35
Hello Universe
Deep dive into the electron ecosystem
© 2016 Priramo36
Electron APIs
Main Process
app
BrowserWindow
Dialog
ipcMain
MenuItem
powerSaverBlocker
systemPreferences
Tray and more …
Renderer Process
desktopCapturer
File Object
ipcRenderer
remote
webFrame
<webview> Tag
window.open function
Both Process
clipboard
crashReporter
Environment Variables
nativeImage
Process
screen
shell
Synopsis
© 2016 Priramo37
Hard Things Made Easy
const {BrowserWindow} = require('electron')
let win = new BrowserWindow({transparent: true, frame: false})
win.show()
globalShortcut.register('CommandOrControl+Shift+J', () => {
mainWindow.webContents.toggleDevTools();
})
app.on('will-quit', () => {
globalShortcut.unregisterAll()
})
Accelerators can contain multiple modifiers and key codes, combined by the + character.
© 2016 Priramo38
Hard Things Made Easy
crashReporter.start({
productName: 'YourName',
companyName: 'YourCompany',
submitURL: 'https://your-domain.com/url-to-submit',
autoSubmit: true
})
shell.moveItemToTrash('someFile.txt')
shell.openExternal('https://github.com')
© 2016 Priramo39
Hard Things Made Easy (ipc)
// In main process.
const {ipcMain} = require('electron')
ipcMain.on('asynchronous-message', (event, arg) => {
console.log(arg) // prints "ping"
event.sender.send('asynchronous-reply', 'pong')
})
ipcMain.on('synchronous-message', (event, arg) => {
console.log(arg) // prints "ping"
event.returnValue = 'pong'
})
ipcMain
Communicate asynchronously from the main process to renderer processes.
© 2016 Priramo40
Hard Things Made Easy (ipc)
ipcRenderer
Communicate asynchronously from a renderer process to the main process.
// In renderer process (web page).
const {ipcRenderer} = require('electron')
// prints "pong" to be returned from ipcMain
console.log(ipcRenderer.sendSync('synchronous-message', 'ping'))
ipcRenderer.on('asynchronous-reply', (event, arg) => {
console.log(arg) // prints "pong"
})
ipcRenderer.send('asynchronous-message', 'ping')
© 2016 Priramo41
Electron Tools
electron-prebuilt
Install prebuilt Electron binaries for command-line use using npm.
electron-compile
Use ES2015, CoffeeScript, LESS, SCSS in your app without a pre-compilation step.
electron-packager
Package and distribute your app.
devtron
Official DevTools extension. Provides features to debug all electron components.
spectron
Test Electron apps using ChromeDriver.
© 2016 Priramo42
Bolierplates
electron-quick-start
Clone the repo to try a simple app.
electron-boilerplate
Comprehensive boilerplate by szwacz which even generates installers.
bozon
Scaffold, run, test, and package your app.
SkelEktron
A ready to go app template with some useful features built-in like logger, builder & updater etc.
electron-react-boilerplate
Boilerplate based on React and webpack.
© 2016 Priramo43
Useful Components
React Desktop
UI toolkit for macOS and Windows built with React.
cookies
Adds support for 'document.cookie'.
chrome-tabs
Chrome like tabs.
menubar
High-level way to create a menubar app.
Photon
UI toolkit for building beautiful apps.
© 2016 Priramo44
Electron API Demo App
© 2016 Priramo45
Potential
Initially developed for GitHub's Atom editor, Electron
has since been used to create applications by many.
© 2016 Priramo46
Impactful Footprints
Atom
By Github
© 2016 Priramo47
Impactful Footprints
Slack Desktop
App
By Slack
© 2016 Priramo48
Impactful Footprints
Visual Studio
Code
By Microsoft
© 2016 Priramo49
Impactful Footprints
WordPress
Desktop App
By WordPress
© 2016 Priramo50
Impactful Footprints
Postman
© 2016 Priramo51
Impactful Footprints
WhatsApp
© 2016 Priramo52
Impactful Footprints
Hive Kitematic Wagon ScreenCat Mojibar WebTorrent PhoneGap
Ionic Lab Avocode Nuclide Pixate Tofino Play Music Netbeast
Sencha Test Nylas N1 AirTame GitKraken Jibo Gif Maker
© 2016 Priramo53
Roadmap
Present state and future scope of improvement
© 2016 Priramo54
Electron Downloads
500K
1M
1.2M
4.23.2015
Atom Shell get
renamed to Electron
2016
© 2016 Priramo55
Github Stats as of now
8 branches
11,000+ commits
248 releases
450+ contributors
4,000+ forks
300+ open issues
10+ open pull requests
1,700+ watchers
35,900+ stars
4,500+ closed issues
2,300+ closed pull requests
and counting…
© 2016 Priramo56
Items in line
Chrome Web Push support.
Google Cast (Chromecast) in Electron.
Better support for Linux ARM machines.
Implementation of V8 inspector '--inspect‘.
Enhancements of dialog and menu management.
APIs to control system's onscreen keyboard.
Feature to add header and footer content for PDF.
Run electron renderers inside chromium sandbox.
And many more…
© 2016 Priramo57
References
Chromium
http://blog.chromium.org/
https://www.chromium.org/developers/design-documents
https://chromium.googlesource.com/chromium/src/+/lkgr/docs
Node.js
https://en.wikipedia.org/wiki/Node.js#Technical_details
https://nodejs.org/api/
http://blog.modulus.io/absolute-beginners-guide-to-nodejs
V8 JavaScript Engine
http://v8-io12.appspot.com/
http://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/
https://en.wikipedia.org/wiki/V8_(JavaScript_engine)
https://github.com/eclipsesource/j2v8
© 2016 Priramo58
Resources
Electron
http://electron.atom.io/
https://github.com/sindresorhus/awesome-electron
Discuss: https://discuss.atom.io/c/electron
Slack: http://atom-slack.herokuapp.com/
@ElectronJS: https://twitter.com/ElectronJS
Email: electron@github.com
https://app.pluralsight.com/library/courses/electron-playbook/table-of-contents
https://medium.com/developers-writing/building-a-desktop-application-with-electron-204203eeb658
https://www.toptal.com/javascript/electron-cross-platform-desktop-apps-easy
Study Materials
© 2016 Priramo59
Most things were
Before they became
EASY

More Related Content

What's hot

Android app Presentation and Documentation Vignan buddy presentation
Android app Presentation and Documentation Vignan buddy presentationAndroid app Presentation and Documentation Vignan buddy presentation
Android app Presentation and Documentation Vignan buddy presentationSaigopi Narimeti
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with ScratchNicole Baratta
 
Magento PWA Studio extensibility
Magento PWA Studio extensibilityMagento PWA Studio extensibility
Magento PWA Studio extensibilityLars Roettig
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessBartosz Kosarzycki
 
Low-code vs Model-Driven Engineering
Low-code vs Model-Driven EngineeringLow-code vs Model-Driven Engineering
Low-code vs Model-Driven EngineeringJordi Cabot
 
Puppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node APIPuppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node APIubunturk
 
Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Androidintive
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutterrihannakedy
 
Interview preparation full_stack_java
Interview preparation full_stack_javaInterview preparation full_stack_java
Interview preparation full_stack_javaMallikarjuna G D
 
Build beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutterRobertLe30
 
도커 학습과 Boot2Docker
도커 학습과 Boot2Docker도커 학습과 Boot2Docker
도커 학습과 Boot2Dockerpyrasis
 
Native mobile application development with Flutter (Dart)
Native mobile application development with Flutter (Dart)Native mobile application development with Flutter (Dart)
Native mobile application development with Flutter (Dart)Randal Schwartz
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkNick Pruehs
 

What's hot (20)

Android app Presentation and Documentation Vignan buddy presentation
Android app Presentation and Documentation Vignan buddy presentationAndroid app Presentation and Documentation Vignan buddy presentation
Android app Presentation and Documentation Vignan buddy presentation
 
Scratch Project
Scratch ProjectScratch Project
Scratch Project
 
Flutter vs React Native 2019
Flutter vs React Native 2019Flutter vs React Native 2019
Flutter vs React Native 2019
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with Scratch
 
Magento PWA Studio extensibility
Magento PWA Studio extensibilityMagento PWA Studio extensibility
Magento PWA Studio extensibility
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
 
Low-code vs Model-Driven Engineering
Low-code vs Model-Driven EngineeringLow-code vs Model-Driven Engineering
Low-code vs Model-Driven Engineering
 
Puppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node APIPuppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node API
 
Capacitor 1.0 launch
Capacitor 1.0 launchCapacitor 1.0 launch
Capacitor 1.0 launch
 
Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Android
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutter
 
Scratch Lesson 3
Scratch Lesson 3Scratch Lesson 3
Scratch Lesson 3
 
Interview preparation full_stack_java
Interview preparation full_stack_javaInterview preparation full_stack_java
Interview preparation full_stack_java
 
Build beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutter
 
React native
React nativeReact native
React native
 
도커 학습과 Boot2Docker
도커 학습과 Boot2Docker도커 학습과 Boot2Docker
도커 학습과 Boot2Docker
 
Native mobile application development with Flutter (Dart)
Native mobile application development with Flutter (Dart)Native mobile application development with Flutter (Dart)
Native mobile application development with Flutter (Dart)
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
 
React native
React nativeReact native
React native
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 

Viewers also liked

Cross-Platform Desktop Apps with Electron
Cross-Platform Desktop Apps with ElectronCross-Platform Desktop Apps with Electron
Cross-Platform Desktop Apps with ElectronDavid Neal
 
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)David Neal
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with ElectronBen Gotow
 
Electron. Build cross platform desktop apps with web technologies!
Electron. Build cross platform desktop apps with web technologies!Electron. Build cross platform desktop apps with web technologies!
Electron. Build cross platform desktop apps with web technologies!*instinctools
 
Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)David Neal
 
Cross-Platform Desktop Apps with Electron (Condensed Version)
Cross-Platform Desktop Apps with Electron (Condensed Version)Cross-Platform Desktop Apps with Electron (Condensed Version)
Cross-Platform Desktop Apps with Electron (Condensed Version)David Neal
 
Develop Desktop Apps with Electron
Develop Desktop Apps with ElectronDevelop Desktop Apps with Electron
Develop Desktop Apps with ElectronEueung Mulyana
 
Building Cross Platform Apps with Electron
Building Cross Platform Apps with ElectronBuilding Cross Platform Apps with Electron
Building Cross Platform Apps with ElectronChris Ward
 
Building desktop applications with web technologies - ELECTRON the easy way
Building desktop applications with web technologies - ELECTRON the easy wayBuilding desktop applications with web technologies - ELECTRON the easy way
Building desktop applications with web technologies - ELECTRON the easy waystefanjudis
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronBrainhub
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 
Take Back Project Sanity (CodeStock Edition)
Take Back Project Sanity (CodeStock Edition)Take Back Project Sanity (CodeStock Edition)
Take Back Project Sanity (CodeStock Edition)David Neal
 
Music City Code Achievement Unlocked (Friday Closing)
Music City Code Achievement Unlocked (Friday Closing)Music City Code Achievement Unlocked (Friday Closing)
Music City Code Achievement Unlocked (Friday Closing)David Neal
 
Electron 시작하기
Electron 시작하기Electron 시작하기
Electron 시작하기Hyeokjoo Yoon
 
Modern angular 04_component_router
Modern angular 04_component_routerModern angular 04_component_router
Modern angular 04_component_routerManfred Steyer
 
Confronto fra web services framework (open source)
Confronto fra web services framework (open source)Confronto fra web services framework (open source)
Confronto fra web services framework (open source)Alberto Lagna
 
Teletab - Sistema de Educação Permanente
Teletab - Sistema de Educação PermanenteTeletab - Sistema de Educação Permanente
Teletab - Sistema de Educação PermanenteMoodleSalud2013
 

Viewers also liked (20)

Cross-Platform Desktop Apps with Electron
Cross-Platform Desktop Apps with ElectronCross-Platform Desktop Apps with Electron
Cross-Platform Desktop Apps with Electron
 
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with Electron
 
Electron. Build cross platform desktop apps with web technologies!
Electron. Build cross platform desktop apps with web technologies!Electron. Build cross platform desktop apps with web technologies!
Electron. Build cross platform desktop apps with web technologies!
 
Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)
 
Cross-Platform Desktop Apps with Electron (Condensed Version)
Cross-Platform Desktop Apps with Electron (Condensed Version)Cross-Platform Desktop Apps with Electron (Condensed Version)
Cross-Platform Desktop Apps with Electron (Condensed Version)
 
Develop Desktop Apps with Electron
Develop Desktop Apps with ElectronDevelop Desktop Apps with Electron
Develop Desktop Apps with Electron
 
Building Cross Platform Apps with Electron
Building Cross Platform Apps with ElectronBuilding Cross Platform Apps with Electron
Building Cross Platform Apps with Electron
 
Building desktop applications with web technologies - ELECTRON the easy way
Building desktop applications with web technologies - ELECTRON the easy wayBuilding desktop applications with web technologies - ELECTRON the easy way
Building desktop applications with web technologies - ELECTRON the easy way
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to Electron
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
Take Back Project Sanity (CodeStock Edition)
Take Back Project Sanity (CodeStock Edition)Take Back Project Sanity (CodeStock Edition)
Take Back Project Sanity (CodeStock Edition)
 
Music City Code Achievement Unlocked (Friday Closing)
Music City Code Achievement Unlocked (Friday Closing)Music City Code Achievement Unlocked (Friday Closing)
Music City Code Achievement Unlocked (Friday Closing)
 
Advanced angular 1
Advanced angular 1Advanced angular 1
Advanced angular 1
 
Electron 시작하기
Electron 시작하기Electron 시작하기
Electron 시작하기
 
Modern angular 04_component_router
Modern angular 04_component_routerModern angular 04_component_router
Modern angular 04_component_router
 
Advanced angular 2
Advanced angular 2Advanced angular 2
Advanced angular 2
 
Confronto fra web services framework (open source)
Confronto fra web services framework (open source)Confronto fra web services framework (open source)
Confronto fra web services framework (open source)
 
Teletab - Sistema de Educação Permanente
Teletab - Sistema de Educação PermanenteTeletab - Sistema de Educação Permanente
Teletab - Sistema de Educação Permanente
 
Ch 16
Ch 16Ch 16
Ch 16
 

Similar to Desktop Apps Made Easy with Electron

Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Abdelrahman Omran
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyUlrich Krause
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionThomas Daly
 
How to Prepare Your Toolbox for the Future of SharePoint Development
How to Prepare Your Toolbox for the Future of SharePoint DevelopmentHow to Prepare Your Toolbox for the Future of SharePoint Development
How to Prepare Your Toolbox for the Future of SharePoint DevelopmentProgress
 
BelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserBelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserEamonn Boyle
 
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptxHow to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptxBOSC Tech Labs
 
Castles in the Cloud: Developing with Google App Engine
Castles in the Cloud: Developing with Google App EngineCastles in the Cloud: Developing with Google App Engine
Castles in the Cloud: Developing with Google App Enginecatherinewall
 
Documentum Spring Data
Documentum Spring DataDocumentum Spring Data
Documentum Spring DataMichael Mohen
 
Installable web applications
Installable web applicationsInstallable web applications
Installable web applicationsLiveChat
 
M365 global developer bootcamp 2019
M365 global developer bootcamp 2019M365 global developer bootcamp 2019
M365 global developer bootcamp 2019Thomas Daly
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020Katy Slemon
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakayaMbakaya Kwatukha
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material designSrinadh Kanugala
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the CloudCloudBees
 
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)VMware Tanzu
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studiobryan costanich
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 

Similar to Desktop Apps Made Easy with Electron (20)

Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easy
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
 
Kraken.js Lab Primer
Kraken.js Lab PrimerKraken.js Lab Primer
Kraken.js Lab Primer
 
How to Prepare Your Toolbox for the Future of SharePoint Development
How to Prepare Your Toolbox for the Future of SharePoint DevelopmentHow to Prepare Your Toolbox for the Future of SharePoint Development
How to Prepare Your Toolbox for the Future of SharePoint Development
 
BelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserBelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the Browser
 
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptxHow to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
 
Castles in the Cloud: Developing with Google App Engine
Castles in the Cloud: Developing with Google App EngineCastles in the Cloud: Developing with Google App Engine
Castles in the Cloud: Developing with Google App Engine
 
Documentum Spring Data
Documentum Spring DataDocumentum Spring Data
Documentum Spring Data
 
Installable web applications
Installable web applicationsInstallable web applications
Installable web applications
 
Getting Started with ASP.NET vNext
Getting Started with ASP.NET vNextGetting Started with ASP.NET vNext
Getting Started with ASP.NET vNext
 
M365 global developer bootcamp 2019
M365 global developer bootcamp 2019M365 global developer bootcamp 2019
M365 global developer bootcamp 2019
 
Top 11 Front-End Web Development Tools To Consider in 2020
 Top 11 Front-End Web Development Tools To Consider in 2020 Top 11 Front-End Web Development Tools To Consider in 2020
Top 11 Front-End Web Development Tools To Consider in 2020
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the Cloud
 
Polymer
PolymerPolymer
Polymer
 
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 

Recently uploaded

JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 

Recently uploaded (20)

JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 

Desktop Apps Made Easy with Electron

  • 1. © 2016 Priramo © 2016 Priramo By Priyaranjan Mohanty
  • 2. © 2016 Priramo2 Don’t Worry we are not going to talk Quantum Physics This is something which we will be using to create Desktop Applications
  • 3. © 2016 Priramo3 But Why to create a Desktop App ?
  • 4. © 2016 Priramo4 People are not constantly connected. They don’t want to compromise with their privacy. They like to experience faster performance. They would prefer to be the owner instead of a tenant. Sometimes there is a sophisticated client need. Most importantly its getting easier to create one now. Because
  • 5. © 2016 Priramo5 Offline Printers, Devices & Other local hardware On-Premise Internal, LOB Edit Local Files App Store Kiosk Desktop > Intranet Sometimes it “just feels right” Some of the Business Needs
  • 6. © 2016 Priramo6 Disconnected Data Entry Editor Time Management Media Player Email Client Messaging, Collaboration Mapping, Route Planner Social Media Client And many more that you can think of … Few Application Ideas Bulk Media Editor File Management, Backup Document Generation, Reading Audio, Video Conferencing Games Personal Assistant Database Client Calendar
  • 8. © 2016 Priramo8 Story of Electron Features Architecture Hello World Hello Universe Potential Roadmap Up Ahead
  • 9. © 2016 Priramo9 Story of Electron The journey of an idea to make things simple and easy.
  • 10. © 2016 Priramo10 It all started with the search for A foundation for Atom Github needed a tool to build the text editor on – with JavaScript, HTML and CSS
  • 11. © 2016 Priramo11 Path to Electron node-webkit nw.js Chromium Embedded Framework Atom Shell Electron [now] Cheng Zhao Lead Electron Developer Contributor to nw.js Github [ @zcbenz ] Tokyo, Japan
  • 12. © 2016 Priramo12 Journey of Electron so far Project Began January 2013 Open Sourced May 2014 Named Electron April 2015 Released API 1.0 June 2016
  • 13. © 2016 Priramo13 Formal Introduction Electron A framework for building cross platform desktop applications with web technology
  • 14. © 2016 Priramo14 An Artist’s Impression of Electron
  • 15. © 2016 Priramo15 Features All the cool things that are happened to be provided with electron to achieve the native behaviors.
  • 16. © 2016 Priramo16 Core Features Web Technology HTML, CSS, JS Latest & Greatest All the chrome goodies No Native Skills Unless you want to One Browser Design once
  • 17. © 2016 Priramo17 Core Features File System All of Node.js APIs Three Platforms Windows, Mac OS X, Linux Modules npm ecosystem Native Menu Dialogs & Notifications
  • 18. © 2016 Priramo18 Core Features Windows Installers No Configuration Automatic Updates Mac & Windows with Squirrel Crash Reporting Submit to Remote Server Debugging & Profiling Content tracing by Chromium
  • 19. © 2016 Priramo19 Architecture Explore the magic box of electron to understand the components and processes underneath
  • 21. © 2016 Priramo21 Chromium • The open-source web browser project from Google. • Provides tabbed window manager, or shell for the web. • Have a minimalist user interface. • Uses V8 as the JavaScript engine. • Uses Blink as the layout engine. • Electron uses content module/content API.
  • 22. © 2016 Priramo22 Node JS • An open-source JavaScript runtime. • Uses V8 JavaScript engine. • Enables you to run JavaScript outside the browser. • Provides an interactive shell (REPL: read-eval-print-loop) where you can execute raw JavaScript code. • Uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. • Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  • 23. © 2016 Priramo23 V8 JavaScript Engine • An open-source JavaScript Engine developed by The Chromium Project. • Written in C++ and JavaScript. • Implements ECMAScript as specified in ECMA-262, 3rd edition. • Runs on Windows XP or later, Mac OS X 10.5+, and Linux systems that use IA-32, ARM or MIPS processors. • Compiles JavaScript into native machine codes.
  • 24. © 2016 Priramo24 The Two Processes Main Application Lifecycle Renderer Web Page Node.js APIs ipc Electron APIs ipc DOM Node.js APIsElectron APIs Creates Communicates
  • 25. © 2016 Priramo25 The Two Processes Main Renderer Renderer Renderer Renderer App Web Page
  • 26. © 2016 Priramo26 The Two Processes Chrome File Edit View Main Chrome Renderer Each Tab Older Versions Newer Versions
  • 27. © 2016 Priramo27 Hello World Let’s build the very first desktop application using electron and get started.
  • 28. © 2016 Priramo28 Getting Started package.json main.js index.html
  • 29. © 2016 Priramo29 package.json { "name" : "hello-world-app", "version": "0.1.0", "main" : "main.js" }
  • 30. © 2016 Priramo30 main.js (Main Process) const electron = require('electron'); const app = electron.app const BrowserWindow = electron.BrowserWindow let mainWindow = null; app.on('ready', function() { mainWindow = new BrowserWindow({width: 800, height:600}); mainWindow.loadURL('file://' + __dirname + '/index.html'); mainWindow.on('closed', function () { mainWindow = null }) })
  • 31. © 2016 Priramo31 index.html (Renderer Process) <html> <head> <script> window.onload = function() { var fs = require('fs') var p = document.createElement('p') p.textContent = fs.readFileSync('dataFile.txt') document.body.appendChild(p) } </script> </head> <body> <h1>Hello World</h1> </body> </html>
  • 32. © 2016 Priramo32 Global Electron npm install –g electron electron .
  • 34. © 2016 Priramo34 Power of Chrome to the App
  • 35. © 2016 Priramo35 Hello Universe Deep dive into the electron ecosystem
  • 36. © 2016 Priramo36 Electron APIs Main Process app BrowserWindow Dialog ipcMain MenuItem powerSaverBlocker systemPreferences Tray and more … Renderer Process desktopCapturer File Object ipcRenderer remote webFrame <webview> Tag window.open function Both Process clipboard crashReporter Environment Variables nativeImage Process screen shell Synopsis
  • 37. © 2016 Priramo37 Hard Things Made Easy const {BrowserWindow} = require('electron') let win = new BrowserWindow({transparent: true, frame: false}) win.show() globalShortcut.register('CommandOrControl+Shift+J', () => { mainWindow.webContents.toggleDevTools(); }) app.on('will-quit', () => { globalShortcut.unregisterAll() }) Accelerators can contain multiple modifiers and key codes, combined by the + character.
  • 38. © 2016 Priramo38 Hard Things Made Easy crashReporter.start({ productName: 'YourName', companyName: 'YourCompany', submitURL: 'https://your-domain.com/url-to-submit', autoSubmit: true }) shell.moveItemToTrash('someFile.txt') shell.openExternal('https://github.com')
  • 39. © 2016 Priramo39 Hard Things Made Easy (ipc) // In main process. const {ipcMain} = require('electron') ipcMain.on('asynchronous-message', (event, arg) => { console.log(arg) // prints "ping" event.sender.send('asynchronous-reply', 'pong') }) ipcMain.on('synchronous-message', (event, arg) => { console.log(arg) // prints "ping" event.returnValue = 'pong' }) ipcMain Communicate asynchronously from the main process to renderer processes.
  • 40. © 2016 Priramo40 Hard Things Made Easy (ipc) ipcRenderer Communicate asynchronously from a renderer process to the main process. // In renderer process (web page). const {ipcRenderer} = require('electron') // prints "pong" to be returned from ipcMain console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) ipcRenderer.on('asynchronous-reply', (event, arg) => { console.log(arg) // prints "pong" }) ipcRenderer.send('asynchronous-message', 'ping')
  • 41. © 2016 Priramo41 Electron Tools electron-prebuilt Install prebuilt Electron binaries for command-line use using npm. electron-compile Use ES2015, CoffeeScript, LESS, SCSS in your app without a pre-compilation step. electron-packager Package and distribute your app. devtron Official DevTools extension. Provides features to debug all electron components. spectron Test Electron apps using ChromeDriver.
  • 42. © 2016 Priramo42 Bolierplates electron-quick-start Clone the repo to try a simple app. electron-boilerplate Comprehensive boilerplate by szwacz which even generates installers. bozon Scaffold, run, test, and package your app. SkelEktron A ready to go app template with some useful features built-in like logger, builder & updater etc. electron-react-boilerplate Boilerplate based on React and webpack.
  • 43. © 2016 Priramo43 Useful Components React Desktop UI toolkit for macOS and Windows built with React. cookies Adds support for 'document.cookie'. chrome-tabs Chrome like tabs. menubar High-level way to create a menubar app. Photon UI toolkit for building beautiful apps.
  • 45. © 2016 Priramo45 Potential Initially developed for GitHub's Atom editor, Electron has since been used to create applications by many.
  • 46. © 2016 Priramo46 Impactful Footprints Atom By Github
  • 47. © 2016 Priramo47 Impactful Footprints Slack Desktop App By Slack
  • 48. © 2016 Priramo48 Impactful Footprints Visual Studio Code By Microsoft
  • 49. © 2016 Priramo49 Impactful Footprints WordPress Desktop App By WordPress
  • 50. © 2016 Priramo50 Impactful Footprints Postman
  • 51. © 2016 Priramo51 Impactful Footprints WhatsApp
  • 52. © 2016 Priramo52 Impactful Footprints Hive Kitematic Wagon ScreenCat Mojibar WebTorrent PhoneGap Ionic Lab Avocode Nuclide Pixate Tofino Play Music Netbeast Sencha Test Nylas N1 AirTame GitKraken Jibo Gif Maker
  • 53. © 2016 Priramo53 Roadmap Present state and future scope of improvement
  • 54. © 2016 Priramo54 Electron Downloads 500K 1M 1.2M 4.23.2015 Atom Shell get renamed to Electron 2016
  • 55. © 2016 Priramo55 Github Stats as of now 8 branches 11,000+ commits 248 releases 450+ contributors 4,000+ forks 300+ open issues 10+ open pull requests 1,700+ watchers 35,900+ stars 4,500+ closed issues 2,300+ closed pull requests and counting…
  • 56. © 2016 Priramo56 Items in line Chrome Web Push support. Google Cast (Chromecast) in Electron. Better support for Linux ARM machines. Implementation of V8 inspector '--inspect‘. Enhancements of dialog and menu management. APIs to control system's onscreen keyboard. Feature to add header and footer content for PDF. Run electron renderers inside chromium sandbox. And many more…
  • 57. © 2016 Priramo57 References Chromium http://blog.chromium.org/ https://www.chromium.org/developers/design-documents https://chromium.googlesource.com/chromium/src/+/lkgr/docs Node.js https://en.wikipedia.org/wiki/Node.js#Technical_details https://nodejs.org/api/ http://blog.modulus.io/absolute-beginners-guide-to-nodejs V8 JavaScript Engine http://v8-io12.appspot.com/ http://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/ https://en.wikipedia.org/wiki/V8_(JavaScript_engine) https://github.com/eclipsesource/j2v8
  • 58. © 2016 Priramo58 Resources Electron http://electron.atom.io/ https://github.com/sindresorhus/awesome-electron Discuss: https://discuss.atom.io/c/electron Slack: http://atom-slack.herokuapp.com/ @ElectronJS: https://twitter.com/ElectronJS Email: electron@github.com https://app.pluralsight.com/library/courses/electron-playbook/table-of-contents https://medium.com/developers-writing/building-a-desktop-application-with-electron-204203eeb658 https://www.toptal.com/javascript/electron-cross-platform-desktop-apps-easy Study Materials
  • 59. © 2016 Priramo59 Most things were Before they became EASY