Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Modernes Frontend Development
Search
Thorsten Rinne
October 30, 2013
Programming
260
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Modernes Frontend Development
Thorsten Rinne
October 30, 2013
More Decks by Thorsten Rinne
See All by Thorsten Rinne
Angular Best Practices @ Hackerkiste
thorsten
3
210
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
170
Modern Frontend Development
thorsten
2
770
Moderne Web-Apps mit HTML5 und JavaScript
thorsten
0
210
Bootstrap Your Project!
thorsten
2
660
Real Time Web Applications mit HTML5 und JavaScript - Part 2
thorsten
0
400
Real Time Web Applications mit HTML5 und JavaScript - Part 1
thorsten
0
320
Other Decks in Programming
See All in Programming
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.3k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
520
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
130
気持ちぃ〜角丸 Squircle
ryu1013
0
160
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
470
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
golang-bob.pdf
iwatsukayura
0
110
mrbgem 三角測量 開発
ogom
0
220
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
360
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
AIに “答え“を書かせるのを やめてみた
___akari11
0
110
Featured
See All Featured
Deep Space Network (abreviated)
tonyrice
0
360
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Unsuck your backbone
ammeep
672
58k
The Limits of Empathy - UXLibs8
cassininazir
2
710
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
980
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
420
Claude Code のすすめ
schroneko
67
230k
WENDY [Excerpt]
tessaabrams
14
40k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Cult of Friendly URLs
andyhume
79
7k
We Have a Design System, Now What?
morganepeng
55
8.4k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Transcript
MODERNES FRONTEND DEVELOPMENT International PHP Conference 2013
THORSTEN RINNE ‣ Diplom-Informatiker (FH) ‣ Team Lead Engineering ‣
Yatego GmbH ‣ phpMyFAQ ‣ @ThorstenRinne
Eine Art Agenda ... Editor / IDE Browser Browser Dev
Tools Die Kommandozeile Development Tools Demo
Editor / IDE
Manager anwesend?
Lasst den Entwickler entscheiden!
None
Sublime Text TextMate UltraEdit vi Emacs ...
Geht sogar im Browser...
Browser
None
Welche Versionen? Chrome latest (derzeit Version 30) Chromium latest (derzeit
Version 32) Firefox latest (derzeit Version 25) Firefox Nightly latest (derzeit Version 28) Safari latest (derzeit Version 6.1 bzw 7) Opera kann man sich sparen, da wie Chrome
Fehlt da nicht jemand?
None
Welche IE Versionen? 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-Messung
Performance-Messung Übersicht des Speicherverbrauchs Hilft bei Suche nach Performanceproblemen Layout
oder Skripte Ziel: 60 Frames pro Sekunde :-)
Memory und DOM Leaks
Memory und DOM Leaks JavaScript CPU Profiling Heap Snapshot für
JavaScript Objekte DOM Knoten Suche nach potentiellen Memory und DOM Leaks
Mobile Testing
Mobile Testing User Agent Verschiedene Endgeräte Android iOS Windows Phone
Simulation von Touch Events Ändern der Geolocation und des Accelerometers
Das Terminal
KEINE ANGST
Die Kommandozeile macht Spaß! ❤ ~/
Lass sie gut aussehen! Installiert „dotfiles“
None
http://dotfiles.github.io
Installiert das Schweizer Taschermesser des Webentwicklers!
None
Linting beim Speichern beim Commit bei Build
Automatisierung
Warum?
Entwickler sind faul.
Linting Abhängigkeiten auflösen Zusammenfügen und Kompilieren Testing Debug Code entfernen
$ npm install grunt-cli -g The JavaScript Task Runner
The JavaScript Task Runner aufgabenbasiertes Kommandozeilen- Tool ähnlich make /
rake / ant / phing Konfiguration in JavaScript Große Community Hunderte Plugins Linting, Concat, Watcher, Testing out of the box
$ cd /path/to/project $ npm install grunt --save-dev Grunt installieren
{ "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 oder JSLint .jshintrc $ npm install grunt-contrib-jshint --save-dev
LiveReload Plugin Chrome Firefox Safari Triggert Seitenreload via grunt watch
Browser Extensions auf http://livereload.com/
Package Manager für das Web Installieren und Entfernen von Paketen
Keine Abhängigkeiten keine sudo Rechte nötig Schnell installiert: $ npm install bower -g
Pakete installieren $ bower install $ bower install <package> $
bower install <package>#<version> $ bower install <name>=<package>#<version>
Paket-Quellen Registrierte Bower-Pakete wie z.B. jQuery Git-Repositories Lokale Ordner URLs
mit .zip/.tar.gz Dateien Werden normal nach bower_components installiert
Pakete suchen $ bower search <package>
Pakete verwenden <script src="/bower_components/jquery/jquery.min.js"> </script>
Pakete löschen $ bower remove <package>
Konfiguration .bowerrc { "directory": "./components" }
Konfiguration 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" } }
Packen und Kompilieren grunt-contrib-copy grunt-contrib-concat grunt-contrib-uglify grunt-contrib-cssmin grunt-contrib-imagemin
None
Testing Unittests mit Jasmine PhantomJS Chrome Firefox Chrome Canary Firefox
Nightly UI Testing mit 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 für Jasmine QUnit Mocha Buster.js Für
alle Browser und PhantomJS
Test‘em instalieren $ npm install testem -g $ testem
None
BOOM!
None
Testing mit DalekJS Neues UI Testing Framework Sehr neu, aktuell
Version 0.0.6 Schneller als Selenium Tests schreibt man in JavaScript Unterstützt alle Browser und PhantomJS
Testing mit 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 mit DalekJS
Schön. Und nun?
Geht das nicht noch einfacher?
Yeoman!
Yeoman Scaffolding neuer Apps Schreibt Grunt Konfiguration Yeoman = Grunt
+ Bower + Awesomeness Installation $ npm install -g yo
Yeoman $ npm install -g generator-webapp $ cd /path/to/webroot $
mkdir ipc-app $ cd ipc-app $ yo webapp
Yeoman $ grunt server $ grunt test $ grunt build
Generator WebApp Watcher für HTML, CSS und JS mit LiveReload
Builtin Webserver auf Port 9000 JSHint Mocha-Tests Bootstrap 3
DEMO
Verfügbare Generatoren AngularJS WordPress EmberJS Firefox OS Apps ExpressJS Laravel
Knockout Jekyll Phonegap Meteor Symfony2
Beispiel Yatego 2.0
Frontend vs. Backend Frontend 3 Developer Bootstrap 3 basierend Testen
via Jasmine Grunt / LiveReload Deployment Assetserver Backend 6 Developer Symfony 2.3 Testen via PHPUnit app/console + ant Deployment Capifony
Vorteile Jeder hatte seinen Workflow Test-Driven-Development für Frontend und Backend
LiveReload schützt die F5-Taste Viele JavaScript-Fehler vor dem Release gefunden
Fragen? Kommentare?
Vielen Dank für Eure Aufmerksamkeit! Joind.in: https://joind.in/9562 Twitter: @ThorstenRinne App.net:
https://alpha.app.net/thorsten Slides: http://speakerdeck.com/u/thorsten Thorsten Rinne Yatego GmbH
[email protected]