$30 off During Our Annual Pro Sale. View Details »

Automating Front-end Workflow

Automating Front-end Workflow

Writing a modern web app these days can sometimes feel like a tedious process; frameworks, boilerplates, abstractions, dependency management, build processes..the list of requirements for a front-end workflow appears to grow each year.

What if however, you could automate a lot of this? This talk introduces you to a new workflow of tools to keep you productive on the front-end.

Learn about:
- Yeoman, Grunt and Bower
- Brand new features in Chrome DevTools
- Alfred workflows
- Tools for live editing and debugging CSS/JS/HTML with Chrome
- Productivity tools for Sublime
- Tools for synchronised cross-device mobile testing
- Network throttling tools
- Visual regression testing tools
and much more.

Keynote from FOWA 2013.

Addy Osmani

October 25, 2013
Tweet

More Decks by Addy Osmani

Other Decks in Programming

Transcript

  1. Develop Watch Sass / Less / Stylus Watch CoffeeScript Watch

    Jade / Haml LiveReload JS / CSS Linting
  2. Code linting Running unit tests Compile everything Minify and concatenate

    Generate images / icons Optimize performance HTTP Server Deployment Build
  3. Scaffold, write less with Yo Build, preview and test with

    Grunt Manage dependencies with Bower
  4. { ! "name": "awesome-app", ! "version": "0.0.1", ! "devDependencies": {

    ! ! "grunt": "~0.4.1", ! ! "grunt-contrib-jshint": "~0.6.3", ! ! "grunt-contrib-uglify": "~0.2.0" ! } } Specify Grunt plugins and metadata.
  5. module.exports = function(grunt){ ! grunt.initConfig({ ! ! uglify: { !

    ! ! build: { src: 'app.js', dest: 'build/app.min.js'} ! ! }, ! ! jshint: { all: ['**/*.js']} ! }); ! grunt.loadNpmTasks('grunt-contrib-uglify'); ! grunt.loadNpmTasks('grunt-contrib-jshint'); ! grunt.registerTask('default', ['jshint', 'uglify']); }; Config tasks and load plugins
  6. speed tip grunt-concurrent Speed up build time by concurrently running

    tasks like Sass and Coffee. bit.ly/grunt-conc
  7. speed tip grunt-newer Run tasks on only source files modified

    since the last run. bit.ly/grunt-newer
  8. 1. That lib is 6 months old? Better update. 2.

    Open up the site 3. Download the lib 4. Copy from ~/Downloads 5. Paste to app folder 6. Wire in with script tags The old way of doing things.
  9. $ bower search angular Search results: angular git://github.com/angular/bower-angular.git angular-mocks git://github.com/angular/bower-angular-mocks.git

    angular-resource git://github.com/angular/bower-angular- resource.git angular-cookies git://github.com/angular/bower-angular-cookies.git angular-sanitize git://github.com/angular/bower-angular- sanitize.git angular-bootstrap git://github.com/angular-ui/bootstrap-bower.git ........
  10. $ bower install $ bower install <package> $ bower install

    <package>#<version> $ bower install <name>=<package>#<version>
  11. $ bower list bower check-new Checking for new versions of

    the project dependencies.. testapp#0.0.0 /Users/addyo/projects/testapp ᵓᴷᴷ angular#1.0.8 (latest is 1.2.0-rc.3) ᵓᴷᵣ bootstrap#3.0.0 ᴹ ᵋᴷᴷ jquery#1.9.1 (2.0.3 available) ᵓᴷᴷ jquery#1.9.1 (latest is 2.0.3) ᵋᴷᴷ modernizr#2.6.2
  12. $ yo [?] What would you like to do? ›❯

    Install a generator Run the Angular generator (0.4.0) Run the Backbone generator (0.1.9) Run the Blog generator (0.0.0) Run the jQuery generator (0.1.4) Run the Gruntfile generator (0.0.6) (Move up and down to reveal more choices)
  13. $ yo [?] What would you like to do? Install

    a generator [?] Search NPM for generators: jquery [?] Here's what I found. Install one? ›❯ generator-jquery-boilerplate generator-jquery-mobile Search again Return home
  14. $ yo jquery-boilerplate create .jshintrc create CONTRIBUTING.md create Gruntfile.js create

    HISTORY.md create boilerplate.jquery.json create demo/index.html create dist/jquery.boilerplate.js create dist/jquery.boilerplate.min.js create package.json create src/jquery.boilerplate.coffee create src/jquery.boilerplate.js
  15. $ yo bootstrap In what format would you like the

    Twitter Bootstrap stylesheets? (Use arrow keys) ›❯ css sass less stylus
  16. $ yo webapp Out of the box I include H5BP

    and jQuery. [ ? ] What more would you like? ›❯ Bootstrap for Sass RequireJS Modernizr
  17. Boilerplate - H5BP, Bootstrap, Modernizr Abstractions - optionally Sass, CoffeeScript,

    grunt- bower-install available by default. Performance optimization - optimize images, scripts, stylesheets, get lean Modernizr builds, concurrently run all of these tasks at build time. Testing and build process - Mocha, Jasmine, PhantomJS Boom. Just created a webapp!
  18. $ yo angular [?] Would you like to include Bootstrap?

    (Y/n) [?] Would you like to use the SCSS version?
  19. $ yo angular [?] Would you like to include Bootstrap?

    (Y/n) [?] Would you like to use the SCSS version? [?] Which modules would you like to include? (Press <space> to select) ›❯ angular-resource.js angular-cookies.js angular-sanitize.js
  20. $ yo jekyllrb Tell us a little about yourself. ☛

    [?] Name: Addy Osmani [?] Email: [email protected] [?] GitHub username: addyosmani [?] Twitter username: @addyosmani Wire tools and preprocessors. ☛ [?] CSS preprocessor: Sass [?] Use Autoprefixer? Yes [?] Javascript preprocessor: Coffeescript ›❯ None
  21. $ yo chrome-extension [?] What would you like to call

    this extension? [?] How would you describe it? [?] Would you like more UI Features? ›❯ Options Page Content Scripts Omnibox [?] Would you like to use permissions? (Press <space> to select) ›❯ Tabs Bookmarks Cookies History Management
  22. $ yo mobile Bootstrap 3, TopCoat, Foundation, Pure Generates responsive

    images Generates site screenshots Removes 300ms delay on touch Boilerplate for Fullscreen API Integrated BrowserStack testing Polyfill for async localStorage and more. bit.ly/yomobile
  23. $ gitexport function gitexport(){ mkdir -p "$1" git archive master

    | tar -x -C "$1" } Copy a local checkout without the .git stuff
  24. Remote Preview ◦ [+] Free! ◦ [-] Loads page into

    iframe ◦ [-] Requires user to type url in page ◦ [+] Central place to change url to load into iframe after initial set-up bit.ly/remotepreview
  25. Adobe Edge Inspect ◦ [-] One device at a time

    ◦ [-] Displays site in a WebView ◦ [+] Supports live reload ◦ [+] Extension to load any page you view in Chrome ◦ [-] Can’t account for localhost (i.e. switch to ip addr. of machine on local network) ◦ [+] Remote Inspect via Weinre bit.ly/edgeinspect
  26. Grunt + LiveReload ◦ [+] Free! ◦ [+] Easily see

    how each change you save looks across devices ◦ [+] Works with any modern mobile browser ◦ [-] Requires you to use Grunt for your build process bit.ly/gruntsync
  27. Ghostlab ◦ [+] Creates server to folder contents ◦ [+]

    Syncs scrolls, clicks and reloads ◦ [-] Needs typing into browser on each device ◦ [+] Allows to match up scrolling and input ◦ [-] OS X Only ◦ [+] Debugging via Weinre bit.ly/ghostapp