getting started with aurelia - smart devs usergroup

40
Aurelia WHY, WHAT, HOW? @MR_SEAN_HUNTER

Upload: sean-hunter

Post on 22-Jan-2018

333 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Getting Started With Aurelia - Smart Devs Usergroup

AureliaWHY, WHAT, HOW?

@MR_SEAN_HUNTER

Page 2: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia – Themes

THE FOUR THEMES

Composability

Forward thinking

Simplicity

Flexibility

Page 3: Getting Started With Aurelia - Smart Devs Usergroup

Composability

Compose the UI from a set of independent views.

Page 4: Getting Started With Aurelia - Smart Devs Usergroup

Forward thinking

ES6 and ES7 are coming, Aurelia leans into this.

Page 5: Getting Started With Aurelia - Smart Devs Usergroup

Simplicity

Don’t make me think too hard.

Page 6: Getting Started With Aurelia - Smart Devs Usergroup

Flexibility

Simple conventions, easy to change

Page 7: Getting Started With Aurelia - Smart Devs Usergroup

Brief history of front end development

26th August 200613th October 2010 - BackboneJS

5th July 2010 - KnockoutJS

2009, but really exploded in around 2013

Page 8: Getting Started With Aurelia - Smart Devs Usergroup

jQuery, starting to struggle…

How do we structure all of this JavaScript code?

Page 9: Getting Started With Aurelia - Smart Devs Usergroup

Enter Backbone and Knockout

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

Code easier to manage.

Page 10: Getting Started With Aurelia - Smart Devs Usergroup

Angular 1.0

Routing

Directives (first introduction of the module concept)

Simple, two way data-binding

Page 11: Getting Started With Aurelia - Smart Devs Usergroup

What is next?

ES2015 and Beyond

ES6 Modules

ES7 Decorators

More..

Page 12: Getting Started With Aurelia - Smart Devs Usergroup

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 13: Getting Started With Aurelia - Smart Devs Usergroup

Why modules?

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

- Scott Allen

Page 14: Getting Started With Aurelia - Smart Devs Usergroup

Modules the Old Way

Page 15: Getting Started With Aurelia - Smart Devs Usergroup

Modules the New Way

Page 16: Getting Started With Aurelia - Smart Devs Usergroup

Demo - JSPM

npm install jspm –g

jspm init

Page 17: Getting Started With Aurelia - Smart Devs Usergroup

JSPM Module

Page 18: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia’s Toolbox – Modern JavaScript and BabelJS

Transform ES2015, and ES7 to ES5.

We can use the new cool stuff in JavaScript!

Page 19: Getting Started With Aurelia - Smart Devs Usergroup

Some of the cool stuff

Arrow functions

Decorators

Modules

Properties

Page 20: Getting Started With Aurelia - Smart Devs Usergroup

Arrow Functions

Page 21: Getting Started With Aurelia - Smart Devs Usergroup

Decorators & Properties

Page 22: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia .. Finally!

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

Page 23: Getting Started With Aurelia - Smart Devs Usergroup

Is it solid?

Backed by Durandal Inc.

Commercial Support Available.

15 developer team distributed around the world.

Page 24: Getting Started With Aurelia - Smart Devs Usergroup

MVVM

view-model.html

view-model.js

Page 25: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia Demo – Basic Application

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

Page 26: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia Demo – Data Binding

A consistent binding syntax

Page 27: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia and the Microsoft Stack

+

Page 28: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia Demo - Validation

http://aurelia.io/validation

this.validation = validation.on(this) .ensure('firstName').isNotEmpty() .hasLengthBetween(3,10) .ensure('lastName') .hasLengthBetween(3,30);

Page 29: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia Demo - Routing

Page 30: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia Demo – Ajax

Page 31: Getting Started With Aurelia - Smart Devs Usergroup

Aurelia Demo – Value Converters

view.html

date-format.js

Page 32: Getting Started With Aurelia - Smart Devs Usergroup

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 33: Getting Started With Aurelia - Smart Devs Usergroup

Aurela Demo – Event Aggregator

contact-list.js

contact-details.js

Page 34: Getting Started With Aurelia - Smart Devs Usergroup

Angular 2.0 and Aurelia

Page 35: Getting Started With Aurelia - Smart Devs Usergroup

Angular 2.0 and Aurelia

Page 36: Getting Started With Aurelia - Smart Devs Usergroup

Web Components?

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

Future: Ability to attribute an Aurelia Component to be treated as a Polymer component.

Page 37: Getting Started With Aurelia - Smart Devs Usergroup

Browser Support

Evergreen browsers

IE9 & IE10

Page 38: Getting Started With Aurelia - Smart Devs Usergroup

1 month in, any shortcomings?

Very new stuff.

Documentation a work in progress.

Lack of 3rd Party Tools

Page 39: Getting Started With Aurelia - Smart Devs Usergroup

Conclusion

Easiest way to get started?

npm install –g yo

yo aurelia

Page 40: Getting Started With Aurelia - Smart Devs Usergroup

Contact Details

Sean Hunter, Software Developer @ PCA Predict

Twitter: @mr_sean_hunter

Email: [email protected]

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