Slide 1

Slide 1 text

Using Electron & React to Build N1: The Open Source Email Client Evan Morikawa | @e0m | [email protected] | May 14 2016 Nylas

Slide 2

Slide 2 text

Standing on the shoulders of giants Evan Morikawa | @e0m | [email protected] | May 14 2016 Nylas

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 9

Slide 9 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Shell NW.js (Node Webkit) Swing | Qt | Cocoa | GTK | WPF/WinRT

Slide 12

Slide 12 text

Shell

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Chromium

Slide 17

Slide 17 text

Chromium Browser aka Backend aka Main Process

Slide 18

Slide 18 text

Chromium Browser aka Backend aka Main Process C++

Slide 19

Slide 19 text

Chromium Browser aka Backend aka Main Process C++ Renderer Renderer Renderer HTML / JS (DOM) HTML / JS (DOM) HTML / JS (DOM)

Slide 20

Slide 20 text

Chromium Browser aka Backend aka Main Process C++ Renderer Renderer Renderer HTML / JS (DOM) HTML / JS (DOM) HTML / JS (DOM) ipc

Slide 21

Slide 21 text

Browser aka Backend aka Main Process Renderer Renderer Renderer HTML / JS (DOM) HTML / JS (DOM) HTML / JS (DOM) ipc

Slide 22

Slide 22 text

Nylas N1

Slide 23

Slide 23 text

Nylas N1 main.js

Slide 24

Slide 24 text

Nylas N1 main.js const win = new BrowserWindow() win.loadURL(`file://index.html`) win.show()

Slide 25

Slide 25 text

Nylas N1 main.js const win = new BrowserWindow() win.loadURL(`file://index.html`) win.show()

Slide 26

Slide 26 text

Nylas N1 main.js const win = new BrowserWindow() win.loadURL(`file://index.html`) win.show() index.html index.js

Slide 27

Slide 27 text

Nylas N1 main.js const win = new BrowserWindow() win.loadURL(`file://index.html`) win.show() index.html index.js React.render()

Slide 28

Slide 28 text

Nylas N1 main.js const win = new BrowserWindow() win.loadURL(`file://index.html`) win.show() index.html index.js React.render()

Slide 29

Slide 29 text

Nylas N1 main.js const win = new BrowserWindow() win.loadURL(`file://index.html`) win.show() index.html index.js React.render() Composer Work Window

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Slide 35

Slide 35 text

Slide 36

Slide 36 text


 Actions.registerComponent(TranslateButton, { location:’composer-actions’ })

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 40

Slide 40 text

React ReactiveX.js Redux Flux +

Slide 41

Slide 41 text

ReactiveX.js

Slide 42

Slide 42 text

const q = `SELECT * FROM threads WHERE …` Rx.Observable.fromQuery(q).subscribe((threads) => { this.setState({threads}) })

Slide 43

Slide 43 text

const q = `SELECT * FROM threads WHERE …` Rx.Observable.fromQuery(q) .filter(myFn).subscribe((threads) => { this.setState({threads}) })

Slide 44

Slide 44 text

const q = `SELECT * FROM threads WHERE …` Rx.Observable.fromQuery(q) .filter(myFn) .map(mapFn).subscribe((threads) => { this.setState({threads}) })

Slide 45

Slide 45 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 46

Slide 46 text

Web SQL Local Storage

Slide 47

Slide 47 text

Web SQL Local Storage

Slide 48

Slide 48 text

Web SQL Local Storage

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

https://github.com/nylas/n1 Open Source

Slide 56

Slide 56 text

How do we: Deliver to the desktop Support 3rd party plugins Keep data & view in sync Work offline Keep it performant Pay it forward

Slide 57

Slide 57 text

N1 Core Team @e0m @bengotow @juanstejada YOU! @karim_hamidou @jackiehluo

Slide 58

Slide 58 text

N1 Extended Team

Slide 59

Slide 59 text

Evan Morikawa | @e0m | [email protected] | May 2016 Thank you Slides here