Slide 1

Slide 1 text

Development A Recipe for Modern Mobile Frontend HTML5 Conference 2013 2013.11.30 13:00~ @Room5A 5F

Slide 2

Slide 2 text

?

Slide 3

Slide 3 text

< 10%?

Slide 4

Slide 4 text

25%?

Slide 5

Slide 5 text

60%?

Slide 6

Slide 6 text

No Hand?

Slide 7

Slide 7 text

25%!

Slide 8

Slide 8 text

Yuya Saito Frontend Developer @ CyberAgent

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

events.html5j.org/conference/2013/11/sessions

Slide 12

Slide 12 text

Agenda Code Performance Automation

Slide 13

Slide 13 text

Code

Slide 14

Slide 14 text

Scaffolding

Slide 15

Slide 15 text

଍৔ Scaffolding

Slide 16

Slide 16 text

Brunch brunch.io

Slide 17

Slide 17 text

Yeoman yeoman.io

Slide 18

Slide 18 text

$44ϓϦϓϩηοαͷίϯύΠϧ $P⒎FF4DSJQUͳͲͷίϯύΠϧ ϑΝΠϧͷ࿈݁ϛχϑΝΠ Ϣχοτςετ +4)JOU΍$44-JOUͳͲͷ-JOUπʔϧ ࣗಈϦϩʔυ

Slide 19

Slide 19 text

Too much to set up? Just modify it!

Slide 20

Slide 20 text

Coding Guideline

Slide 21

Slide 21 text

Code is read much more often than it is written, so plan accordingly. - Raymond Chen ❞

Slide 22

Slide 22 text

ίʔυ͸ॻ͘ػձΑΓಡΉػձͷํ ͕ѹ౗తʹଟ͍ɻ ͔ͩΒͦ͜ɺ ͔ͬ͠Γͱܭը͢Δ΂͖ͩɻ - Raymond Chen ❞

Slide 23

Slide 23 text

JavaScript

Slide 24

Slide 24 text

github.com/airbnb/javascript

Slide 25

Slide 25 text

github.com/Seravo/js-winning-style

Slide 26

Slide 26 text

CSS

Slide 27

Slide 27 text

github.com/csswizardry/CSS-Guidelines

Slide 28

Slide 28 text

github.com/necolas/idiomatic-css

Slide 29

Slide 29 text

HTML / CSS

Slide 30

Slide 30 text

by ୩୓थ Ϟμϯͳ$44ઃܭύλʔϯΛߟ͑Δ 16:15~ @ Room1A 1F

Slide 31

Slide 31 text

Slide 32

Slide 32 text

Interactions Animations

Slide 33

Slide 33 text

ίʔυ͸ཧղ͠΍͘͢ͳ͚Ε͹ ͳΒͳ͍ɻ

Slide 34

Slide 34 text

Philip Walton Frontend software engineer @ Appfolio

Slide 35

Slide 35 text

Predictable Reusable Maintainable Scalable

Slide 36

Slide 36 text

Methodologies

Slide 37

Slide 37 text

by Nicole Sullivan OOCSS

Slide 38

Slide 38 text

Object in CSS:

Slide 39

Slide 39 text

Basically, a CSS “object” is a repeating visual pattern, which can be abstracted into an independent snippet of HTML, CSS, and possibly JavaScript. Once created, an object can then be reused throughout a site. - Nicole Sullivan ❞

Slide 40

Slide 40 text

جຊతʹ$44ʹ͓͍ͯɺ ͋Δ ʮΦϒδΣΫτʯ ͱ͸܁Γฦ͞ΕΔϏ δϡΞϧύλʔϯͰ͋Γɺ )5.-΍$44ɺ ΋͔͢͠Δͱ+BWB4DSJQUͰॻ͔Εͨಠཱ͠ ͨεχϖοτͱͯ͠ந৅ԽͰ͖Δ΋ͷͰ͋ Δɻ ·ͨҰ౓ੜ੒ͨ͠ΦϒδΣΫτ͸ αΠτ಺Ͱ࠶ར༻Ͱ͖Δ΋ͷͰ͋Δɻ ❞ - Nicole Sullivan

Slide 41

Slide 41 text

github.com/stubbornella/oocss/wiki

Slide 42

Slide 42 text

by Jonathan Snook SMACSS

Slide 43

Slide 43 text

Base State Layout Module Theme

Slide 44

Slide 44 text

Base is the default

Slide 45

Slide 45 text

State is ...uh, state

Slide 46

Slide 46 text

smacss.com/ja

Slide 47

Slide 47 text

by Yandex BEM

Slide 48

Slide 48 text

Block Element Modifier

Slide 49

Slide 49 text

We used BEM principles to create a set of front-end development techniques and tools, that allow us to build websites quickly and maintain them over a long time. ❞

Slide 50

Slide 50 text

BEM can pick up where SMACSS left off.

