SlideShare a Scribd company logo
1 of 39
Download to read offline
Building a Desktop
Streaming console with
Electron and ReactJS
Playing with HTML, JS and CSS out of the
sandbox
W W W. S P R E A K E R .C O M
Who am i?
Emanuele Rampichini
• Software engineer @spreaker
• JavaScript enthusiast
• Github pusher on https://github.com/lele85
• “Not so active” tweeting bird @emauele_r
• Mountain Bike Lover
W W W. S P R E A K E R .C O M
Who are you?
• Software engineer @{companyName}
• JavaScript enthusiasts
• Github pushers on https://github.com/{{githubUsername}}
• “{{very || notSo}} active” tweeting birds @{{twitterHandle}}
• {{otherUnrelatedPassion}} Lover
W W W. S P R E A K E R .C O M
Why are you here listening to me?
• You don’t know
• You are not listening
• You have to change 6 trains to get home, it’s gonna be a long way back so
you think that a 45 minutes nap is a good idea.
• You want to build a cross platform
“Real World Desktop Application”™
using JavaScript
W W W. S P R E A K E R .C O M
How much“Real World”™
W W W. S P R E A K E R .C O M
How much“Real World”™
W W W. S P R E A K E R .C O M
How much“Real World”™
W W W. S P R E A K E R .C O M
How much“Real World”™
W W W. S P R E A K E R .C O M
How much“Real World”™
W W W. S P R E A K E R .C O M
“
Use HTML, CSS, and JavaScript with Chromium
and Node.js to build your app.
nw.js or Electron?
W W W. S P R E A K E R .C O M
Our winner was?
Faster, Stronger… Better (cit.)
npm install -g electron
W W W. S P R E A K E R .C O M
package.json main_process
renderer_process
W W W. S P R E A K E R .C O M
this looks very interesting given the
state of modern frontend tools
W W W. S P R E A K E R .C O M
basically you are writing a
client app…
• ReactJS
• SystemJS
• JSPM
• Babel
• other libs (moment, underscore, emojione, url,
reconfig, analytics* etc…)
W W W. S P R E A K E R .C O M
WHY React.js
• Unopinionated render engine for the DOM
• Can be fast enough… try to do 16ms render loop
with angular bidirectional binding
• Battle tested by Facebook
W W W. S P R E A K E R .C O M
HOW React.js
• Multiple store single dispatcher flux architecture “for
something" (USER ACTIONS, WEB API, PUSH
NOTIFICATION)
• We rolled out our solution for specific tasks (EVENT
EMITTERS, FINITE STATE MACHINES)
W W W. S P R E A K E R .C O M
Why we used stateful
components
• Sateless components are cool but sometimes you just
need trade purity for performance
W W W. S P R E A K E R .C O M
SystemJS + JSPM
Universal dynamic module loader - loads ES6 modules,
AMD, CommonJS and global scripts in the browser and
NodeJS. Works with both Traceur and Babel.
jspm is a package manager for the SystemJS universal
module loader, built on top of the dynamic ES6 module
loader
W W W. S P R E A K E R .C O M
SystemJS
• Unopinionated (not a client tool)
• Understands dependencies tree
• Dependencies versioning done right (can you hear
me npm?)
• Can do client side transpiling* (keep an eye on
performance here)
• Has an advanced bundler for production (transpiling,
minification, bundle arithmetic)
W W W. S P R E A K E R .C O M
JSPM
• jspm init
• jspm install
• jspm bundle
You can have ES6 ready environment ready in two
minutes*.
* Beware the automagic beast… could bite you :)
https://www.youtube.com/watch?v=NpMnRifyGyw
W W W. S P R E A K E R .C O M
back to electron…you can use your
loved chrome dev tools
W W W. S P R E A K E R .C O M
…you can leverage desktop
integration
• Menu
• Notifications
• Shortcuts
• Multiple displays
• …
W W W. S P R E A K E R .C O M
you can go down a bit…
RPC server
to expose
app API
use raw
sockets
W W W. S P R E A K E R .C O M
…you can get more from chromium
https://github.com/atom/electron/blob/master/docs/api/
chrome-command-line-switches.md
http://peter.sh/experiments/chromium-command-
line-switches/
W W W. S P R E A K E R .C O M
…or you can start digging“into the
rabbit hole”
Electron is moving faaaast, use NaN to write
add-ons, dynamic libs can give you headaches
W W W. S P R E A K E R .C O M
…you can unit test inside the
electron environment
https://github.com/lele85/karma-electron-launcher
W W W. S P R E A K E R .C O M
…you have autoupdates
out of the box*
* Works only with signed app, works in a different way on
windows
Single script on a
server returning
update zip uri and
metadata
W W W. S P R E A K E R .C O M
native crash reports are
super easy to collect and test!
Every native crash (out of memory, segmentation faults)
electron send a POST to configured submitUrl with:
platform informations
memory dump in minidump format
W W W. S P R E A K E R .C O M
… not so easy to decode :)
For each version you deliver you need to get electron
debug symbols from project release page
Generate symbols for your native libs with breakpad
tool dump_syms*
Put them in a folder (with a standard structure) and use
minidump_stackwalk* to symbolize them in a correct
way
* you can build these tools from break pad source tree
W W W. S P R E A K E R .C O M
keep in mind something about
desktop apps…
Given: 2 operating systems
And: 10 os versions to support
And: a lot of different hardware
And: a lot of USB devices someone can plug
And: ∞ trash software common user can install
Then: YOUR APP WILL ALWAYS FAIL
W W W. S P R E A K E R .C O M
…act accordingly
• gather all data you can on the host pc
• log on filesystem (log4js, Dispatcher)
• set up a server side issue reporting API
• dont’t assume anything about application state when
something goes terribly wrong
• monitor (universal analytics to the rescue)
W W W. S P R E A K E R .C O M
you can add branding and package your
app for mac and windows in a breeze
https://github.com/atom/grunt-electron-installer
https://github.com/maxogden/electron-packager
W W W. S P R E A K E R .C O M
you can distribute your code in a
“safe way”
Inside electron you can treat your asar bundle as a normal
directory. (you may want to uglify/obfuscate your code)
W W W. S P R E A K E R .C O M
all these things makes me very
happy!
W W W. S P R E A K E R .C O M
Sadly electron has some
downsides…
• You are bundling Chromium with every update.
compressed app size is around 40MB
• You can’t hit Mac App Store and Windows
Marketplace
• Sometimes you have to dig into tools source code
(this can be fun) and spend time on github project
issue tracker
W W W. S P R E A K E R .C O M
but…
• It worked for us
• Makes desktop development fun
• Makes desktop development fast.
W W W. S P R E A K E R .C O M
It worked for us
• 22k downloads in 16 days
• now 800 downloads per day
• 25k sessions (mean time 1h 30m)
• 11 releases delivered via autoupdate
(1.0.0 => 1.0.11)
Thanks!
I broadcasted this talk to my colleagues
using the product we built :)
W W W. S P R E A K E R .C O M
One more thing…
https://www.spreaker.com/jobs

