Slide 1

Slide 1 text

@robtarr @neilrenicker

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Who we are

Slide 4

Slide 4 text

Who are you?

Slide 5

Slide 5 text

bit.ly/frontend-conf- workshop-notes

Slide 6

Slide 6 text

BUILD RIGHT: FRONTEND TOOLING PATH OF PAIN

Slide 7

Slide 7 text

BUILD RIGHT: FRONTEND TOOLING TRADITIONAL PAIN

Slide 8

Slide 8 text

PATH OF PAIN Traditional Painful Flow DESIGNER FRONTEND BUILDING LAUNCH! DEV A DEV C “DONE!” THIS PART SUCKS LAST SEC CHANGES

Slide 9

Slide 9 text

PAIN POINTS

Slide 10

Slide 10 text

ENLIGHTENMENT

Slide 11

Slide 11 text

PAIN POINTS

Slide 12

Slide 12 text

ENLIGHTENMENT

Slide 13

Slide 13 text

The traditional web development workflow is fraught with variance, isolation, and errors. Modern frontend tooling provides solutions for most of these issues.

Slide 14

Slide 14 text

COMPUTERS SOFTWARE DEV FRONT END DEV

Slide 15

Slide 15 text

CS FRONT END DEV SOURCE CONTROL DRY PRINCIPLES JAVASCRIPT

Slide 16

Slide 16 text

“There’s a new set of baseline skills required in order to be successful as a front-end developer, and developers who don’t meet this baseline are going to start feeling more and more left behind…” ! —rmurphey.com/blog/2012/04/12/a-baseline- for-front-end-developers/

Slide 17

Slide 17 text

BUILD RIGHT: FRONTEND TOOLING WHERE ARE WE HEADED?

Slide 18

Slide 18 text

Source Control

Slide 19

Slide 19 text

Static Design Tools

Slide 20

Slide 20 text

Local Servers

Slide 21

Slide 21 text

Deployment

Slide 22

Slide 22 text

Preprocessing

Slide 23

Slide 23 text

Editors

Slide 24

Slide 24 text

Development Tools

Slide 25

Slide 25 text

Device Testing

Slide 26

Slide 26 text

Productivity

Slide 27

Slide 27 text

github.com/sparkbox/ br-frontend-demo

Slide 28

Slide 28 text

PRODUCTIVITY BUILD RIGHT: FRONTEND TOOLING

Slide 29

Slide 29 text

LAYING THE GROUNDWORK A Case For Laziness

Slide 30

Slide 30 text

Laziness: the programmer’s mantra

Slide 31

Slide 31 text

DRY Don’t Repeat Yourself

Slide 32

Slide 32 text

Productivity is about net gain.

Slide 33

Slide 33 text

LAYING THE GROUNDWORK Getting Into The Command Line

Slide 34

Slide 34 text

Should a frontend dev learn to use the CLI?

Slide 35

Slide 35 text

Image: nasa.gov Launch a rocket without a control center?

Slide 36

Slide 36 text

Image: flickr.com/photos/library_of_congress/ Fight a fire without an oxygen tank?

Slide 37

Slide 37 text

Do it. It’s the “way in” to your computer

Slide 38

Slide 38 text

If you're only comfortable with GUI interfaces, you're always going to be stuck relying on a translator.

Slide 39

Slide 39 text

bit.ly/br-tooling-links

Slide 40

Slide 40 text

You'll take a few steps backward in productivity when you begin. There's a net gain here, though.

Slide 41

Slide 41 text

PRODUCTIVITY PAIN POINTS And Their Solutions

Slide 42

Slide 42 text

MOUSE CLICKS Using the pointer is usually cumbersome.

Slide 43

Slide 43 text

alfredapp.com Type everything.

Slide 44

Slide 44 text

Alfred Workflows

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

kapeli.com/dash Quick access to docs.

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

vimium.github.io Internet with your keyboard.

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Touch typing. Practice typing without looking. Looking at your keyboard is a crutch. bullettrain.com

Slide 51

Slide 51 text

DOCUMENT SAVING, RETRIEVING & ORGANIZING

Slide 52

Slide 52 text

daringfireball.net/projects/markdown/ Markdown and the plain text workflow

Slide 53

Slide 53 text

Markdown

Slide 54

Slide 54 text

Markdown

Slide 55

Slide 55 text

Github ♥’s Markdown!

Slide 56

Slide 56 text

Github ♥’s Markdown!

Slide 57

Slide 57 text

brettterpstra.com/projects/nvalt nvAlt: Quick access to text entry

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

metaclassy.com Byword: Beautiful Markdown

Slide 60

Slide 60 text

EXCESSIVE TYPING

Slide 61

Slide 61 text

smilesoftware.com/ TextExpander TextExpander: speedy text snippets

Slide 62

Slide 62 text

