Slide 1

Slide 1 text

@a_simpson @neilrenicker

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

bit.ly/br-tooling-notes-sb

Slide 4

Slide 4 text

BUILD RIGHT: FRONTEND TOOLING PATH OF PAIN

Slide 5

Slide 5 text

BUILD RIGHT: FRONTEND TOOLING TRADITIONAL PAIN

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

PAIN POINTS

Slide 8

Slide 8 text

ENLIGHTENMENT

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

BUILD RIGHT: FRONTEND TOOLING WHERE ARE WE HEADED?

Slide 11

Slide 11 text

Source Control

Slide 12

Slide 12 text

Static Design Tools

Slide 13

Slide 13 text

Local Servers

Slide 14

Slide 14 text

Deployment

Slide 15

Slide 15 text

Preprocessing

Slide 16

Slide 16 text

Editors

Slide 17

Slide 17 text

Development Tools

Slide 18

Slide 18 text

Device Testing

Slide 19

Slide 19 text

Productivity

Slide 20

Slide 20 text

PRODUCTIVITY BUILD RIGHT: FRONTEND TOOLING

Slide 21

Slide 21 text

LAYING THE GROUNDWORK A Case For Laziness

Slide 22

Slide 22 text

Laziness: the programmer’s mantra

Slide 23

Slide 23 text

DRY Don’t Repeat Yourself

Slide 24

Slide 24 text

Productivity is about net gain.

Slide 25

Slide 25 text

LAYING THE GROUNDWORK Getting Into The Command Line

Slide 26

Slide 26 text

Should a frontend dev learn to use the CLI?

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

bit.ly/br-tooling-links

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

PRODUCTIVITY PAIN POINTS And Their Solutions

Slide 34

Slide 34 text

MOUSE CLICKS Using the pointer is usually cumbersome.

Slide 35

Slide 35 text

alfredapp.com Type everything.

Slide 36

Slide 36 text

Alfred Workflows

Slide 37

Slide 37 text

kapeli.com/dash Quick access to docs.

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

vimium.github.io Internet with your keyboard.

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

DOCUMENT SAVING, RETRIEVING & ORGANIZING

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Markdown

Slide 44

Slide 44 text

Markdown

Slide 45

Slide 45 text

Github —’s Markdown!

Slide 46

Slide 46 text

Github —’s Markdown!

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

EXCESSIVE TYPING

Slide 49

Slide 49 text

smilesoftware.com/ TextExpander TextExpander: speedy text snippets

Slide 50

Slide 50 text

Shortcuts within the terminal: aliases and bash scripts

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

Your /dotfiles repo

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

DISTRACTION

Slide 56

Slide 56 text

Syntax highlighting

Slide 57

Slide 57 text

Achieving focus: Obsessive singularity

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

manytricks.com/moom Moom: quick screen resizing

Slide 61

Slide 61 text

Achieving focus: The desktop of evil

Slide 62

Slide 62 text

Achieving focus: Hide your dock

Slide 63

Slide 63 text

Achieving focus: Do not disturb

Slide 64

Slide 64 text

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

Slide 65

Slide 65 text

THE PRODUCTIVITY MINDSET

Slide 66

Slide 66 text

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

Slide 67

Slide 67 text

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

Slide 68

Slide 68 text

Productivity Strain COMFY OUCH! RADICAL IMPROVEMENT

Slide 69

Slide 69 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 70

Slide 70 text

Simple example: ! TYPE ALL OF YOUR CODE

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

Your productivity hacks?

Slide 73

Slide 73 text

TEXT EDITORS BUILD RIGHT: FRONTEND TOOLING

Slide 74

Slide 74 text

Which editor do you use?

Slide 75

Slide 75 text

WHY CAN’T WE ALL JUST GET ALONG?

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 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 78

Slide 78 text

HOWEVER

Slide 79

Slide 79 text

You spend almost all of your time in your editor.

Slide 80

Slide 80 text

Your editor preference changes the way you think.

Slide 81

Slide 81 text

THE PATH OF PAIN

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

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

Slide 84

Slide 84 text

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

