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
Modern Frontend Development
Search
Thorsten Rinne
February 13, 2014
Programming
750
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Modern Frontend Development
Thorsten Rinne
February 13, 2014
More Decks by Thorsten Rinne
See All by Thorsten Rinne
Angular Best Practices @ Hackerkiste
thorsten
3
190
Angular Best Practices
thorsten
2
220
Modernisierung von Legacy Applikationen auf HTML5
thorsten
1
150
Entwicklung moderner Web-Apps mit HTML5 und JavaScript
thorsten
1
160
Modernes Frontend Development
thorsten
2
250
Moderne Web-Apps mit HTML5 und JavaScript
thorsten
0
200
Bootstrap Your Project!
thorsten
2
660
Real Time Web Applications mit HTML5 und JavaScript - Part 2
thorsten
0
390
Real Time Web Applications mit HTML5 und JavaScript - Part 1
thorsten
0
310
Other Decks in Programming
See All in Programming
Oxcを導入して開発体験が向上した話
yug1224
4
320
Contextとはなにか
chiroruxx
1
330
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
5.8k
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
110
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.4k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
250
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
290
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
Performance Engineering for Everyone
elenatanasoiu
0
170
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
340
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
How GitHub (no longer) Works
holman
316
150k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
430
Unsuck your backbone
ammeep
672
58k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
GraphQLとの向き合い方2022年版
quramy
50
15k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
630
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
The Limits of Empathy - UXLibs8
cassininazir
1
360
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Transcript
MODERN FRONTEND DEVELOPMENT NFQ Office Kaunas
THORSTEN RINNE ‣ studied CS ‣ Team Lead Engineering ‣
Yatego GmbH ‣ phpMyFAQ ! ‣ @ThorstenRinne
Today’s agenda Editor / IDE Browser Browser Dev Tools $
The command line Development Tools Demo
Editor / IDE
Let the developers decide!
None
Sublime Text TextMate UltraEdit vi Emacs ...
You can edit in the browser!
Browser
None
Which Versions? Chrome latest (currently version 32) Chromium latest (currently
version 34) Firefox latest (currently version 27) Firefox Nightly latest (currently version 30) Safari latest (currently version 6.1 / 7) Forget Opera, as it’s just a Chrome
Is someone missing?
None
Which IE versions? Internet Explorer 7 (?) Internet Explorer 8
Internet Explorer 9 Internet Explorer 10 Internet Explorer 11
Browser Developer Tools
chrome://flags Experimental Developer Tools experiments
Live Editing + Autosave
Performance measuring
Performance measuring Overview of memory usage Helps searching for performance
problems Layout or scripts Our goal should be 60 frames per second :-)
Memory and DOM Leaks
Memory and DOM Leaks JavaScript CPU Profiling Heap Snapshot for
JavaScript objects DOM nodes Search for potential memory and/or DOM leaks
Mobile Testing
Mobile Testing User Agent Different devices Android iOS Windows Phone
Simulation of touch events Changing geolocation and accelerometers
The Terminal
NO FEAR
The command line makes you smile ❤ ~/
Let the CLI look awesome! Please install „dotfiles“
None
http://dotfiles.github.io
Please install the Swiss army knife of every web developer.
None
Socket.IO: cross browser sockets Express: like Sinatra or Silex Grunt:
a JavaScript task runner Bower: a package manager for the web Yeoman: CLI interface for scaffolding JSHint / JSLint
Linting on save on commit during build
Automatisation
Why?
Developers are lazy!
Linting Resolve depedencies Concat and compiling Testing Remove debug code
$ npm install grunt-cli -g The JavaScript Task Runner
The JavaScript Task Runner task based CLI tool like make
/ rake / ant / phing Configuration in JavaScript Huge community hundreds of plugins Linting, Concat, Watcher, Testing out of the box
$ cd /path/to/project ! $ npm install grunt --save-dev How
to install Grunt
{ "name": "yatego.com", "version": "2.0.0", "dependencies": {}, "devDependencies": { "grunt":
"~0.4.1", "grunt-contrib-jshint": "~0.4.1", "grunt-contrib-uglify": "~0.2.2" }, "engines": { "node": ">=0.10.0" }, "author": "Yatego GmbH", } package.json
module.exports = function(grunt) { ! grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: {
options: { banner: '/*! <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, build: { src: 'src/<%= pkg.name %>.js', dest: 'build/<%= pkg.name %>.min.js' } } }); ! grunt.loadNpmTasks('grunt-contrib-uglify'); ! grunt.registerTask('default', ['uglify']); ! }; Gruntfile.js
// Run Jasmine and DalekJS tests grunt.registerTask( 'testrun', ['jshint', 'jasmine',
'dalek'] ); ! // Build production grunt.registerTask( 'production', ['copy', 'less', 'cssmin', 'jshint', 'uglify'] ); Grunt Tasks
The JavaScript Task Runner http://gruntjs.com http://gruntjs.com/plugins
Linting JSHint or JSLint .jshintrc $ npm install grunt-contrib-jshint --save-dev
LiveReload Plugins for Chrome Firefox Safari Triggers page reload via
grunt watch Browser extensions on http://livereload.com/
Package Manager for the web Install and remove packages No
external dependencies No sudo permissions Blazing fast installation: $ npm install bower -g
How to install packages ! ! ! $ bower install
$ bower install <package> $ bower install <package>#<version> $ bower install <name>=<package>#<version>
Package resources Registered Bower packages like jQuery Git repositories Local
folders URLs with .zip/.tar.gz files Will be installed to bower_components by default
Search packages $ bower search <package>
Simple package usage <script src="/bower_components/jquery/jquery.min.js"> </script>
Deleting packages $ bower remove <package>
Configuration .bowerrc { "directory": "./components" }
Configuration bower.json { "name": "yatego.com", "version": "2.0.0", "dependencies": { "jquery":
"1.10.2", "bootstrap": "3.0.0", "modernizr": "2.6.2" }, "devDependencies": { "jasmine": "~1.3.1", }, "resolutions": { "jquery": "1.10.2" } }
Useful Grunt tasks grunt-contrib-copy grunt-contrib-concat grunt-contrib-uglify grunt-contrib-cssmin grunt-contrib-imagemin
None
Testing Unittests with Jasmine PhantomJS Chrome Firefox Chrome Canary Firefox
Nightly UI Testing with DalekJS PhantomJS Chrome Firefox Internet Explorer!
Jasmine describe("Cart", function() { ! beforeEach(function() { $.yategoCart().removeAll(); }); !
it("Checks if add item works", function() { $.yategoCart().addItem("test-pos-1", "test-offer-1", 3); expect($.yategoCart().hasItem("test-offer-1")).toEqual(true); }); ! it("Checks if change quantity works", function() { $.yategoCart().addItem("test-pos-2", "test-offer-2", 3); $.yategoCart().addItemQty("test-offer-2", 2); expect($.yategoCart().getItemQty("test-offer-2")).toEqual(5); }); });
Jasmine via PhantomJS $ grunt jasmine Running "jasmine:pivotal" (jasmine) task
Testing jasmine specs via phantom ............................ 28 specs in 0.229s. >> 0 failures ! Done, without errors.
Test‘em Testrunner Test Framework for Jasmine QUnit Mocha Buster.js For
all browsers and PhantomJS
How to install Test‘em $ npm install testem -g
$ testem
None
BOOM!
None
Testing with DalekJS New UI Testing Framework Early stage, currently
version 0.0.8 Faster than Selenium Tests written in JavaScript Supports all browsers and PhantomJS
Testing with DalekJS module.exports = { 'Page title is correct':
function (test) { test.open('http://www.yatego.dev') .assert.title().is('Yatego Shopping', 'It has title') .done(); }, 'Search page is correct': function (test) { test.open('http://www.yatego.dev/search?q=Test') .assert.title().is('Test - yatego.com', 'It has title') .done(); } };
Testing with DalekJS
Awesome. And now?
Why couldn’t it be more easy?
Yeoman!
Yeoman Scaffolding of new apps Writes Grunt configuration Yeoman =
Grunt + Bower + Awesomeness Blazing fast installation $ npm install -g yo
Yeoman $ npm install -g generator-webapp $ cd /path/to/webroot
$ mkdir nfqApp $ cd nfqApp $ yo nfqApp
Yeoman $ grunt server ! $ grunt test ! $
grunt build
Generator WebApp Watcher for HTML, CSS and JS with LiveReload
Builtin Webserver at Port 9000 JSHint Mocha tests Bootstrap 3
DEMO
Available generators AngularJS WordPress EmberJS Firefox OS Apps ExpressJS Laravel
Knockout Jekyll Phonegap Meteor Symfony2
Example Yatego 2.0 www.yatego.com
Frontend vs. Backend Frontend 3 Developer Bootstrap 3 based Testen
via Jasmine Grunt / LiveReload Deployment Assetserver Backend 6 Developer Symfony 2.3 Testen via PHPUnit app/console + ant Deployment Capifony
Advantages everyone could use his own workflow Test-Driven-Development for frontend
and backend LiveReload saves hitting the F5 key all the time Many JavaScript errors were found before the release
Questions? Comments?
Thanks for your attention! :-) Twitter: @ThorstenRinne Slides: http://speakerdeck.com/u/thorsten Thorsten
Rinne Yatego GmbH
[email protected]