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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
200
Angular Best Practices
thorsten
2
230
Modernisierung von Legacy Applikationen auf HTML5
thorsten
1
160
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
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
200
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.4k
Foundation Models frameworkで画像分析
ryodeveloper
1
510
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
140
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
290
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
460
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
530
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
250
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
280
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
4
1.3k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
41k
The Invisible Side of Design
smashingmag
301
52k
WENDY [Excerpt]
tessaabrams
11
39k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
190
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
460
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
330
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
630
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
600
Darren the Foodie - Storyboard
khoart
PRO
3
3.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
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]