Slide 85

Slide 85 text

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

Slide 86

Slide 86 text

THE CASE FOR THE PLAIN TEXT EDITOR

Slide 87

Slide 87 text

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

Slide 88

Slide 88 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 89

Slide 89 text

IDE? Integrated Development Environment

Slide 90

Slide 90 text

This is the part you actually need

Slide 91

Slide 91 text

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

Slide 92

Slide 92 text

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

Slide 93

Slide 93 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 94

Slide 94 text

Enter the simple, powerful text editor

Slide 95

Slide 95 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 96

Slide 96 text

THE CURRENT STATE OF EDITORS

Slide 97

Slide 97 text

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

Slide 98

Slide 98 text

Editors you should actually consider: ‣ Sublime Text ‣ Vim

Slide 99

Slide 99 text

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

Slide 100

Slide 100 text

bit.ly/br-tooling-links

Slide 101

Slide 101 text

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

Slide 102

Slide 102 text

Why Sublime? ‣highly extensible

Slide 103

Slide 103 text

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

Slide 104

Slide 104 text

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

Slide 105

Slide 105 text

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

Slide 106

Slide 106 text

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

Slide 107

Slide 107 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 108

Slide 108 text

Why Vim?

Slide 109

Slide 109 text

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

Slide 110

Slide 110 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 111

Slide 111 text

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

Slide 112

Slide 112 text

THE RABID CASH MACHINE

Slide 113

Slide 113 text

TEXT EDITORS MATTER. GET FOAMY.

Slide 114

Slide 114 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 115

Slide 115 text

Seething, rabid coding machine

Slide 116

Slide 116 text

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

Slide 117

Slide 117 text

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

Slide 118

Slide 118 text

THE RABID CASH MACHINE He’s using Sublime

Slide 119

Slide 119 text

$ $

Slide 120

Slide 120 text

BUILD RIGHT: FRONTEND TOOLING SOURCE CONTROL

Slide 121

Slide 121 text

THE PATH OF PAIN Life without Source Control

Slide 122

Slide 122 text

Let’s build something!

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

No content

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

Manually look for changes

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

Collaboration + Data Integrity

Slide 129

Slide 129 text

What about you?

Slide 130

Slide 130 text

UH… WHAT’S SOURCE CONTROL?

Slide 131

Slide 131 text

TERMS

Slide 132

Slide 132 text

Push Server Computer

Slide 133

Slide 133 text

Pull Server Computer

Slide 134

Slide 134 text

Commit ⌘ S +

Slide 135

Slide 135 text

Branch Master New Branch

Slide 136

Slide 136 text

Master New Branch Merge

Slide 137

Slide 137 text

Conflict !@#$

Slide 138

Slide 138 text

Branching is a huge feature.

Slide 139

Slide 139 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://marc.info/?l=linux- kernel&m=111288700902396

Slide 140

Slide 140 text

Go Branch Crazy

Slide 141

Slide 141 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 142

Slide 142 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 143

Slide 143 text

Local v. Centralized

Slide 144

Slide 144 text

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

Slide 145

Slide 145 text

Distributed: A third option arises!

Slide 146

Slide 146 text

Git is a DVCS

Slide 147

Slide 147 text

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

Slide 148

Slide 148 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 149

Slide 149 text

No content

Slide 150

Slide 150 text

bit.ly/br-tooling-links

Slide 151

Slide 151 text

QUITE THE COUPLE

Slide 152

Slide 152 text

No content

Slide 153

Slide 153 text

INTRO TO USING GIT

Slide 154

Slide 154 text

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

Slide 155

Slide 155 text

Main screen

Slide 156

Slide 156 text

Changes

Slide 157

Slide 157 text

Unsynced commits

Slide 158

Slide 158 text

History

Slide 159

Slide 159 text

BUILD RIGHT: FRONTEND TOOLING DESIGN TOOLS

Slide 160

Slide 160 text

VERSION CONTROL FOR DESIGNERS!

Slide 161

Slide 161 text

Static or Hybrid?

Slide 162

Slide 162 text

No content

