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
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
2
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
400
Real Time Web Applications mit HTML5 und JavaScript - Part 1
thorsten
0
310
Other Decks in Programming
See All in Programming
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.7k
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
150
メールのエイリアス機能を履き違えない
isshinfunada
0
250
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
210
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
2
440
プロポーザルを書いてもらう
pvcresin
0
580
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
240
初めての模倣学習とVLA
natsutan
0
250
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.8k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
160
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
220
Featured
See All Featured
New Earth Scene 8
popppiees
3
2.5k
Visualization
eitanlees
152
17k
Odyssey Design
rkendrick25
PRO
2
780
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Faster Mobile Websites
deanohume
310
32k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
390
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
300
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]