Slide 1

Slide 1 text

Introduction MontageJS to

Slide 2

Slide 2 text

Ryan Paul MontageJS Dev Relations @segphault

Slide 3

Slide 3 text

The Web Evolving is

Slide 4

Slide 4 text

Hypertext Document Medium from

Slide 5

Slide 5 text

to Interactive Application Platform

Slide 6

Slide 6 text

WE NEED A FRAMEWORK BRIDGE THE GAP to

Slide 7

Slide 7 text

• Framework for frontend web development • Ideal for building single-page applications • Best suited for projects that target modern browsers • Open source, under BSD license What is MontageJS?

Slide 8

Slide 8 text

• Component System • Deferred Drawing • Functional Reactive Bindings Key Features

Slide 9

Slide 9 text

• Component System • Deferred Drawing • Functional Reactive Bindings Key Features FRB

Slide 10

Slide 10 text

• Component System • Deferred Drawing • Functional Reactive Bindings Key Features FRB

Slide 11

Slide 11 text

Components HTML Content CSS Styling FRB Bindings JS Code component.reel

Slide 12

Slide 12 text

Install MontageJS $ sudo npm install -gq minit@latest

Slide 13

Slide 13 text

Create Project $ minit create:app -n app-name Create Component $ minit create:component -n compname

Slide 14

Slide 14 text

Filesystem assets images style node_modules digit montage ui main.reel welcome.reel index.html package.json

Slide 15

Slide 15 text

Filesystem assets images style node_modules digit montage ui main.reel welcome.reel index.html package.json ! main.reel main.html main.css main.js

Slide 16

Slide 16 text

Serialization • Instantiate components • Attach components to the page DOM • Populate component properties — static values or bindings

Slide 17

Slide 17 text

FRB Bindings • Propagate changes between object properties • Can be 1-way or 2-way • Bind to other components or regular JS objects

Slide 18

Slide 18 text

Serialization "number": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "number"} } } HTML MJS

Slide 19

Slide 19 text

Serialization "number": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "number"} } } HTML MJS Prototype: path to the desired component

Slide 20

Slide 20 text

Serialization "number": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "number"} } } HTML MJS Element: Montage ID of DOM element

Slide 21

Slide 21 text

"number": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "number"} } }, "slider": { "prototype": "digit/ui/slider.reel", "properties": { "element": {"#": "slider"} }, "bindings": { "value": {"<->": "@number.value"} } } Adding a 2nd component HTML MJS

Slide 22

Slide 22 text

"number": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "number"} } }, "slider": { "prototype": "digit/ui/slider.reel", "properties": { "element": {"#": "slider"} }, "bindings": { "value": {"<->": "@number.value"} } } HTML MJS <-> signifies a 2-way binding

Slide 23

Slide 23 text

"number": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "number"} } }, "slider": { "prototype": "digit/ui/slider.reel", "properties": { "element": {"#": "slider"} }, "bindings": { "value": {"<->": "@number.value"} } } HTML MJS @ references an existing component

Slide 24

Slide 24 text

"celsiusNumber": { "prototype": "digit/ui/number-field.reel", "properties": { "element": {"#": "celsius"} }, "bindings": { "value": {"<->": "([email protected] - 32) / 1.8"} } } MJS Complex FRB Expressions

Slide 25

Slide 25 text

! "sorted": {"<-": “numbers.sorted{}”} ! "evens": {"<-": “numbers.filter{!(%2)}”} ! "low": {"<-": “numbers.filter{this <= ^maxNumber}”} ! "allChecked": {"<-": “options.every{checked}”} ! "payroll": {"<-": “departments.map{employees.sum{salary}}.sum()”} ! "index": {"<-": “folks.group{id}.sorted{.0}.map{.1.last()}”} MJS Fun with FRB

Slide 26

Slide 26 text

• Command line tool that optimizes apps for production deployment • Consolidates code into bundles to reduce number of requests • Minifies code to reduce total download size MontageJS Optimizer

Slide 27

Slide 27 text

MontageJS Optimizer $ sudo npm install -g mop $ mop

Slide 28

Slide 28 text

Thank You! MontageJS.org @MontageJS