Dnepr JS Club #2
Speaker - Дмитрий Васин [full stack разработчик Anadea Inc.]
Тема: "Electron: Разработка Desktop приложений используя HTML, CSS и JavaScript"
"В этом докладе я опишу возможность создания красивых, крос-платформенных десктопных приложений используя современный стек технологий и веб-инструменты. Я покажу как разработать десктопное приложение используя HTML, CSS, and JavaScript. Рассмотрим:
- что это и зачем это нужно
- как это работает
- плюсы такой разработки
- фатальные минусы
- итоги"
4. Who is this presentation for?
× Non-technical users
× People interested in Electron
× People who want to Show & Sell a platform
× Javascript enthusiasts
Who already works with Electron?
5. What will we discuss?
× What is Electron
× Why do I need it?
× How Electron works
× Perks
× Known problems
× Conclusions
6. Cross Platform
Compatible with Mac, Windows,
and Linux, Electron apps build
and run on three platforms.
What is Electron?
Web Technologies
Electron uses Chromium and
Node.js so you can build your
app with HTML, CSS, and
JavaScript.
Open Source
Electron is an open source
project maintained by GitHub
and an active community of
contributors
16. × Offline (State, Settings)
× Access to FileSystem ( Store Files )
× Native Access ( Printer & Devices )
× Native Experience ( Dock, Toolbar, Menu bar )
× Data Storage ( data store, SQLite, N1 )
× SaaS
× Fill natural for users
why desktop?
17. × Work with files
× In Tray-apps
× “Manager” apps (Time, Tracker, Pomodoro)
× Audio/Video players ( Player, Dropbox)
× Email Client
× Social Chats ( API )
× Calendars
× Specific Ideas
What can we do with electron?
18. What SHOUld we not do with Electron?
× Apps on Specific Versions of OS
× Browser-like Apps
× Apps that use native a lot
× Web is better
19. for UI
for three systems
Inside Electron:
for filesystem
and networks
20. × BrowserWindow (UI)
× Any Number of processes
× Can be hidden
× Node-like (No UI)
× Life Cycle ( open/close )
× OS integration
× Create Renderer Processes
Renderer Process:
is responsible for running the
user-interface of your app
Main Process:
is responsible for creating and
managing the BrowserWindow
and various application events
(lifecycle).
Based on two type of processes:
How IT WORKS? ( Basic Concepts )
30. Web Nature:
× HTML + CSS + JS
× Only Chrome. No Safari, No IE
× Chrome Devtools (*)
× Web as UI ( 20 years * )
× Libs - Isotope, Highcharts
× Rapid feature Development
Power of electron apps ( Perks )
31. Node:
× NPM
× Native packages
Web Nature:
× HTML + CSS + JS
× Only Chrome. No Safari, No IE
× Chrome Devtools (*)
× Web as UI ( 20 years * )
× Libs - Isotope, Highcharts
× Rapid feature Development
Power of electron apps ( Perks )
32. Build your idea NOW!
Node:
× NPM
× Native packages
Web Nature:
× HTML + CSS + JS
× Only Chrome. No Safari, No IE
× Chrome Devtools (*)
× Web as UI ( 20 years * )
× Libs - Isotope, Highcharts
× Rapid feature Development
Power of electron apps ( Perks )
33. Node:
× NPM
× Native packages (Slack)
Web Nature:
× HTML + CSS + JS
× Only Chrome. No Safari, No IE
× Chrome Devtools (*)
× Web as UI ( 20 years * )
× Libs - Isotope, Highcharts
× Rapid feature Development
Power of electron apps ( Perks )
34. Node:
× NPM
× Native packages
Web Nature:
× HTML + CSS + JS
× Only Chrome. No Safari, No IE
× Chrome Devtools (*)
× Web as UI ( 20 years * )
× Libs - Isotope, Highcharts
× Rapid feature Development
Power of electron apps ( Perks )
Common:
× JS language and community (*)
× Same codebase for all platforms.
× Cross-platform ( Node + Chrome )
× Cost of development
× Free
× No C++, No Swift, No C#
35. Modern stack:
× React (Angular )
× TypeScript ( FLOW )
× ASYNC / AWAIT
× ES2016 ( No babel )
× Forget about Polyfills
Power of electron apps ( Bonus)
36. Only modern stack:
× React (Angular )
× TypeScript ( FLOW )
× ASYNC / AWAIT
× ES2016 ( No babel )
× Forget about Polyfills
Power of electron apps ( moreover )
Open Source:
× Developed & Supported
with ❤ by GitHub
× Node
× Chromium
37. Latest features:
× Detect Location
× Webcam
× WebRTC
× CSS custom properties
× CSS Grid
Only modern stack:
× React (Angular )
× TypeScript ( FLOW )
× ASYNC / AWAIT
× ES2016 ( No babel )
× Forget about Polyfills
Power of electron apps ( moreover )
Open Source:
× Developed & Supported
with ❤ by GitHub
× Node
× Chromium
38. Latest features:
× Detect Location
× Webcam
× WebRTC
× CSS custom properties
× CSS Grid
Only modern stack:
× React (Angular )
× TypeScript ( FLOW )
× ASYNC / AWAIT
× ES2016 ( No babel )
× Forget about Polyfills
Power of electron apps ( moreover )
Open Source:
× Developed & Supported
with ❤ by GitHub
× Node
× Chromium
Electron features
× Installer
× Auto updater
× Packaging
× Crash reporting
× Mac and Win store
× Devtron for Debug
40. Known problems:
Trade offs:
× Node + Chrome ( 20 million LOC )
× Project Weight ( 100mb )
× Render process spawn thread ( will kill memory )
× Boot Time
× Not all platforms have the same possibilities
× Code Protection
× Lack of Framework features
× Node packages
× Cross platform: heaven or hell?
× Not so perfect ( Autoupdater, Packager )
41. Known problems:
Trade off:
× Node + Chrome ( 20 million LOC )
× Project Weight ( 100mb )
× Render process spawn thread ( Will kill memory )
× Boot Time
× Not same ability for all platforms
× Code Protection
× Lack of Framework features
× Node packages
× Cross platform: goodness or hell?
× Not so perfect ( Autoupdater, Packager )
42. Known problems:
Trade off:
× Node + Chrome ( 20 million LOC )
× Project Weight ( 100mb )
× Render process spawn thread ( Will kill memory )
× Boot Time
× Not same ability for all platforms
× Code Protection
× Lack of Framework features
× Node packages
× Cross platform: goodness or hell?
× Not so perfect ( Autoupdater, Packager )
43. Known problems:
Trade off:
× Node + Chrome ( 20 million LOC )
× Project Weight ( 100mb )
× Render process spawn thread ( Will kill memory )
× Boot Time
× Not same ability for all platforms
× Code Protection
× Lack of Framework features
× Node packages
× Cross platform: goodness or hell?
× Not so perfect ( Autoupdater, Packager )
44. Are these problems with Electron?
× Is it an electron issue?
× UI work in browser!
× Async Programming
× Offload computationally-intensive work
× Don’t Block the UI Thread OR the Main Thread
× Use Chrome Devtools ( Profiling )
× Bad Code.