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
Modernes Frontend Development
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Thorsten Rinne
October 30, 2013
Programming
250
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
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
Modern Frontend Development
thorsten
3
750
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
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
250
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
400
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
0
160
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
460
数百円から始めるRuby電子工作
tarosay
0
130
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
750
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
170
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
280
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
310
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
170
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
240
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Discover your Explorer Soul
emna__ayadi
2
1.2k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
600
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Google's AI Overviews - The New Search
badams
0
1.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
41k
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]