More Related Content

What's hot

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
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronLukas Ruebbelke
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with ElectronBen Gotow
 
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
 
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
 
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)Eddie Lau
 
.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!Rodrigo Kono
 
Drupal RPG - A Backend Server Story
Drupal RPG - A Backend Server StoryDrupal RPG - A Backend Server Story
Drupal RPG - A Backend Server StoryEladio Jose Abquina
 
Simplicity - develop modern web apps with tiny frameworks and tools
Simplicity - develop modern web apps with tiny frameworks and toolsSimplicity - develop modern web apps with tiny frameworks and tools
Simplicity - develop modern web apps with tiny frameworks and toolsRui Carvalho
 
Lessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLior Tal
 
Configuration primer
Configuration primerConfiguration primer
Configuration primerfeanil
 
Testing your Single Page Application
Testing your Single Page ApplicationTesting your Single Page Application
Testing your Single Page ApplicationWekoslav Stefanovski
 
Making Windows Reasonable
Making Windows ReasonableMaking Windows Reasonable
Making Windows ReasonableBryan Phelps
 
Introduction to Phoenix Web Framework
Introduction to Phoenix Web FrameworkIntroduction to Phoenix Web Framework
Introduction to Phoenix Web FrameworkRiza Fahmi
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingRami Sayar
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttackKyle Drake
 

What's hot (20)

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)
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and Electron
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences 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
 
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)
 
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
Native Desktop App with Node.js Webkit (HTML, CSS & Javascript)
 
.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Drupal RPG - A Backend Server Story
Drupal RPG - A Backend Server StoryDrupal RPG - A Backend Server Story
Drupal RPG - A Backend Server Story
 
Simplicity - develop modern web apps with tiny frameworks and tools
Simplicity - develop modern web apps with tiny frameworks and toolsSimplicity - develop modern web apps with tiny frameworks and tools
Simplicity - develop modern web apps with tiny frameworks and tools
 
From Web to Mobile with Stage 3D
From Web to Mobile with Stage 3DFrom Web to Mobile with Stage 3D
From Web to Mobile with Stage 3D
 
