Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Front End Workflow
Search
Matt Bailey
October 17, 2015
Technology
2
1.2k
Front End Workflow
A look at current front end workflow - tools, techniques, methodologies.
Matt Bailey
October 17, 2015
Tweet
Share
More Decks by Matt Bailey
See All by Matt Bailey
How I acheived a pretty good Google PageSpeed Insights score
mattbailey
1
130
Workshop: Making Responsive Websites Fast
mattbailey
0
54
GPMD - Our Journey
mattbailey
0
68
Other Decks in Technology
See All in Technology
[FOSS4G 2019 Niigata] AIによる効率的危険斜面抽出システムの開発について
nssv
0
300
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
1
1.6k
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
1
250
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.1k
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
110
Microsoft MVPになる前、なってから/Fukuoka_Tech_Women_Community_1_baba
nina01
0
190
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
Teambox: Starting and Learning
jrom
133
8.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Gamification - CAS2011
davidbonilla
80
5k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
A better future with KSS
kneath
238
17k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Transcript
Front End Workflow
None
My Journey Where I’ve Come From Where I Am Now
What’s Next
Matt Bailey @_mattbailey mattbailey.io
Creative Director gpmd.co.uk
Design Front End Development
My Journey
Where I’ve Come From
The Transition From Analogue To Digital
None
None
Where I Am Now
It’s still very much a journey Learning new things on
a daily basis
Responsive Web Design
None
Responsive Web Design Has Created Significant Challenges A Need For
A More ‘Agile’ Approach In Our Design Process
None
None
None
Design & Development Tools Have Changed Dramatically
None
None
Countless Frameworks, Platforms, Content Management Systems, Site Generators etc.
None
Source code and version control management
Consistent Development Environments
None
Multi-device testing
None
Dependency And Package Managers, Preprocessors, Build Tools, And Methodologies
None
Coding Languages, Coding Style And Methodologies
CSS Preprocessors Less Sass (SCSS) Stylus
Huge Increase In Efficiency More Like A ‘Proper’ Programming Language
Variables Mixins Functions Extends And so on…
BEM Block Element Modifier
.block {} .block__element {} .block__element--modifier {}
BEM helps us write CSS that… Easy to scale Is
clear and obvious in its purpose Is self-documenting http://www.gpmd.co.uk/blog/our-approach-to-bem/
ITCSS Inverted Triangle CSS Harry Roberts (CSS Wizardry)
Settings Tools Generic Base Objects Vendor Components Trumps
A Highly Modular Way Of Structuring CSS Starts With Low
Specificity (HTML tags) Rules Ends With High Specificity/Complexity Rules http://www.gpmd.co.uk/blog/scalable-css/
my-project/ `- src/ `- styles/ |- settings/ # Variables |-
tools/ # Functions, mixins etc. |- generic/ # Low-specificity (normalize) |- base/ # Unclassed HTML elements |- objects/ # Design-free objects & patterns |- vendor/ # Third party components |- components/ # Modules, widgets etc. (theme) `- trumps/ # Helper classes and overrides
Sassbase https://github.com/gpmd/sassbase
Performance & Optimisation
Image Optimisation & Delivery
‘picture’ element, & ’srcset’ and ‘sizes’ Content Delivery Networks Image
Management Pipeline - Dynamically deliver different image sizes and file formats (WebP, JPEGXR etc.) to end users
Critical Rendering Path
Methods And Best Practices For Improving The Render Time Of
Our Pages Minify/uglifying Remove render blocking CSS/JavaScript Load JavaScript asynchronously Inline critical CSS in the head etc…
A Hugely Diverse Role
Coding Standards & Conventions Style Guides and Pattern Libraries Dependency
Management & Package Managers Build Systems Regression Testing Performance Optimisation Continuous Integration Documentation
Designer & Front End Architect
–Elyse Holladay “I want to build systems, architectures. I want
my users to be my fellow developer and designers as much as the end user. I want to make a site where the code on the inside looks as great as the outside, and make it easy to do things like theme, A/B test, and build new modules.”
Let’s Do This
None
Project Structure
my-project/ # Project (Git) root | |- public_html/ # Web
root | `- themes/ | `- my-theme/ # (dist) Build destination | |- src/ # Source files | |- bower_components/ # Front end components |- bower.json | |- node_modules/ # Build dependencies |- package.json | `- Gruntfile.js # Build config
Dependency Management
Build System Dependencies
grunt grunt-autoprefixer grunt-concurrent grunt-contrib-clean grunt-contrib-concat grunt-contrib-copy grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-jshint grunt-contrib-uglify
grunt-contrib-watch grunt-csscss grunt-modernizr grunt-sass grunt-scss-lint grunt-spritesmith grunt-stylestats load-grunt-config jshint-stylish time-grunt
Front End Components
picturefill modernizr normalize.css normalize-opentype.css jquery respond jquery-hoverIntent smooth-scroll owl-carousel2 background-size-polyfill
jquery-replacetext CSS3MultiColumn isotope imagesloaded tablesaw
Build System
Task Manager
Gruntfile.js load-grunt-config - separate out task configs build environments -
‘prod’ and ‘dev’
module.exports = function(grunt) { # Use load-grunt-config require('load-grunt-config')(grunt, { jitGrunt:
true, # Use fast plugin loader init: true, data: { # $ grunt --env=prod (or) --env=dev env: grunt.option('env') || 'prod', # src and dynamic dist locations project: { src: 'src', dist: '<% if (env === "prod") { %>tmp<% } else { %>dist<% } %>' } } }); };
Grunt Task Configs In Separate Files
my-project/ | |- grunt/ | |- sass.js | |- uglify.js
| |- watch.js | `- # etc. | `- Gruntfile.js
aliases.js
module.exports = function(grunt, data) { var env = data.env ||
'prod'; return { default: { # Default build tasks: [env] }, dev: { # Dev build tasks tasks: [ ‘concurrent:devFirst', 'concurrent:devSecond' ] }, prod: { # Production build tasks tasks: [ 'concurrent:prodFirst', 'concurrent:prodSecond' ] } }; };
concurrent.js
module.exports = { options: { limit: 3 }, devFirst: [
# 1st dev target 'clean:dev' ], devSecond: [ # 2nd dev target 'sass:dev', 'uglify:dev' ], prodFirst: [ # 1st production target 'clean:prod' ], prodSecond: [ # 2nd production target 'sass:prod', 'uglify:prod' ] };
Sass Tasks grunt-sass - Uses fast libsass compiler grunt-scss-lint -
Lint your SCSS files css-min - Efficient CSS minifier
CSS Reporting Tasks grunt-csscss - Find duplicated declarations grunt-stylestats -
Evaluate & report CSS stats
And the rest… grunt-autoprefixer grunt-modernizr grunt-contrib-concat grunt-contrib-imagemin grunt-spritesmith grunt-contrib-jshint grunt-contrib-uglify
grunt-contrib-watch etc…
Gruntbase https://github.com/gpmd/gruntbase
Git Hooks
post-merge Runs after a `git merge` or `git pull`
1. Checks for changed files 2. Runs npm install &&
npm prune 3. Runs bower install && bower prune 4. Runs grunt
pre-commit Runs before a `git commit`
1. Runs grunt 2. Won’t commit if build fails git
commit -m “My Message” -n
my-project/ | |- .git | `- hooks | |- post-merge
-> ../../githooks/post-merge | `- pre-commit -> ../../githooks/pre-commit | `- githooks |- post-merge `- pre-commit
Initial Setup
setup.sh > 1. githooks.sh # Creates Git hook symlinks 2.
build.sh # Installs dependencies and runs build
What’s Next?
None
CSS Namespacing
More transparent code http://csswizardry.com/2015/03/more- transparent-ui-code-with-namespaces/
o- # object c- # Component u- # utility t-
# theme s- # Scope is-, has- # State _ # Hack js- # Javascript qa- # QA
‘Living’ Style Guides
None
SC5 Styleguide Generator Hologram Pattern Lab Fabricator SourceJS http://www.smashingmagazine.com/2015/04/an-in- depth-overview-of-living-style-guide-tools/
Visual Regression Testing
None
BackstopJS Resemble.js PhantomCSS
Deployment Server Continuous Integration (Lite)
One server for all builds All the build tools and
dependencies in one place Push only built code to production server
That’s All Folks
None
Thank You speakerdeck.com/mattbailey/front-end-workflow @_mattbailey mattbailey.io