Shortcuts within the terminal: aliases and bash scripts

Slide 63

Slide 63 text

alias c="clear" ~/.bashrc or ~/.zshrc

Slide 64

Slide 64 text

alias go="cd ~/Documents/Projects ; ls" ~/.bashrc or ~/.zshrc

Slide 65

Slide 65 text

Your /dotfiles repo

Slide 66

Slide 66 text

Other People's Dotfiles (OPD) dotfiles.github.io github.com/asimpson/dotfiles

Slide 67

Slide 67 text

DISTRACTION

Slide 68

Slide 68 text

Syntax highlighting

Slide 69

Slide 69 text

Achieving focus: Obsessive singularity

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

manytricks.com/moom Moom: quick screen resizing

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

Achieving focus: The desktop of evil

Slide 75

Slide 75 text

Achieving focus: Hide your dock

Slide 76

Slide 76 text

Achieving focus: Do not disturb

Slide 77

Slide 77 text

theletterapp.com Let.ter: send-only email

Slide 78

Slide 78 text

THE INTERNET IS A DEEP BLACK HOLE
 The thing we build can also keep us from doing notable work

Slide 79

Slide 79 text

THE PRODUCTIVITY MINDSET

Slide 80

Slide 80 text

Drip, drip, drip ‣ Productivity boosts happen in tiny increments ‣ Could I automate this?

Slide 81

Slide 81 text

Productivity Strain: ! Embrace small strains for huge productivity gains over time

Slide 82

Slide 82 text

Productivity Strain COMFY OUCH! RADICAL IMPROVEMENT

Slide 83

Slide 83 text

Productivity Strain ‣ The best time to create a shortcut for an obtuse task is the moment you imagine that it could be faster. ‣ It’s probably billable time.

Slide 84

Slide 84 text

Simple example: ! TYPE ALL OF YOUR CODE

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

Your productivity hacks?

Slide 87

Slide 87 text

DEMO

Slide 88

Slide 88 text

TEXT EDITORS BUILD RIGHT: FRONTEND TOOLING

Slide 89

Slide 89 text

Which editor do you use?

Slide 90

Slide 90 text

WHY CAN’T WE ALL JUST GET ALONG?

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

Do Editors Matter? ‣ 90% of editor arguments are lighthearted ‣ Your editor preference barely effects the rest of your team ‣ Fighting over editors is almost useless. There are better battles to fight.

Slide 93

Slide 93 text

HOWEVER

Slide 94

Slide 94 text

You spend almost all of your time in your editor.

Slide 95

Slide 95 text

Your editor preference changes the way you think.

Slide 96

Slide 96 text

THE PATH OF PAIN

Slide 97

Slide 97 text

TEXT EDITORS A few signs you need a better editor: 1. Your editor is writing code for you

Slide 98

Slide 98 text

TEXT EDITORS A few signs you need a better editor: 2. You’re doing lots of clicking

Slide 99

Slide 99 text

TEXT EDITORS A few signs you need a better editor: 3. You’re repeating yourself—a lot!

Slide 100

Slide 100 text

TEXT EDITORS A few signs you need a better editor: 4. You’ve hit a ceiling, and you can’t go higher.

Slide 101

Slide 101 text

THE CASE FOR THE PLAIN TEXT EDITOR

Slide 102

Slide 102 text

Technically, all you need to code is an app that will accept text:

Slide 103

Slide 103 text

Writing all your code in TextEdit.app would be pretty painful, though! ‣ Lots of typing! ‣ No project tree ‣ No syntax highlighting ‣ Sad and depressed

Slide 104

Slide 104 text

IDE? Integrated Development Environment

Slide 105

Slide 105 text

This is the part you actually need

Slide 106

Slide 106 text

Choosing a great text editor removes abstraction between your brain and your code.

Slide 107

Slide 107 text

IDE’s ‣Slow development time ‣Messy code ‣Unskillful developers

Slide 108

Slide 108 text

“Dreamweaver was attempting to be helpful, but the moment it reformatted my code, I threw a fit. YOU TOUCHED MY CODE. Dreamweaver never recovered from that horrendous first impression.” http://randsinrepose.com/

Slide 109

Slide 109 text

Enter the simple, powerful text editor

Slide 110

Slide 110 text

Here’s what to look for: ‣ are you comfortable in it? ‣ can it do what you need? ‣ is it writing code for you?

Slide 111

Slide 111 text

THE CURRENT STATE OF EDITORS

Slide 112

Slide 112 text

Editors on the market: ‣ Sublime Text ‣ Vim ‣ Atom ‣ TextMate ‣ BBedit ‣ Coda ‣ Emacs ‣ Espresso

Slide 113

Slide 113 text

Editors you should actually consider: ‣ Sublime Text ‣ Vim

Slide 114

Slide 114 text

