components

28
Components

Upload: miguel-madero

Post on 17-Jul-2015

189 views

Category:

Engineering


6 download

TRANSCRIPT

Page 1: Components

Components

Page 2: Components

Hi

Miguel Madero

Page 3: Components

3Practice Fusion

Page 4: Components

4

Production “Quality”

Code

Page 5: Components

30 Components in 30 Minutes

Page 6: Components

30 Components in 30 Minutes

Some components in 30ish

minutes (or more)

Page 7: Components

What do you think when you hear component?

7

+ Encapsulation/isolation

+ Composition

+ Controls/widgets

+ Web Components (today)

+ Controller+View in one

+ 42

+ Something Ember devs abuse because they're

lazy and they don't want to create routes,

controllers, views

+ Reuse

Page 8: Components

Encapsulation

8

Page 9: Components

Encapsulation

9

Page 10: Components

Survey Time!!!

Demo

Page 11: Components

Demo. Yay!!!!

Hello world!!!

Demo

Page 12: Components

Components and other roles

12

Page 13: Components

Routable Components (No more Controllers)

13

Component

Page 14: Components

+ A lot is changing

+ Use components today you will be fine

+ More

github.com/emberjs/rfcs

The Road to Ember 2.0

Quick Note on 2.0

14

Page 15: Components

+ Routable Components

+ Nicer hbs syntax for components,

+ Better attribute bindings, with support for

interpolation

+ One-way binding the default,

+ Block parameters,

+ Separating the component attributes set by its

consumers from the component properties,

+ Improved actions

Longer Note on 2.0

15

Page 16: Components

Widgets

Types of Components

Domain Components

Page 17: Components

Types of Components

Widgets Domain

Page 18: Components

Types of Components

Main Principle Key Benefits Secondary

Benefits

Widgets Encapsulation Reuse, consistency Composition

Domain Encapsulation Separation of

concerns,

composition

Reuse, testability

Page 19: Components

Demo yay!!!!

Tyrion Component Library

Demo

Page 20: Components

+ Reuse

+ Consistency

+ Manipulate DOM

+ Internally speak view. External language

Widgets

20

Page 21: Components

Domain

21

Page 22: Components
Page 23: Components

Domain

+ Encapsulation

+ Separation of Concerns

+ DOM Manipulation

+ Internally avoid view language. Externally speak

in the language of the domain

+ External Contributors and Data Access

Ember-data? Inject

Services? Inject-properties, require.

Controllers? No.

Page 24: Components

Widgets vs Components

Data Access? DOM Manipulation

Widgets Data is provided (usually…) Yes. Often it’s the main task

Domain Components Often params are provided

and they know who to ask

for data.

{{medication-detail

medicationGuid=“AB-123”}}

Avoid

Page 25: Components

Demo Yay!!!

29

Handlebars as a DSL

Page 26: Components

Demo Yay!!!

Handlebars as a DSL

30

Page 27: Components

31

Page 28: Components

+ The Road to Ember 2.0 (bunch of changes to

components)

+ github.com/practicefusion

+ github.com/MiguelMadero

+ Building Ember CLI Addons

+ Ember RFCs

Resources

32