aurelia 101

45
Aurelia WHY, WHAT, HOW? @MR_SEAN_HUNTER (PCA PREDICT)

Upload: sean-hunter

Post on 23-Jan-2018

453 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Aurelia   101

AureliaWHY, WHAT, HOW?

@MR_SEAN_HUNTER (PCA PREDICT)

Page 2: Aurelia   101

Agenda

The back-story

Aurelia 101

Our experience in Production

Page 3: Aurelia   101

Aurelia – Themes

THE FOUR THEMES

Composability

Forward thinking

Simplicity

Flexibility

Page 4: Aurelia   101

Composability

Compose the UI from a set of independent views.

Page 5: Aurelia   101

Forward thinking

ES6 and ES7 are coming, Aurelia leans into this.

Page 6: Aurelia   101

Simplicity

Don’t make me think too hard.

Page 7: Aurelia   101

Flexibility

Simple conventions, easy to change

Page 8: Aurelia   101

Brief history of front end development

26th August 200613th October 2010 - BackboneJS

5th July 2010 - KnockoutJS

2009, but really exploded in around 2013

Page 9: Aurelia   101

jQuery – Cross Browser Development!

Page 10: Aurelia   101

jQuery, starting to struggle…

How do we structure all of this JavaScript code?

Page 11: Aurelia   101

Enter Backbone and Knockout

We can now split our code into views which are independently rendered.

Code easier to manage.

Page 12: Aurelia   101

BackboneJS Eventing

Leads to debugging problems

Page 13: Aurelia   101

Angular 1.0

Routing

Directives (first introduction of the module concept)

Simple, two way data-binding

Page 14: Aurelia   101

What is next?

ES2015 and Beyond

ES6 Modules

ES7 Decorators

More..

Page 15: Aurelia   101

Aurelia’s Toolbox - JSPM

Frictionless browser package management

Built on top of the SystemJS ES6 Dynamic Module Loader

Based on ES6 Module Loader Polyfill

Page 16: Aurelia   101

Why modules?

“With ES2015 we should think about script modules instead of Script Files.

- Scott Allen

Page 17: Aurelia   101

Modules the Old Way

Page 18: Aurelia   101

Modules the New Way

Page 19: Aurelia   101

Demo - JSPM

npm install jspm –g

jspm init

Page 20: Aurelia   101

JSPM Module

Page 21: Aurelia   101

Aurelia’s Toolbox – Modern JavaScript and BabelJS

Transform ES2015, and ES7 to ES5.

We can use the new cool stuff in JavaScript!

Page 22: Aurelia   101

Some of the cool stuff

Arrow functions

Decorators

Modules

Properties

Page 23: Aurelia   101

Arrow Functions

Page 24: Aurelia   101

Decorators & Properties

Page 25: Aurelia   101

Aurelia .. Finally!

Aurelia leverages the power of modern JavaScript to make building applications simple

Page 26: Aurelia   101

MVVM

view-model.html

view-model.js

Page 27: Aurelia   101

Aurelia Demo – Basic Application

https://github.com/aurelia/app-contacts

Page 28: Aurelia   101

Singletons

Every injected non-view model class is treated as a singleton.

* Can be overridden with transient

decorator

Page 29: Aurelia   101

Aurelia Demo – Data Binding

A consistent binding syntax

Page 30: Aurelia   101

Aurelia Component Lifecycle

activate()

bind()

attach()

deactivate()

unbind()

detach()

Page 31: Aurelia   101

Aurelia and the Microsoft Stack

+

Page 32: Aurelia   101

Aurelia Demo - Routing

Page 33: Aurelia   101

Aurelia Demo – Ajax

Page 34: Aurelia   101

Aurelia Demo – Value Converters

view.html

date-format.js

Page 35: Aurelia   101

Aurelia Demo - Deployment

Because we don’t have HTTP2 yet, we need to bundle.

gulp bundle

http://blog.durandal.io/2015/09/11/bundling-aurelia-apps/

Page 36: Aurelia   101

SPA Data Flow

Two way data-binding or Unidirectional dataflow?

-- Why not both?

Page 37: Aurelia   101

Aurelia & Unidirectional Data-flow

contact-list.js

contact-details.js

Page 38: Aurelia   101

Web Components?

Now: Aurelia supports web components. This means polymer components can be used with Aurelia today.

Future: Ability to export Aurelia component for use as a web component (standalone).

Page 39: Aurelia   101

Performance

Current benchmarks show rendering speed of 2x Angular and React

Page 40: Aurelia   101

Performance

Micro-task Queue rather than Virtual DOM

Page 41: Aurelia   101

Is it solid?

Backed by Durandal Inc.

Commercial Support Available.

15 developer team distributed around the world.

Page 42: Aurelia   101

Browser Support

Evergreen browsers

IE9 & IE10

Page 43: Aurelia   101

2 months in, any shortcomings?

Very new stuff.

Documentation a work in progress.

Lack of 3rd Party Tools

Page 44: Aurelia   101

Conclusion

Easiest way to get started?

npm install –g yo

yo aurelia

Page 45: Aurelia   101

Contact Details

Sean Hunter, Software Developer @ PCA Predict

Twitter: @mr_sean_hunter

Email: [email protected]

Blog: http://sean-hunter.io/