Slide 51

Slide 51 text

bem.info

Slide 52

Slide 52 text

Build Systems, Not Pages.

Slide 53

Slide 53 text

OOCSS, SMACSS, BEM are just ONE of the solutions!

Slide 54

Slide 54 text

JavaScript

Slide 55

Slide 55 text

MV*

Slide 56

Slide 56 text

Backbone.js Ember.js Angular.js

Slide 57

Slide 57 text

SPAs Single Page Applications

Slide 58

Slide 58 text

Slide 59

Slide 59 text

Pros / Cons

Slide 60

Slide 60 text

Pros

Slide 61

Slide 61 text

Simplify Server Side Tasks +40/Λڙڅ͢Δ୯७ͳ"1*αʔϏεͷ Α͏ʹͳΔ

Slide 62

Slide 62 text

Runs Almost Anywhere +4͕࣮ߦͰ͖Δ؀ڥͰ͋Ε͹ɺ Ͳ͜Ͱ΋ ಈ࡞͢Δ

Slide 63

Slide 63 text

Many Existing Toolkits ͢Ͱʹଟ͘ͷϑϨʔϜϫʔΫ΍πʔϧ͕ ଘࡏ͢Δ

Slide 64

Slide 64 text

Cons

Slide 65

Slide 65 text

Bad for Performance +BWB4DSJQUϑΝΠϧαΠζͷංେԽ

Slide 66

Slide 66 text

No SEO Ϋϩʔϥ͸+BWB4DSJQUΛ࣮ߦ͠ͳ͍

Slide 67

Slide 67 text

Progressive Enhancement ωοτϫʔΫରԠ΍ύϑΥʔϚϯεʹ ؔΘΔΤϯϋϯεϝϯτ͕೉͍͠

Slide 68

Slide 68 text

by LZP@BHP 14:00~ @ Room5B 5F ΦϑϥΠϯ8FCΞϓϦέʔγϣϯͷ ʮબ୒ࢶʯ

Slide 69

Slide 69 text

by খݪོ࿠ 16:15~ @ Room5A 5F ஍ԼమYαΫαΫY͜Ε͔Βͷ 8FCήʔϜΞϓϦ͕උ͑Δ΂͖ ͭͷػೳ

Slide 70

Slide 70 text

Performance in SPAs

Slide 71

Slide 71 text

CSS JS

Slide 72

Slide 72 text

Slide 73

Slide 73 text

is on Google PageSpeed Insights ATF

Slide 74

Slide 74 text

A T F bove he old ϑΝʔετϏϡʔ

Slide 75

Slide 75 text

from Server HTML Just for this area ONLY

Slide 76

Slide 76 text

Performance

Slide 77

Slide 77 text

Jeff Atwood AKA Coding Horror

Slide 78

Slide 78 text

To me, performance is a feature [...] I think there's also a lesson to be learned here about the competitive landscape of the public internet, where there are two kinds of websites: the quick and the dead. ❞ - Jeff Atwood

Slide 79

Slide 79 text

ࢲ͸ύϑΥʔϚϯεΛػೳͰ͋Δͱ ߟ͍͑ͯΔɻ <>͜ͷڝ૪ͷଟ͍Πϯλʔωοτͷੈք Ͱ஌͓ͬͯ͘΂͖Ϩοεϯ͕͋Δͱ͠Βɺ ͜ͷੈʹ͸छྨͷ8FCαΠτ͔͠ͳ͍ ૣ͍͔ɺࢮΜͰ͍Δ͔ͷͲͪΒ͔ͩɻ - Jeff Atwood ❞

Slide 80

Slide 80 text

Someday... Not Now.

Slide 81

Slide 81 text

Performance ϖʔδ͕ಡΈࠐ·ΕΔ·Ͱͷ଎͞ Ϣʔβૢ࡞ʹର͢ΔϑΟʔυόοΫͷ଎͞

Slide 82

Slide 82 text

ϖʔδ͕ಡΈࠐ·ΕΔ·Ͱͷ଎͞ Page Load Performance

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

Steve Souders Web Performance Engineer

Slide 85

Slide 85 text

Performance Budget

Slide 86

Slide 86 text

1 second

Slide 87

Slide 87 text

www.nngroup.com/articles/response-times-3-important-limits

Slide 88

Slide 88 text

1 second!? "5'಺ͳΒͳΜͱ͔ʜʜ

Slide 89

Slide 89 text

www.strangeloopnetworks.com/web-performance-infographics

Slide 90

Slide 90 text

(More Realistic) Performance Budget: 3 seconds

Slide 91

Slide 91 text

Case Study: Fail

Slide 92

Slide 92 text

Case 1: ը૾ͷ࠷దԽॲཧ๨Ε

Slide 93

Slide 93 text

Case 2: $44ϑΝΠϧαΠζ͕ڊେ