Ten years later
Ten years laterTen years later
Ten years later
 
Automation
AutomationAutomation
Automation
 
Lessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGL
 
Configuration primer
Configuration primerConfiguration primer
Configuration primer
 
Testing your Single Page Application
Testing your Single Page ApplicationTesting your Single Page Application
Testing your Single Page Application
 
Making Windows Reasonable
Making Windows ReasonableMaking Windows Reasonable
Making Windows Reasonable
 
Introduction to Phoenix Web Framework
Introduction to Phoenix Web FrameworkIntroduction to Phoenix Web Framework
Introduction to Phoenix Web Framework
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttack
 

Similar to Building a Desktop Streaming console with Electron and ReactJS

C++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserC++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserAndre Weissflog
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Developmentallingeek
 
LXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous DeliveryLXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous DeliveryDocker, Inc.
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assemblyShakacon
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5David Voyles
 
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?Albert Mietus
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.jsPrabin Silwal
 
WebAssembly - czy dzisiaj mi się to przyda do pracy?
WebAssembly - czy dzisiaj mi się to przyda do pracy?WebAssembly - czy dzisiaj mi się to przyda do pracy?
WebAssembly - czy dzisiaj mi się to przyda do pracy?Brainhub
 
Learn Electron for Web Developers
Learn Electron for Web DevelopersLearn Electron for Web Developers
Learn Electron for Web DevelopersKyle Cearley
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLMario-Leander Reimer
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureQAware GmbH
 
TestUpload
TestUploadTestUpload
TestUploadZarksaDS
 
Continuous integration by Rémy Virin
Continuous integration by Rémy VirinContinuous integration by Rémy Virin
Continuous integration by Rémy VirinCocoaHeads France
 
electron for emberists
electron for emberistselectron for emberists
electron for emberistsAidan Nulman
 
Docker in development
Docker in developmentDocker in development
Docker in developmentsethvoltz
 

Similar to Building a Desktop Streaming console with Electron and ReactJS (20)

C++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserC++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browser
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
 
LXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous DeliveryLXC to Docker Via Continuous Delivery
LXC to Docker Via Continuous Delivery
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assembly
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
Effective C++
Effective C++Effective C++
Effective C++
 
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.js
 
WebAssembly - czy dzisiaj mi się to przyda do pracy?
WebAssembly - czy dzisiaj mi się to przyda do pracy?WebAssembly - czy dzisiaj mi się to przyda do pracy?
WebAssembly - czy dzisiaj mi się to przyda do pracy?
 
WebAssemlby vs JavaScript
WebAssemlby vs JavaScriptWebAssemlby vs JavaScript
WebAssemlby vs JavaScript
 
Learn Electron for Web Developers
Learn Electron for Web DevelopersLearn Electron for Web Developers
Learn Electron for Web Developers
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
TestUpload
TestUploadTestUpload
TestUpload
 
Continuous integration by Rémy Virin
Continuous integration by Rémy VirinContinuous integration by Rémy Virin
Continuous integration by Rémy Virin
 
electron for emberists
electron for emberistselectron for emberists
electron for emberists
 
Node azure
Node azureNode azure
Node azure
 
Docker in development
Docker in developmentDocker in development
Docker in development
 
Node.js debugging
Node.js debuggingNode.js debugging
Node.js debugging
 

More from Emanuele Rampichini

What is quality? Why should i care?
What is quality? Why should i care? What is quality? Why should i care?
What is quality? Why should i care? Emanuele Rampichini
 
I segreti di una campagna di crowdfunding civico di successo
I segreti di una campagna di crowdfunding civico di successoI segreti di una campagna di crowdfunding civico di successo
I segreti di una campagna di crowdfunding civico di successoEmanuele Rampichini
 
Lavorare con tecnologie "Cool" senza rinunciare all'accessibilità
Lavorare con tecnologie "Cool" senza rinunciare all'accessibilitàLavorare con tecnologie "Cool" senza rinunciare all'accessibilità
Lavorare con tecnologie "Cool" senza rinunciare all'accessibilitàEmanuele Rampichini
 
How to push a react js application in production and sleep better
How to push a react js application in production and sleep betterHow to push a react js application in production and sleep better
How to push a react js application in production and sleep betterEmanuele Rampichini
 
Speed up your Titanium app development with automated tests - TiConf EU 2014
Speed up your Titanium app development with automated tests - TiConf EU 2014Speed up your Titanium app development with automated tests - TiConf EU 2014
Speed up your Titanium app development with automated tests - TiConf EU 2014Emanuele Rampichini
 