Slide 163

Slide 163 text

bit.ly/br-tooling-links

Slide 164

Slide 164 text

THE STATIC COMBATANTS

Slide 165

Slide 165 text

No content

Slide 166

Slide 166 text

PAIN POINTS

Slide 167

Slide 167 text

PHOTOSHOP

Slide 168

Slide 168 text

Photoshop is the most widely used, and most well known. http://bradfrostweb.com/blog/post/the-post-psd-era/

Slide 169

Slide 169 text

No content

Slide 170

Slide 170 text

Multiple Files v. Layer Comps

Slide 171

Slide 171 text

Layer Comps

Slide 172

Slide 172 text

Photoshop Drawbacks

Slide 173

Slide 173 text

ILLUSTRATOR

Slide 174

Slide 174 text

No content

Slide 175

Slide 175 text

Illustrator Drawbacks

Slide 176

Slide 176 text

SKETCH

Slide 177

Slide 177 text

No content

Slide 178

Slide 178 text

Sketch Cons

Slide 179

Slide 179 text

NO WINNERS

Slide 180

Slide 180 text

Reality is that design should be happening in all phases of a project.

Slide 181

Slide 181 text

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

Slide 182

Slide 182 text

Thoughts? Your Experience?

Slide 183

Slide 183 text

BROWSER DEVELOPER TOOLS BUILD RIGHT: FRONTEND TOOLING

Slide 184

Slide 184 text

THE PATH OF PAIN Dev Tools Edition

Slide 185

Slide 185 text

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

Slide 186

Slide 186 text

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

Slide 187

Slide 187 text

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

Slide 188

Slide 188 text

Firebug: a tool is born

Slide 189

Slide 189 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 190

Slide 190 text

No content

Slide 191

Slide 191 text

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

Slide 192

Slide 192 text

YOUR BROWSER IS A DESIGN TOOL

Slide 193

Slide 193 text

Our designs have started far away from code…

Slide 194

Slide 194 text

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

Slide 195

Slide 195 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 196

Slide 196 text

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

Slide 197

Slide 197 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 198

Slide 198 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 199

Slide 199 text

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

Slide 200

Slide 200 text

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

Slide 201

Slide 201 text

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

Slide 202

Slide 202 text

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

Slide 203

Slide 203 text

Is this… really less complex?

Slide 204

Slide 204 text

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

Slide 205

Slide 205 text

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

Slide 206

Slide 206 text

The ideal inspector layout for RWD work

Slide 207

Slide 207 text

The ideal inspector layout for RWD work

Slide 208

Slide 208 text

The ideal inspector layout for RWD work

Slide 209

Slide 209 text

Elements Tab

Slide 210

Slide 210 text

Network Tab

Slide 211

Slide 211 text

Sources Tab

Slide 212

Slide 212 text

DEV TOOLS MASTERY It can do that?!

Slide 213

Slide 213 text

Know this one thing!

Slide 214

Slide 214 text

The Settings Pane

Slide 215

Slide 215 text

Resources: loaded documents

Slide 216

Slide 216 text

Resources: local storage

Slide 217

Slide 217 text

Resources: cookies

Slide 218

Slide 218 text

Audit panel

Slide 219

Slide 219 text

Audit panel

Slide 220

Slide 220 text

Dev tools plugins

Slide 221

Slide 221 text

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

Slide 222

Slide 222 text

bit.ly/br-tooling-links

Slide 223

Slide 223 text

PREPROCESSING BUILD RIGHT: FRONTEND TOOLING

Slide 224

Slide 224 text

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

Slide 225

Slide 225 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 226

Slide 226 text

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

Slide 227

Slide 227 text

AWFUL inspiring wonder or truly terrible?

Slide 228

Slide 228 text

FANTASTIC existing only in the imagination or marvelous, wonderful?

Slide 229

Slide 229 text

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

Slide 230

Slide 230 text

Languages have always evolved.

Slide 231

Slide 231 text

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

Slide 232

Slide 232 text

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

Slide 233

Slide 233 text

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

Slide 234

Slide 234 text

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

Slide 235