Seriously, you guys. Vim Sublime Text sublimetext.com vim.org

Slide 115

Slide 115 text

“I don’t think of BBedit as a commitment. It simply continues to be the best choice.” —bit.ly/editor-rage

Slide 116

Slide 116 text

bit.ly/br-tooling-links

Slide 117

Slide 117 text

Why Sublime? ‣low barrier of entry sublimetext.com/

Slide 118

Slide 118 text

Why Sublime? ‣highly extensible

Slide 119

Slide 119 text

Why Sublime? ‣highly extensible sublime.wbond.net/installation

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

A few essential Sublime packages: Many more: sublime.wbond.net/ ‣ SideBarEnhancements ‣ AdvancedNewFile ‣ Emmet

Slide 122

Slide 122 text

Why Sublime? ‣killer features Go to Anything: ⌘+P

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

Why Sublime? ‣killer features Command Palette: ⌘+Shift+P

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

Why Sublime? ‣ recent rise in popularity ‣ compared to Coda or Espresso, it’s fast & close to the code ‣ Vintage mode for Vim key bindings ‣ hint: you should use Sublime

Slide 127

Slide 127 text

Why Vim?

Slide 128

Slide 128 text

Why Vim? ‣ fast ‣ mouseless! ‣ dot command, macros, commands by line ‣ configurable (vimrc, vundle) ‣ super old

Slide 129

Slide 129 text

…the fact that, yes, people still use an editor that is over 20 years old […], and those people number in the hundreds of thousands, perhaps they might be
 onto something. csswizardry.com/2014/06/vim-for-people-who-think- things-like-vim-are-weird-and-hard/

Slide 130

Slide 130 text

Why Vim? ‣ high skill ceiling ‣ popular (vimbits.com) ‣ Runs in a terminal ‣ everywhere (any platform, ssh, other people’s machines) ‣ fun, in a weird way

Slide 131

Slide 131 text

Runners-up panic.com/coda/ macrabbit.com/espresso/

Slide 132

Slide 132 text

THE RABID CASH MACHINE

Slide 133

Slide 133 text

TEXT EDITORS MATTER. GET FOAMY.

Slide 134

Slide 134 text

Editor Cults ‣ Get cultic about your editor ‣ As you're making your case, you'll have to nerd out on your editor. ‣ This is where real learning happens!

Slide 135

Slide 135 text

Seething, rabid coding machine

Slide 136

Slide 136 text

There’s only one thing more important than your editor. The code it helps you write.

Slide 137

Slide 137 text

While you're nerding out on your editor, your coworkers are raking in cash for the boss.

Slide 138

Slide 138 text

THE RABID CASH MACHINE He’s using Sublime

Slide 139

Slide 139 text

$ $

Slide 140

Slide 140 text

BUILD RIGHT: FRONTEND TOOLING SOURCE CONTROL

Slide 141

Slide 141 text

THE PATH OF PAIN Life without Source Control

Slide 142

Slide 142 text

Let’s build something!

Slide 143

Slide 143 text

No content

Slide 144

Slide 144 text

No content

Slide 145

Slide 145 text

No content

Slide 146

Slide 146 text

Manually look for changes

Slide 147

Slide 147 text

No content

Slide 148

Slide 148 text

Collaboration + Data Integrity

Slide 149

Slide 149 text

main.css neil.css rob.css old.css

Slide 150

Slide 150 text

What about you?

Slide 151

Slide 151 text

UH… WHAT’S SOURCE CONTROL?

Slide 152

Slide 152 text

TERMS

Slide 153

Slide 153 text

Push Server Computer

Slide 154

Slide 154 text

Pull Server Computer

Slide 155

Slide 155 text

Commit ⌘ S +

Slide 156

Slide 156 text

Branch Master New Branch

Slide 157

Slide 157 text

Master New Branch Merge

Slide 158

Slide 158 text

Conflict !@#$

Slide 159

Slide 159 text

Branching is a huge feature.

Slide 160

Slide 160 text

Git supports rapid branching and merging [...] A core assumption in Git is that a change will be merged more often than it is written, as it is passed around various reviewers. Branches in git are very lightweight. http://en.wikipedia.org/wiki/Git_(software)

Slide 161

Slide 161 text

Go Branch Crazy

Slide 162

Slide 162 text

DEFINING SOURCE CONTROL Source Control gives you: ‣ The ability to collaborate with others on a single codebase ‣ Manage any conflicts that collaboration brings ‣ The ability to move code around in time.

Slide 163

Slide 163 text

Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later —http://git-scm.com/book/en/Getting- Started-About-Version-Control

Slide 164

Slide 164 text

Local v. Centralized

Slide 165

Slide 165 text

Both of these solutions suffer from having the change data stored in a single place.

Slide 166

Slide 166 text

Distributed: A third option arises!

Slide 167

Slide 167 text