AngularDevConf - Tools and testing
AngularDevConf - Tools and testingAngularDevConf - Tools and testing
AngularDevConf - Tools and testingEmanuele Rampichini
 
Coderetreat 2013 @cowo42 (Osimo - AN)
Coderetreat 2013 @cowo42 (Osimo - AN)Coderetreat 2013 @cowo42 (Osimo - AN)
Coderetreat 2013 @cowo42 (Osimo - AN)Emanuele Rampichini
 

More from Emanuele Rampichini (7)

What is quality? Why should i care?
What is quality? Why should i care? What is quality? Why should i care?
What is quality? Why should i care?
 
I segreti di una campagna di crowdfunding civico di successo
I segreti di una campagna di crowdfunding civico di successoI segreti di una campagna di crowdfunding civico di successo
I segreti di una campagna di crowdfunding civico di successo
 
Lavorare con tecnologie "Cool" senza rinunciare all'accessibilità
Lavorare con tecnologie "Cool" senza rinunciare all'accessibilitàLavorare con tecnologie "Cool" senza rinunciare all'accessibilità
Lavorare con tecnologie "Cool" senza rinunciare all'accessibilità
 
How to push a react js application in production and sleep better
How to push a react js application in production and sleep betterHow to push a react js application in production and sleep better
How to push a react js application in production and sleep better
 
Speed up your Titanium app development with automated tests - TiConf EU 2014
Speed up your Titanium app development with automated tests - TiConf EU 2014Speed up your Titanium app development with automated tests - TiConf EU 2014
Speed up your Titanium app development with automated tests - TiConf EU 2014
 
AngularDevConf - Tools and testing
AngularDevConf - Tools and testingAngularDevConf - Tools and testing
AngularDevConf - Tools and testing
 
Coderetreat 2013 @cowo42 (Osimo - AN)
Coderetreat 2013 @cowo42 (Osimo - AN)Coderetreat 2013 @cowo42 (Osimo - AN)
Coderetreat 2013 @cowo42 (Osimo - AN)
 

Recently uploaded

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 

Recently uploaded (20)

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 