Slide 235 text

What is a preprocessor, exactly?

Slide 236

Slide 236 text

User friendly language PREPROCESSOR Compiled language

Slide 237

Slide 237 text

Language optimized for humans PREPROCESSOR Language optimized for browsers

Slide 238

Slide 238 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 239

Slide 239 text

CSS PREPROCESSORS

Slide 240

Slide 240 text

No content

Slide 241

Slide 241 text

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

Slide 242

Slide 242 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 243

Slide 243 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 244

Slide 244 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 245

Slide 245 text

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

Slide 246

Slide 246 text

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

Slide 247

Slide 247 text

Let’s take a look at some Sass.

Slide 248

Slide 248 text

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

Slide 249

Slide 249 text

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

Slide 250

Slide 250 text

gem install sass! ! sass-lang.com

Slide 251

Slide 251 text

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

Slide 252

Slide 252 text

gem install compass! ! compass-style.org

Slide 253

Slide 253 text

JAVASCRIPT PREPROCESSORS

Slide 254

Slide 254 text

Preprocessing: JavaScript

Slide 255

Slide 255 text

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

\n Foo: " + number + "\n

\n
";! JS

Slide 256

Slide 256 text

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

! Foo: #{number}!

!
! """! Coffee

Slide 257

Slide 257 text

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

Slide 258

Slide 258 text

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

Slide 259

Slide 259 text

HTML PREPROCESSORS

Slide 260

Slide 260 text

jade-lang.com

Slide 261

Slide 261 text

haml.info

Slide 262

Slide 262 text

We don’t use HTML preprocessing at Sparkbox

Slide 263

Slide 263 text

Emmet emmet.io/

Slide 264

Slide 264 text

LET’S PULL IT ALL TOGETHER

Slide 265

Slide 265 text

No content

Slide 266

Slide 266 text

How do we compile preprocessed code?

Slide 267

Slide 267 text

bit.ly/br-tooling-links

Slide 268

Slide 268 text

incident57.com/codekit/

Slide 269

Slide 269 text

http://alphapixels.com/prepros/

Slide 270

Slide 270 text

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

Slide 271

Slide 271 text

Is there a better way?

Slide 272

Slide 272 text

Ruby Node SASS, Compass Grunt packages Bundler NPM Grunt

Slide 273

Slide 273 text

Grunt: a taskrunner gruntjs.com/

Slide 274

Slide 274 text

npm install -g grunt-cli

Slide 275

Slide 275 text

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

Slide 276

Slide 276 text

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

Slide 277

Slide 277 text

It's just JavaScript. (actually Node)

Slide 278

Slide 278 text

Grunt: Open source. Just files.

Slide 279

Slide 279 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 280

Slide 280 text

Bower: a frontend package manager bower.io/

Slide 281

Slide 281 text

npm install -g bower

Slide 282

Slide 282 text

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

Slide 283

Slide 283 text

bower install jquery

Slide 284

Slide 284 text

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

Slide 285

Slide 285 text

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

Slide 286

Slide 286 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 287

Slide 287 text

The holy grail: modular markup

Slide 288

Slide 288 text

This is a simple page, right?

Slide 289

Slide 289 text

No content

Slide 290

Slide 290 text

Many repeating elements

Slide 291

Slide 291 text

This is our final preprocessor pain point

Slide 292

Slide 292 text

Handlebars + Assemble: powerful, modular markup

Slide 293

Slide 293 text

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

Slide 294

Slide 294 text

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

Slide 295

Slide 295 text

Notice the repetition?

Slide 296

Slide 296 text

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

Slide 297

Slide 297 text

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

Slide 298

Slide 298 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 299

Slide 299 text

Questions?

Slide 300

Slide 300 text

BUILD RIGHT: FRONTEND TOOLING LOCAL SERVERS

Slide 301

Slide 301 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 302

Slide 302 text

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

Slide 303

Slide 303 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 304

Slide 304 text

Remember DVCS?

Slide 305

Slide 305 text

OPTIONS

Slide 306

Slide 306 text

bit.ly/br-tooling-links

Slide 307

Slide 307 text

Packages

Slide 308

Slide 308 text

Roll Your Own

Slide 309

Slide 309 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.

Slide 310

Slide 310 text

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

Slide 311

Slide 311 text

Your Local server of choice? Questions?

Slide 312

Slide 312 text

DEVICE TESTING BUILD RIGHT: FRONTEND TOOLING

Slide 313

Slide 313 text

GET YOUR HANDS DIRTY

Slide 314

Slide 314 text

Community Device Lab Start one?

Slide 315

Slide 315 text

Company Device Lab Start one?

Slide 316

Slide 316 text

No content

Slide 317

Slide 317 text

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

Slide 318

Slide 318 text

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

Slide 319

Slide 319 text

VIRTUALIZATION

Slide 320

Slide 320 text

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

Slide 321

Slide 321 text

parallels.com virtualbox.org

Slide 322

Slide 322 text

bit.ly/br-tooling-links

Slide 323

Slide 323 text

But what about licensing?

Slide 324

Slide 324 text

LICENSING.

Slide 325

Slide 325 text

modern.ie

Slide 326

Slide 326 text

Every major IE and it’s needed OS

Slide 327

Slide 327 text

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

Slide 328

Slide 328 text

browserstack.com Simulated VMs in your browser

Slide 329

Slide 329 text

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

Slide 330

Slide 330 text

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

Slide 331

Slide 331 text

SYNCHRONIZED TESTING SOFTWARE

Slide 332

Slide 332 text

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

Slide 333

Slide 333 text

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

Slide 334

Slide 334 text

Adobe Edge Inspect 3RD PARTY SOFTWARE

Slide 335

Slide 335 text

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

Slide 336

Slide 336 text

Ghostlab 3RD PARTY SOFTWARE

Slide 337

Slide 337 text

Ghostlab Mac & Windows application 3RD PARTY SOFTWARE

Slide 338

Slide 338 text

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

Slide 339

Slide 339 text

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

Slide 340

Slide 340 text

Ghostlab Inspector on host device 3RD PARTY SOFTWARE

Slide 341

Slide 341 text

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

Slide 342

Slide 342 text

ACCESSIBILITY TESTING

Slide 343

Slide 343 text

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

Slide 344

Slide 344 text

VoiceOver on OS X System Preferences > Accessibility

Slide 345

Slide 345 text

VoiceOver on iOS ! Preferences > General > Accessibility

Slide 346

Slide 346 text

Sim Daltonism Mac App Store

Slide 347

Slide 347 text

iconfactory.com/software/xscope XScope

Slide 348

Slide 348 text

BUILD RIGHT: FRONTEND TOOLING AUTOMATED DEPLOYMENT

Slide 349

Slide 349 text

A Major Point of Vulnerability

Slide 350

Slide 350 text

STOP FTPing ALL THE FILES

Slide 351

Slide 351 text

“Own your deployments from beginning to end.” !

Slide 352

Slide 352 text

Services

Slide 353

Slide 353 text

bit.ly/br-tooling-links

Slide 354

Slide 354 text

No content

Slide 355

Slide 355 text

Roll Your Own

Slide 356

Slide 356 text

Mina

Slide 357

Slide 357 text

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

Slide 358

Slide 358 text

Downsides ‣ Doesn’t support more complex configurations

Slide 359

Slide 359 text

require 'mina/git'! ! set :repository, 'git://...'! set :env_config, YAML.load_file('./config/env.yml')! set :environment, ENV['on'] || env_config.fetch('default')! ! desc 'Sets up Mina to deploy to the requested environment'! task :environment do! env_config.fetch(environment).each do |key, value|! set key.to_sym, value.to_s! end! end! ! task :setup => :environment do! 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 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 360

Slide 360 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 361

Slide 361 text

Capistrano

Slide 362

Slide 362 text

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

Slide 363

Slide 363 text

Downsides ‣ Slower than Mina ‣ More complex ‣ 2.x is buggy

Slide 364

Slide 364 text

Questions?

Slide 365

Slide 365 text

THANK-YOU!