Git is a DVCS

Slide 168

Slide 168 text

We use Git because it allows effortless branching, it's blazing fast, and it's extremely reliable

Slide 169

Slide 169 text

“[In making Git] Take CVS as an example of what not to do; if in doubt, make the exact opposite decision." —Torvalds http://en.wikipedia.org/wiki/Git_(software)

Slide 170

Slide 170 text

No content

Slide 171

Slide 171 text

bit.ly/br-tooling-links

Slide 172

Slide 172 text

+

Slide 173

Slide 173 text

thehubapp.com Hub: better Github notifications

Slide 174

Slide 174 text

No content

Slide 175

Slide 175 text

INTRO TO USING GIT

Slide 176

Slide 176 text

Grab the GitHub App ! http://mac.github.com http://windows.github.com

Slide 177

Slide 177 text

DEMO

Slide 178

Slide 178 text

BUILD RIGHT: FRONTEND TOOLING DESIGN TOOLS

Slide 179

Slide 179 text

VERSION CONTROL FOR DESIGNERS!

Slide 180

Slide 180 text

‣ Keynote: apple.com/mac/keynote/ ‣ Moqups: moqups.com/ ‣ Foundation: foundation.zurb.com/ ‣ Bootstrap: getbootstrap.com/ Wireframing

Slide 181

Slide 181 text

Static or Hybrid?

Slide 182

Slide 182 text

No content

Slide 183

Slide 183 text

THE STATIC
 COMBATANTS

Slide 184

Slide 184 text

PAIN POINTS

Slide 185

Slide 185 text

POWER vs. COMPLEXITY

Slide 186

Slide 186 text

SKETCH Just enough power. No needless complexity.

Slide 187

Slide 187 text

No content

Slide 188

Slide 188 text

It ain’t perfect.

Slide 189

Slide 189 text

NO WINNERS

Slide 190

Slide 190 text

Design should be happening in all phases of a project.

Slide 191

Slide 191 text

Know your tools, use the right one for the task at hand.

Slide 192

Slide 192 text

Thoughts? Your Experience?

Slide 193

Slide 193 text

DEMO

Slide 194

Slide 194 text

BROWSER DEVELOPER TOOLS BUILD RIGHT: FRONTEND TOOLING

Slide 195

Slide 195 text

THE PATH OF PAIN Dev Tools Edition

Slide 196

Slide 196 text

We don’t know how good we have it ‣ Alerts to debug JavaScript alert("JavaScript is loaded!");

Slide 197

Slide 197 text

We don’t know how good we have it ‣ Blindly switching between editor and browser

Slide 198

Slide 198 text

Humble beginnings ‣ 2006: Firebug ‣ 2007: IE Developer toolbar (IE6 and IE7) ‣ 2009: IE8 Developer tools

Slide 199

Slide 199 text

Firebug: a tool is born

Slide 200

Slide 200 text

“When you hit the ‘Inspect’ button, mousing around the page will reveal the source of the element under your cursor ‘in real time’. Having the source instantly expand to reveal what what you touch is quite fun - it gives one the sensation of panning for gold.” ! —Joe Hewitt, creator of Firebug http://joehewitt.com/2006/03/15/firebug-a-love-story

Slide 201

Slide 201 text

No content

Slide 202

Slide 202 text

Now, dev tools are a key part of our workflow, and more powerful than ever.

Slide 203

Slide 203 text

YOUR BROWSER IS A DESIGN TOOL

Slide 204

Slide 204 text

Our designs have started far away from code…

Slide 205

Slide 205 text

…but we’re slowly moving closer to the code.

Slide 206

Slide 206 text

styletil.es “Style Tiles are similar to the paint chips and fabric swatches an interior designer gets approval on before designing a room”

Slide 207

Slide 207 text

…until we’re almost right on top of the code.

Slide 208

Slide 208 text

sparkbox.github.io/style-prototype/ “…allow[s] a client to get a visual summary of a site’s design direction without creating multiple Photoshop comps or fully developing HTML pages.

Slide 209

Slide 209 text

demo.pattern-lab.info/ Atoms can also include more abstract elements like color palettes, fonts and even more invisible aspects of an interface like animations.

Slide 210

Slide 210 text

Our deliverable? Websites. The sooner we get to the code, the closer we are to shipping.

Slide 211

Slide 211 text

Image: “You best solve problems using tools you are fluent with.” 
 —@bencallahan fluency

Slide 212

Slide 212 text

Modern browser developer tools are incredibly sophisticated. ! Fluency is possible.

Slide 213

Slide 213 text

We should shift the bulk of our time toward the environment where our final deliverable will live.

Slide 214

Slide 214 text

Is this… really less complex?

Slide 215

Slide 215 text

A FRIENDLY BEGINNER’S GUIDE What can the dev tools do for me?

Slide 216