Building a Desktop Streaming console with Electron and ReactJS

  • 1. Building a Desktop Streaming console with Electron and ReactJS Playing with HTML, JS and CSS out of the sandbox
  • 2. W W W. S P R E A K E R .C O M Who am i? Emanuele Rampichini • Software engineer @spreaker • JavaScript enthusiast • Github pusher on https://github.com/lele85 • “Not so active” tweeting bird @emauele_r • Mountain Bike Lover
  • 3. W W W. S P R E A K E R .C O M Who are you? • Software engineer @{companyName} • JavaScript enthusiasts • Github pushers on https://github.com/{{githubUsername}} • “{{very || notSo}} active” tweeting birds @{{twitterHandle}} • {{otherUnrelatedPassion}} Lover
  • 4. W W W. S P R E A K E R .C O M Why are you here listening to me? • You don’t know • You are not listening • You have to change 6 trains to get home, it’s gonna be a long way back so you think that a 45 minutes nap is a good idea. • You want to build a cross platform “Real World Desktop Application”™ using JavaScript
  • 5. W W W. S P R E A K E R .C O M How much“Real World”™
  • 6. W W W. S P R E A K E R .C O M How much“Real World”™
  • 7. W W W. S P R E A K E R .C O M How much“Real World”™
  • 8. W W W. S P R E A K E R .C O M How much“Real World”™
  • 9. W W W. S P R E A K E R .C O M How much“Real World”™
  • 10. W W W. S P R E A K E R .C O M “ Use HTML, CSS, and JavaScript with Chromium and Node.js to build your app. nw.js or Electron?
  • 11. W W W. S P R E A K E R .C O M Our winner was? Faster, Stronger… Better (cit.) npm install -g electron
  • 12. W W W. S P R E A K E R .C O M package.json main_process renderer_process
  • 13. W W W. S P R E A K E R .C O M this looks very interesting given the state of modern frontend tools
  • 14. W W W. S P R E A K E R .C O M basically you are writing a client app… • ReactJS • SystemJS • JSPM • Babel • other libs (moment, underscore, emojione, url, reconfig, analytics* etc…)
  • 15. W W W. S P R E A K E R .C O M WHY React.js • Unopinionated render engine for the DOM • Can be fast enough… try to do 16ms render loop with angular bidirectional binding • Battle tested by Facebook
  • 16. W W W. S P R E A K E R .C O M HOW React.js • Multiple store single dispatcher flux architecture “for something" (USER ACTIONS, WEB API, PUSH NOTIFICATION) • We rolled out our solution for specific tasks (EVENT EMITTERS, FINITE STATE MACHINES)
  • 17. W W W. S P R E A K E R .C O M Why we used stateful components • Sateless components are cool but sometimes you just need trade purity for performance
  • 18. W W W. S P R E A K E R .C O M SystemJS + JSPM Universal dynamic module loader - loads ES6 modules, AMD, CommonJS and global scripts in the browser and NodeJS. Works with both Traceur and Babel. jspm is a package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader
  • 19. W W W. S P R E A K E R .C O M SystemJS • Unopinionated (not a client tool) • Understands dependencies tree • Dependencies versioning done right (can you hear me npm?) • Can do client side transpiling* (keep an eye on performance here) • Has an advanced bundler for production (transpiling, minification, bundle arithmetic)
  • 20. W W W. S P R E A K E R .C O M JSPM • jspm init • jspm install • jspm bundle You can have ES6 ready environment ready in two minutes*. * Beware the automagic beast… could bite you :) https://www.youtube.com/watch?v=NpMnRifyGyw
  • 21. W W W. S P R E A K E R .C O M back to electron…you can use your loved chrome dev tools
  • 22. W W W. S P R E A K E R .C O M …you can leverage desktop integration • Menu • Notifications • Shortcuts • Multiple displays • …
  • 23. W W W. S P R E A K E R .C O M you can go down a bit… RPC server to expose app API use raw sockets
  • 24. W W W. S P R E A K E R .C O M …you can get more from chromium https://github.com/atom/electron/blob/master/docs/api/ chrome-command-line-switches.md http://peter.sh/experiments/chromium-command- line-switches/
  • 25. W W W. S P R E A K E R .C O M …or you can start digging“into the rabbit hole” Electron is moving faaaast, use NaN to write add-ons, dynamic libs can give you headaches
  • 26. W W W. S P R E A K E R .C O M …you can unit test inside the electron environment https://github.com/lele85/karma-electron-launcher
  • 27. W W W. S P R E A K E R .C O M …you have autoupdates out of the box* * Works only with signed app, works in a different way on windows Single script on a server returning update zip uri and metadata
  • 28. W W W. S P R E A K E R .C O M native crash reports are super easy to collect and test! Every native crash (out of memory, segmentation faults) electron send a POST to configured submitUrl with: platform informations memory dump in minidump format
  • 29. W W W. S P R E A K E R .C O M … not so easy to decode :) For each version you deliver you need to get electron debug symbols from project release page Generate symbols for your native libs with breakpad tool dump_syms* Put them in a folder (with a standard structure) and use minidump_stackwalk* to symbolize them in a correct way * you can build these tools from break pad source tree
  • 30. W W W. S P R E A K E R .C O M keep in mind something about desktop apps… Given: 2 operating systems And: 10 os versions to support And: a lot of different hardware And: a lot of USB devices someone can plug And: ∞ trash software common user can install Then: YOUR APP WILL ALWAYS FAIL
  • 31. W W W. S P R E A K E R .C O M …act accordingly • gather all data you can on the host pc • log on filesystem (log4js, Dispatcher) • set up a server side issue reporting API • dont’t assume anything about application state when something goes terribly wrong • monitor (universal analytics to the rescue)
  • 32. W W W. S P R E A K E R .C O M you can add branding and package your app for mac and windows in a breeze https://github.com/atom/grunt-electron-installer https://github.com/maxogden/electron-packager
  • 33. W W W. S P R E A K E R .C O M you can distribute your code in a “safe way” Inside electron you can treat your asar bundle as a normal directory. (you may want to uglify/obfuscate your code)
  • 34. W W W. S P R E A K E R .C O M all these things makes me very happy!
  • 35. W W W. S P R E A K E R .C O M Sadly electron has some downsides… • You are bundling Chromium with every update. compressed app size is around 40MB • You can’t hit Mac App Store and Windows Marketplace • Sometimes you have to dig into tools source code (this can be fun) and spend time on github project issue tracker
  • 36. W W W. S P R E A K E R .C O M but… • It worked for us • Makes desktop development fun • Makes desktop development fast.
  • 37. W W W. S P R E A K E R .C O M It worked for us • 22k downloads in 16 days • now 800 downloads per day • 25k sessions (mean time 1h 30m) • 11 releases delivered via autoupdate (1.0.0 => 1.0.11)
  • 38. Thanks! I broadcasted this talk to my colleagues using the product we built :)
  • 39. W W W. S P R E A K E R .C O M One more thing… https://www.spreaker.com/jobs