Slide 94

Slide 94 text

Case 2: $44ϑΝΠϧαΠζ͕ڊେ DataURI? CSS Sprite!

Slide 95

Slide 95 text

Case 2: $44ϑΝΠϧαΠζ͕ڊେ Preprocessor? Check CSS!

Slide 96

Slide 96 text

"Tools, not rules!" - Paul Lewis

Slide 97

Slide 97 text

Google PageSpeed Insights

Slide 98

Slide 98 text

Google PageSpeed Insights developers.google.com/speed/pagespeed/insights

Slide 99

Slide 99 text

Google Chrome DevTools

Slide 100

Slide 100 text

Google Chrome DevTools developers.google.com/chrome-developer-tools

Slide 101

Slide 101 text

WebPageTest.org

Slide 102

Slide 102 text

WebPageTest.org www.webpagetest.org

Slide 103

Slide 103 text

Ϣʔβૢ࡞ʹର͢ΔϑΟʔυόοΫͷ଎͞ Rendering Performance

Slide 104

Slide 104 text

by ࠤ౻า 17:15~ @ Room5B 5F 8FCϑϩϯτΤϯυͷ ϨϯμϦϯάύϑΥʔϚϯεͱ ࠷దԽ5JQT

Slide 105

Slide 105 text

16.66ms

Slide 106

Slide 106 text

24FPS

Slide 107

Slide 107 text

Frame Per Second ඵʹίϚ

Slide 108

Slide 108 text

Jank Busters Chrome Rendering Performance via jankfree.org/jank-busters-io-2013/template.html#6

Slide 109

Slide 109 text

Paint / Layout

Slide 110

Slide 110 text

Paint Scroll, Animation and etc...

Slide 111

Slide 111 text

DOM Node DOM Node DOM Node DOM Node DOM Node Node

Slide 112

Slide 112 text

Layout

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html

Slide 115

Slide 115 text

Analyze in DevTools Again, "Tools, not rules!"

Slide 116

Slide 116 text

Timeline Panel

Slide 117

Slide 117 text

Timeline Panel developers.google.com/chrome-developer-tools/docs/timeline

Slide 118

Slide 118 text

Show Paint Rectangles

Slide 119

Slide 119 text

Show Paint Rectangles

Slide 120

Slide 120 text

Continuous Page Repainting

Slide 121

Slide 121 text

Continuous Page Repainting

Slide 122

Slide 122 text

Automation

Slide 123

Slide 123 text

gruntjs.com

Slide 124

Slide 124 text

by ੴຊޫ࢘ 17:15~ @ Room1A 1F ࠓͲ͖ͷ(SVOUΛ࢖ͬͨ ϑϩϯτΤϯυ։ൃ ʢ)5.-$44ฤʣ

Slide 125

Slide 125 text

What should we Automate? ͳʹΛࣗಈԽͰ͖Δͷ͔ʁ

Slide 126

Slide 126 text

ը૾ϑΝΠϧͷ࠷దԽ +BWB4DSJQU΍$44ͷϑΝΠϧͷ݁߹ ΞΠίϯϑΥϯτͷੜ੒ ߴղ૾౓σΟεϓϨΠ΁ͷରԠ εϓϥΠτγʔτͷੜ੒ ...

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

Automate anything you’ll likely do more than ONCE! ೋ౓͋Δ͜ͱ͸ɺ ࡾ౓͋Δ

Slide 129

Slide 129 text

෼͔͔ΔλεΫ͕͋Δͱͨ͠Β ෼͔͚ͯͦͷλεΫΛߦ͏ͨΊͷ ϓϩάϥϜΛॻ͍ͯ෼Ͱ࣮ߦ͢Δɻ ❞

Slide 130

Slide 130 text

Finally...

Slide 131

Slide 131 text

No ONE best practice!

Slide 132

Slide 132 text

ຊ೔఻͍͑ͨࣄ ηογϣϯͰ͓࿩ͨ͜͠ͱ͸ɺ ͢΂ͯͷ໰୊ʹର͢ΔղͰ͸ͳ͍ɻ

Slide 133

Slide 133 text

It depends!

Slide 134

Slide 134 text

John. F Kennedy 35th President of USA

Slide 135

Slide 135 text

There are risks and costs to a program of action, but they are far less than the long-range risks and costs of comfortable inaction. ❞ - John. F Kennedy

Slide 136

Slide 136 text

ߦಈʹ͸ͭͶʹةݥ΍୅ঈ͕൐͏ɻ ͔ͦ͠͠Ε͸ɺ ߦಈͤͣʹָΛܾΊ͜ Μͩ࣌ͷ௕ظతͳةݥ΍ίετͱֱ΂ Ε͹ɺ औΔʹ଍Βͳ͍ɻ - John. F Kennedy ❞

Slide 137

Slide 137 text

Thank you! Follow me @ cssradar