Slide 216 text

⌘ + OPT + I! or right-click, “Inspect Element” How do I view source?

Slide 217

Slide 217 text

The ideal inspector layout for RWD work

Slide 218

Slide 218 text

The ideal inspector layout for RWD work

Slide 219

Slide 219 text

The ideal inspector layout for RWD work

Slide 220

Slide 220 text

Elements Tab

Slide 221

Slide 221 text

Network Tab

Slide 222

Slide 222 text

Sources Tab

Slide 223

Slide 223 text

DEV TOOLS MASTERY It can do that?!

Slide 224

Slide 224 text

Know this one thing!

Slide 225

Slide 225 text

The Settings Pane

Slide 226

Slide 226 text

Resources: loaded documents

Slide 227

Slide 227 text

Resources: local storage

Slide 228

Slide 228 text

Resources: cookies

Slide 229

Slide 229 text

Audit panel

Slide 230

Slide 230 text

Audit panel

Slide 231

Slide 231 text

Dev tools plugins

Slide 232

Slide 232 text

3rd Party Dev Tool Plugins ‣ Grunt devtools ‣ Ember Inspector ‣ RailsPanel ‣ You name it!

Slide 233

Slide 233 text

bit.ly/br-tooling-links

Slide 234

Slide 234 text

DEMO

Slide 235

Slide 235 text

PREPROCESSING BUILD RIGHT: FRONTEND TOOLING

Slide 236

Slide 236 text

“I’m doing just fine, thank-you.”

Slide 237

Slide 237 text

SEMANTIC SHIFT “the evolution of word usage — usually to the point that the modern meaning is radically different from the original usage” —http://en.wikipedia.org/wiki/Semantic_change

Slide 238

Slide 238 text

Usage of words, 1850 to 2014 —books.google.com/ngrams/

Slide 239

Slide 239 text

AWFUL inspiring wonder or truly terrible?

Slide 240

Slide 240 text

FANTASTIC existing only in the imagination or marvelous, wonderful?

Slide 241

Slide 241 text

MOUSE small gray rodent with a long tail or a plastic device used to navigate on a computer screen

Slide 242

Slide 242 text

Languages have always evolved.

Slide 243

Slide 243 text

Why should we expect anything less from computer languages? ‣ Incredible complexity ‣ Rapid change in hardware ‣ Rapid change in software

Slide 244

Slide 244 text

Embrace “semantic shift” in your workflow if it tends toward efficiency.

Slide 245

Slide 245 text

THE PATH OF PAIN Our languages are flawed ‣ HTML is redundant. ‣ CSS is “flat”. ‣ JavaScript is verbose.

Slide 246

Slide 246 text

Preprocessors let us live in a fantasy world where we create the languages we want.

Slide 247

Slide 247 text

What is a preprocessor, exactly?

Slide 248

Slide 248 text

User friendly language PREPROCESSOR Compiled language

Slide 249

Slide 249 text

Language optimized for humans PREPROCESSOR Language optimized for browsers

Slide 250

Slide 250 text

What, exactly? ‣ Preprocessors are a way to write code in a friendly language. ‣ The code then gets processed into something that browsers can understand.

Slide 251

Slide 251 text

CSS PREPROCESSORS

Slide 252

Slide 252 text

No content

Slide 253

Slide 253 text

Preprocessing: CSS ‣ Less: lesscss.org/ ‣ Stylus: learnboost.github.io/stylus/ ‣ Sass: sass-lang.com/

Slide 254

Slide 254 text

