JLPDevs - Optimization Tooling for Modern Web App Development
5. Dec 2015•0 gefällt mir•243 views
Downloaden Sie, um offline zu lesen
Melden
Software
The core content is about optimizing our web app development, functionality, and performance with various tooling. The main language/platform we will be talking are JavaScript and Node.js.
19. Let’s have some ideas to
fix those kind of things
(Especially yours if you have)
20. “The Hacker Way is an approach to building
that involves continuous improvement and iteration.
Hackers believe that something can always be
better, and that nothing is ever complete.”
―Mark Zuckerberg
26. 1. Baseline on trivial assets
a. Image optimization
b. Code minification
c. File concatenation
d. Compression (gzip/Zopfli)
e. Async scripts
f. Leverage caching
g. Light font format (WOFF2)
h. Image sprites
i. Avoid redirection
Structure
27. 2. Further on assets processing
a. Inline critical CSS
b. Remove unused CSS
c. Remove duplicated or combine similar
attributes (selector, color, size, font family)
d. Offline with service worker
e. Set performance budget
f. etc
Structure
28. We will talk just
the essentials
(Everything else can be googled)
44. Code Style, Syntax, and Potential Error Checking:
Linting / Hinting
http://eslint.org | http://standardjs.com
A. JSLint
B. JSHint
C. ESLint
D. JSCS
E. standard
45. Reducement of Assets
A. Concatenation
B. Minification/Uglification
C. Compression and gzipping
53. Jade v Haml
doctype html
html(lang="en")
head
title= pageTitle
body
h1 Heading
#container.col
p.
Jade is a terse and simple
templating language with a
strong focus on performance
and powerful features.
!!!
%html{:lang => "en"}
%head
%title Page Title
%body
%h1 Heading
#container.col
%p
Haml is a beautiful, DRY,
well-indented, clear
markup: templating haiku.
60. Gotta Install Them All!
# Install Node.js from OS package manager or nvm
$ sudo apt-get install nodejs # or brew install node
$ nvm install v4
# Install tools globally as a CLI app
$ npm install -g bower gulp grunt yo
# Initialize npm and Bower config file
$ cd path/to/repo
$ npm init && bower init
# Install npm and Bower dependencies
$ npm install && bower install
61. Getting Started with Gulp/Grunt
# Install Gulp/Grunt
$ npm install -g gulp grunt
# Install in repo development dependencies
$ npm install --save-dev gulp grunt
# Create a gulpfile.js or Gruntfile at the root of repo
$ vim gulpfile.js
$ vim Gruntfile
62. # Install Yeoman and Slush
$ npm install -g yo slush
# Install a generator
$ npm install -g generator-*
$ npm install -g slush-*
# Using a generator
$ cd path/to/repo
$ yo <generator-name>
$ slush <generator-name>
Getting Started with Yeoman/Slush
63. Run Them
# Check out our installed Node.js
$ node -v
# Run Gulp/Grunt to do something
$ gulp <command>
$ grunt <command>
# Serve our web app for development
$ gulp serve
$ grunt serve
# Build our web app for production
$ gulp build
$ grunt build