41
禼ṛ膢ጱ翕殷物Polymer Polymer Start-Up Bekket McClane@SITCON2016

Polymer Start-Up (SITCON 2016)

Embed Size (px)

Citation preview

Page 1: Polymer Start-Up (SITCON 2016)

PolymerPolymer Start-Up

Bekket McClane@SITCON2016

Page 2: Polymer Start-Up (SITCON 2016)

Who Am I ?

Bekket McClane

Page 3: Polymer Start-Up (SITCON 2016)

Who Am I ?

mshockwave

Page 4: Polymer Start-Up (SITCON 2016)

Who Am I ?

2

Page 5: Polymer Start-Up (SITCON 2016)

Department of Computer Science Sophomore

Page 6: Polymer Start-Up (SITCON 2016)

WARNING

Me Web Front End Development

Amateur Web Front End Developer

Page 7: Polymer Start-Up (SITCON 2016)

HighLights• It’s all about modules

• Data binding

• Event listening

• CSS namespaces

Page 8: Polymer Start-Up (SITCON 2016)

x-foo: DebutDefine (In x-foo.html):

Page 9: Polymer Start-Up (SITCON 2016)

x-foo: Debut

Usage (In index.html):

Define (In x-foo.html):

Page 10: Polymer Start-Up (SITCON 2016)

x-foo: Debut

Registering module

Usage (In index.html):

Define (In x-foo.html):

Page 11: Polymer Start-Up (SITCON 2016)

x-foo: Debut

Registering module

?

Usage (In index.html):

Define (In x-foo.html):

Page 12: Polymer Start-Up (SITCON 2016)

Shadow DOM• HTML5 standard

• Separate contents from presentation

• DOM encapsulation

• The theory basic behind Polymer

Page 13: Polymer Start-Up (SITCON 2016)

Shadow DOM

http://goo.gl/udfVkA

Page 14: Polymer Start-Up (SITCON 2016)

x-foo: Data Binding

Page 15: Polymer Start-Up (SITCON 2016)

x-foo: Data Binding

Page 16: Polymer Start-Up (SITCON 2016)

x-foo: Data Binding

Page 17: Polymer Start-Up (SITCON 2016)

x-foo: Usage

Page 18: Polymer Start-Up (SITCON 2016)

x-foo: Usage

Page 19: Polymer Start-Up (SITCON 2016)

x-foo: Usage

SO EASY?!

Page 20: Polymer Start-Up (SITCON 2016)

x-foo: Usage

Page 21: Polymer Start-Up (SITCON 2016)

x-foo: Properties

Page 22: Polymer Start-Up (SITCON 2016)

x-foo: Properties

Page 23: Polymer Start-Up (SITCON 2016)

x-foo: More Data Binding

Page 24: Polymer Start-Up (SITCON 2016)

x-foo: More Data Binding

Page 25: Polymer Start-Up (SITCON 2016)

x-foo: More Data Binding

Page 26: Polymer Start-Up (SITCON 2016)

x-foo: More Data Binding

Page 27: Polymer Start-Up (SITCON 2016)

x-foo: More Data Binding• <template is=“dom-repeat”>

ngRepeat

• <template is=“dom-if”> No more CSS display:none

Page 28: Polymer Start-Up (SITCON 2016)

x-foo: DOM Children

Usage:

Page 29: Polymer Start-Up (SITCON 2016)

x-foo: DOM Children

Usage:

Page 30: Polymer Start-Up (SITCON 2016)

x-foo: DOM Children

Usage:

Page 31: Polymer Start-Up (SITCON 2016)

x-foo: DOM Children

Usage:

Page 32: Polymer Start-Up (SITCON 2016)

x-foo: Event Firing

Page 33: Polymer Start-Up (SITCON 2016)

x-foo: Event Firing

Page 34: Polymer Start-Up (SITCON 2016)

x-foo: Event Firing

Page 35: Polymer Start-Up (SITCON 2016)

x-foo: Event Listening

Page 36: Polymer Start-Up (SITCON 2016)

x-foo: Event Listening

Page 37: Polymer Start-Up (SITCON 2016)

Polymer Elements Catalog

https://elements.polymer-project.org/

Page 38: Polymer Start-Up (SITCON 2016)

Other Must-See Cool Stuffs• Properties observer

• Computed Data Binding Value

• Behavior: similar to inherence • dom-bind: Polymer Module in body

Page 39: Polymer Start-Up (SITCON 2016)

Drawbacks of Polymer• Rarely long learning curve

• Not very well in cross-browsers performance

• Lack of elements CDN

Page 40: Polymer Start-Up (SITCON 2016)

Summary• Highly reusable custom components

• Integrate some OOP principles (e.g. Encapsulation, Inherence )

• Great features of event handling, data binding and component configurations

• Based on the latest HTML5 / CSS3

Page 41: Polymer Start-Up (SITCON 2016)

Thank You