Less CSS .unstyled-link {! text-decoration: none;! }! ! .toollist-item {! .border-radius(5px);! background-color: #7b81d1;! ! a {! &:extend(.unstyled-link);! color: #000;! }! }! .toollist-item {! -webkit-border-radius: 5px;! -moz-border-radius: 5px;! border-radius: 5px;! background-color: #7b81d1;! }! ! .toollist-item a {! text-decoration: none; ! color: #000;! }!

Slide 255

Slide 255 text

.toollist-item {! -webkit-border-radius: 5px;! -moz-border-radius: 5px;! border-radius: 5px;! background-color: #7b81d1;! }! ! .toollist-item a {! text-decoration: none; ! color: #000;! }! Stylus CSS .unstyled-link! text-decoration none! ! .toollist-item! border-radius 5px! background-color #7b81d1! ! a! @extend .unstyled-link! color #000!

Slide 256

Slide 256 text

.unstyled-link {! text-decoration: none;! }! ! .toollist-item {! @include border-radius(5px);! background-color: #7b81d1;! ! a {! @extend %unstyled-link;! color: #000;! }! }! Sass CSS .toollist-item {! -webkit-border-radius: 5px;! -moz-border-radius: 5px;! border-radius: 5px;! background-color: #7b81d1;! }! ! .toollist-item a {! text-decoration: none; ! color: #000;! }!

Slide 257

Slide 257 text

PREPROCESSING: CSS Which one? ‣ nesting ‣ variables ‣ mixins / functions ‣ extends ‣ math ‣ including

Slide 258

Slide 258 text

PREPROCESSING: CSS We use Sass ‣ Widely used ‣ Personal preference ‣ Shipped with Rails ‣ Not much else

Slide 259

Slide 259 text

Let’s take a look at some Sass.

Slide 260

Slide 260 text

$primary-color: #cb592c;! $no-mq-support: false;!

Slide 261

Slide 261 text

@mixin sb-media($query) {! @if $no-mq-support{! @if $query < $serve-to-nomq-max-width{! @content;! }! } @else {! @media ( 'min-width:' + $query ) {! @content;! }! }! }

Slide 262

Slide 262 text

gem install sass! ! sass-lang.com

Slide 263

Slide 263 text

PREPROCESSING: CSS Sass: The Ecosystem ‣ Compass ‣ Bourbon ‣ Scut

Slide 264

Slide 264 text

gem install compass! ! compass-style.org

Slide 265

Slide 265 text

DEMO

Slide 266

Slide 266 text

JAVASCRIPT PREPROCESSORS

Slide 267

Slide 267 text

Preprocessing: JavaScript

Slide 268

Slide 268 text

var number, summaryMarkup;! ! number = 3 + 2;! ! summaryMarkup = "
\n

\n Foo: " + number + "\n

\n
";! JS

Slide 269

Slide 269 text

number = 3+2! ! summaryMarkup = """!
!

! Foo: #{number}!

!
! """! Coffee

Slide 270

Slide 270 text

Preprocessors let us live in a fantasy world where we create the languages we want.

Slide 271

Slide 271 text

sudo npm install -g coffee-script! ! coffeescript.org

Slide 272

Slide 272 text

HTML PREPROCESSORS

Slide 273

Slide 273 text

jade-lang.com

Slide 274

Slide 274 text

haml.info

Slide 275

Slide 275 text

We don’t use HTML preprocessing at Sparkbox

Slide 276

Slide 276 text

Emmet emmet.io/

Slide 277

Slide 277 text

No content

Slide 278

Slide 278 text

LET’S PULL IT ALL TOGETHER

Slide 279

Slide 279 text

No content

Slide 280

Slide 280 text

How do we compile preprocessed code?

Slide 281

Slide 281 text

bit.ly/br-tooling-links

Slide 282

Slide 282 text

incident57.com/codekit/

Slide 283

Slide 283 text

http://alphapixels.com/prepros/

Slide 284

Slide 284 text

Honorable mentions: ‣ Less.app ‣ Scout app ‣ Compass.app

Slide 285

Slide 285 text

Is there a better way?

Slide 286

Slide 286 text

Ruby Node SASS, Compass Grunt packages Bundler NPM Grunt

Slide 287

Slide 287 text

Grunt: a taskrunner gruntjs.com/

Slide 288

Slide 288 text

npm install -g grunt-cli

Slide 289

Slide 289 text

Grunt does all the things! ‣ Process CSS ‣ Process CoffeeScript ‣ Process HTML ‣ Reload a page when code changes ‣ Minify code ‣ So much more

Slide 290

Slide 290 text

Grunt is a JavaScript task runner that can automate dozens of repetitive tasks.

Slide 291

Slide 291 text

It's just JavaScript. (actually Node)

Slide 292

Slide 292 text

Grunt: Open source. Just files.

Slide 293

Slide 293 text

module.exports = function(grunt) {! ! // Project configuration.! grunt.initConfig({! pkg: grunt.file.readJSON('package.json'),! uglify: {! options: {! banner: '/*! <%= pkg.name %> <%=grunt.template.today("yyyy- ! ! ! mm-dd") %> */\n'! },! build: {! src: 'src/<%= pkg.name %>.js',! dest: 'build/<%= pkg.name %>.min.js'! }! }! });! ! // Load the plugin that provides the "uglify" task.! grunt.loadNpmTasks('grunt-contrib-uglify');! ! // Default task(s).! grunt.registerTask('default', ['uglify']);! }; Everything lives in Gruntfile.js

Slide 294

Slide 294 text

Other Task Runners: gulpjs.com

Slide 295

Slide 295 text

Other Task Runners: brunch.io

Slide 296

Slide 296 text

Other Task Runners: github.com/broccolijs/broccoli

Slide 297

Slide 297 text

Bower: a frontend package manager bower.io/

Slide 298

Slide 298 text

npm install -g bower

Slide 299

Slide 299 text

What is Bower? ‣ Pull down almost any JS library via the command line ‣ Not checking dependancies into the repo ‣ Use Grunt to manipulate the libraries once Bower pulls them down

Slide 300

Slide 300 text

bower install jquery

Slide 301

Slide 301 text

“Bower runs over Git, and is package-agnostic.” —http://bower.io

Slide 302

Slide 302 text

bower install [email protected]:sparkbox/Custom-Selectbox.git

Slide 303

Slide 303 text

{! "name": "br-demo",! "version": "0.1.0",! "dependencies": {! "jquery": "1.9.1",! "js-md5": "~1.1.0",! "d3": "3.4.2",! "bootstrap": "2.3.2"! }! } Everything lives in bower.json

Slide 304

Slide 304 text

The holy grail: modular markup

Slide 305

Slide 305 text

This is a simple page, right?

Slide 306

Slide 306 text

No content

Slide 307

Slide 307 text

Many repeating elements

Slide 308

Slide 308 text

This is our final preprocessor pain point

Slide 309

Slide 309 text

Handlebars + Assemble: powerful, modular markup

Slide 310

Slide 310 text

Handlebars ‣ Basic templating without a CMS ‣ Brings automation power to markup (100’s of helpers) ‣ Reduce repetition

Slide 311

Slide 311 text

Assemble ‣ Light static site generator ‣ Organize your layouts into manageable chunks ‣ Separate data from markup

Slide 312

Slide 312 text

Notice the repetition?

Slide 313

Slide 313 text

_tool-list-item.hbs
!
!
{{title}}
!
{{entry}}
! {{#if notes}}!
! ! Read more! !
! {{/if}}!
! ! {{#if notes}}!
!
! {{#markdown}}{{notes}}{{/markdown}}!
!
! {{/if}}!
! Let’s write that once.

Slide 314

Slide 314 text

_tool-list.hbs {{#each tool-list }}! {{> _tool-list-item }}! {{/each}}! Then use handlebars to automate it

Slide 315

Slide 315 text

_tool-list-item.scss .tool-list-item {! @extend %clearfix;! overflow: hidden;! padding: 3em 1em;! position: relative;! }! Now our Sass can mirror this partial

Slide 316

Slide 316 text

DEMO

Slide 317

Slide 317 text

Questions?

Slide 318

Slide 318 text

BUILD RIGHT: FRONTEND TOOLING LOCAL SERVERS

Slide 319

Slide 319 text

[…] what matters is if you can test any changes to your code fast enough. —http://programmers.stackexchange.com/ questions/139187/web-development-no-local- server-workflow

Slide 320

Slide 320 text

Working via Remote Server ‣ Slows development time ‣ Opens up production vulnerabilities ‣ Increases downtime

Slide 321

Slide 321 text

Working Locally ‣ Websites/apps load instantly ‣ Work offline* ‣ Allows existing live sites to be up and functioning normally. ‣ Catch errors before they get to staging or production.

Slide 322

Slide 322 text

Remember DVCS?

Slide 323

Slide 323 text

OPTIONS

Slide 324

Slide 324 text

bit.ly/br-tooling-links

Slide 325

Slide 325 text

Packages

Slide 326

Slide 326 text

Roll Your Own

Slide 327

Slide 327 text

Vagrant ‣ Creates a VM to exactly replicate a production environment. ‣ Vagrant’s config can be checked into source control to replicate the environment across a team. http://vagrantup.com

Slide 328

Slide 328 text

Docker ‣ The Docker Engine container comprises just the application and its dependencies. ‣ …it enjoys the resource isolation and allocation benefits of VMs but is much more portable and efficient. http://docker.com

Slide 329

Slide 329 text

Try a number of solutions to find one that fits your project, your team, and your workflow

Slide 330

Slide 330 text

Your Local server of choice? Questions?

Slide 331

Slide 331 text

DEVICE TESTING BUILD RIGHT: FRONTEND TOOLING

Slide 332

Slide 332 text

GET YOUR HANDS DIRTY

Slide 333

Slide 333 text

Community Device Lab Start one?

Slide 334

Slide 334 text

Company Device Lab Start one?

Slide 335

Slide 335 text

No content

Slide 336

Slide 336 text

Getting Started ‣ Android mobile device ‣ iOS mobile device (iPod Touch works great) ‣ A tablet: iPad Mini, Kindle Fire, or Google Nexus

Slide 337

Slide 337 text

Poor man’s device lab! —Image source: http://www.flickr.com/photos/21241102@N00/3908708670/

Slide 338

Slide 338 text

VIRTUALIZATION

Slide 339

Slide 339 text

Desktop OS virtualization allows developers to run alternate operating systems for testing purposes.

Slide 340

Slide 340 text

parallels.com virtualbox.org

Slide 341

Slide 341 text

bit.ly/br-tooling-links

Slide 342

Slide 342 text

But what about licensing?

Slide 343

Slide 343 text

LICENSING.

Slide 344

Slide 344 text

modern.ie

Slide 345

Slide 345 text

Every major IE and it’s needed OS

Slide 346

Slide 346 text

One-command install: ! github.com/xdissent/ievms

Slide 347

Slide 347 text

browserstack.com Simulated VMs in your browser

Slide 348

Slide 348 text

VIRTUALIZATION Mobile Device Emulation ‣ iOS simulation with Xcode’s iOS Simulator ‣ Android simulation with Google’s Android Emulator

Slide 349

Slide 349 text

We default to using physical devices if possible, VM’s for IE, and Browserstack for everything else.

Slide 350

Slide 350 text

SYNCHRONIZED TESTING SOFTWARE

Slide 351

Slide 351 text

3RD PARTY SOFTWARE 3rd party synchronized testing software ‣ Adobe Edge Inspect ‣ Ghostlab

Slide 352

Slide 352 text

Adobe Edge Inspect iOS & Android app Chrome Browser Extension 3RD PARTY SOFTWARE

Slide 353

Slide 353 text

Adobe Edge Inspect 3RD PARTY SOFTWARE

Slide 354

Slide 354 text

Adobe Edge inspect works great, but limited in devices. Included in CC membership. 3RD PARTY SOFTWARE

Slide 355

Slide 355 text

Ghostlab 3RD PARTY SOFTWARE

Slide 356

Slide 356 text

Ghostlab Mac & Windows application 3RD PARTY SOFTWARE

Slide 357

Slide 357 text

Ghostlab Hosts your site on a local server 3RD PARTY SOFTWARE

Slide 358

Slide 358 text

Ghostlab Point any device on your network to that server 3RD PARTY SOFTWARE

Slide 359

Slide 359 text

Ghostlab Inspector on host device 3RD PARTY SOFTWARE

Slide 360

Slide 360 text

Ghostlab is fast, almost unlimited in devices. $49.99 for license. 3RD PARTY SOFTWARE

Slide 361

Slide 361 text

ACCESSIBILITY TESTING

Slide 362

Slide 362 text

Don’t overlook accessibility testing. Consider it a part of your job.

Slide 363

Slide 363 text

VoiceOver on OS X System Preferences > Accessibility

Slide 364

Slide 364 text

VoiceOver on iOS ! Preferences > General > Accessibility

Slide 365

Slide 365 text

Sim Daltonism Mac App Store

Slide 366

Slide 366 text

iconfactory.com/software/xscope XScope

Slide 367

Slide 367 text

BUILD RIGHT: FRONTEND TOOLING AUTOMATED DEPLOYMENT

Slide 368

Slide 368 text

A Major Point of Vulnerability

Slide 369

Slide 369 text

STOP FTPing ALL THE FILES

Slide 370

Slide 370 text

“Own your deployments from beginning to end.” !

Slide 371

Slide 371 text

Services

Slide 372

Slide 372 text

bit.ly/br-tooling-links

Slide 373

Slide 373 text

No content

Slide 374

Slide 374 text

Roll Your Own

Slide 375

Slide 375 text

Mina

Slide 376

Slide 376 text

Features ‣ Fast! ‣ Uses Rake ‣ Boils down to a single Bash script

Slide 377

Slide 377 text

Downsides ‣ A little harder to support more complex configurations

Slide 378

Slide 378 text

require 'mina/bundler'! require 'mina/git'! ! set :domain, 'buildright.io'! set :deploy_to, '/var/www/buildright.io'! set :repository, 'git://...'! set :branch, 'master'! ! set :shared_paths, ['log']! ! task :setup => :environment do! queue! %[mkdir -p "#{deploy_to}/shared/log"]! queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]! end! ! desc "Deploys the current version to the server."! task :deploy => :environment do! deploy do! invoke :'git:clone'! invoke :'deploy:link_shared_paths'! invoke :'bundle:install'! ! to :launch do! queue "touch #{deploy_to}/tmp/restart.txt"! end! end! end! desc "Deploys the current version to the server."! task :deploy => :environment do! deploy do! invoke :'git:clone'! invoke :'deploy:link_shared_paths'! ! to :launch do! end! end! end deploy.rb

Slide 379

Slide 379 text

staging:! domain: staging.example.com! deploy_to: /var/www/staging_site! branch: master! ssh_options: "-A"! ! production:! domain: example.com! deploy_to: /var/www/site! branch: production! ssh_options: "-A"! ! default: staging environments.yml

Slide 380

Slide 380 text

Capistrano

Slide 381

Slide 381 text

Features ‣ Deploys to multiple environments out of the box. ‣ Ruby syntax

Slide 382

Slide 382 text

Downsides ‣ Slower than Mina ‣ More complex ‣ Developer commitment seemed to waiver a but for awhile recently

Slide 383

Slide 383 text

Questions?

Slide 384

Slide 384 text

THANK-YOU! @neilrenicker @robtarr