SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Fabian Jakobs | 1&1


JavaScript Tooling
     Minimize, Lint & Co
About me

• Fabian Jakobs
  <fabian.jakobs@1und1.de>
• JavaScript Framework developer
  at 1&1
     – Framework architect of the
       Javascript GUI Framework
       qooxdoo




Fabian Jakobs | 1&1
Overview

• Professional tooling for JavaScript
• Focus on larger JavaScript based applications
• Will demonstrate the presented techniques on
  a simple example application




Fabian Jakobs | 1&1
Example Program

• Performs „Filter-as-you-
  type“
• Separation of
     – Content (HTML)
     – Style (CSS)
     – Behavior (JavaScript)
• Uses qooxdoo DOM API
• No qooxdoo GUI
  application                  Demo



Fabian Jakobs | 1&1
Demo – Content




Fabian Jakobs | 1&1
Demo – Style
body {                                      h1 {
  background-color: #1D1D20;                  color: #FFFFFF
  padding: 40px 20px;                       }
  color: #BBBBBB;
  font: 11px quot;Lucida Grandequot;, quot;sans-serifquot;; #result {
  text-align: center;                         margin: 20px;
}                                             background-color: #1D1D20;
                                              padding: 20px;
#searchContainer {                            color: #BBBBBB;
  position: absolute;                         -moz-border-radius: 8px;
  background-color: #7389AE;                  -webkit-border-radius: 8px;
  width: 500px;                             }
  margin: 20px 0px 0px -265px;
  padding: 15px;                            .match {
  left: 50%;                                  font-weight: bold;
  color: white;                               color: #FACE8F;
  -moz-border-radius: 7px;                  }
  -webkit-border-radius: 7px;
}



Fabian Jakobs | 1&1
Demo – Behavior




Fabian Jakobs | 1&1
Overview - Tools

•   Linker
•   API documentation
•   Lint
•   Optimizer/Packer




Fabian Jakobs | 1&1
What is under the hood?
             ShrinkSafe                              JSLint
                              qooxdoo tools
           YUI Compressor                         (JavaScript
                            (Python JS parser)
               (Rhino)                             JS parser)

                               Syntax Tree

                                                 JSMin
                                 Parser
                                                 JSDoc

                                 Tokens

                                 Scanner
                                (RegExp)



                               JavaScript

Fabian Jakobs | 1&1
Linker

• Detect dependencies between JavaScript fles
• Sorted list of fles to include
• Generate an optimized version of the
  application




Fabian Jakobs | 1&1
Linker – Motivation

• The dependency Graph of the demo




Fabian Jakobs | 1&1
Linker – Motivation

• Been there – done that




Fabian Jakobs | 1&1
Linker – Common Scenario
• Scenario
     – Use of a pre build version of the framework used
     – Manage include list of own JavaScript fles manually
• Problems
     – You always include the full framework even if only parts of it
       are used
     – managing dependencies manually doesn't scale
     – Needs separate solution for deployment (combination of
       fles)



Fabian Jakobs | 1&1
Linker - Solution

• Solution
     – (semi-) automatic detection of dependencies
           • needs knowledge about the Framework
     – Generation of loader scripts
     – Generation of „compiled“ application fles
• Implementations
     – dojo build system
           • evaluates „dojo.require()“
     – qooxdoo
           • „knows“ qooxdoo class defnitions
Fabian Jakobs | 1&1
Linker – Demo




Fabian Jakobs | 1&1
Lint

• Static code analysis
     – fnd common coding mistakes
     – enforce coding guidelines
• Especially useful in dynamic languages, where
  errors
     – often occur only at runtime
     – only under certain conditions
     – have strange side effects and are hard to fnd


Fabian Jakobs | 1&1
Lint – Can you fnd all errors?
• This code is full of
     – errors
     – bad JavaScript style
• Demonstrate two lint tools
     – JSLint by Douglas Crockford
     – ecmalint (part of qooxdoo)
• Other tools
     – JavaScript Lint
     – YUI packer (-v parameter)


Fabian Jakobs | 1&1
Lint – Ecmalint
• Finds
     – errors related to variable scope
         • undefned variables
         • unused variables
     – redefnition of map keys
     – deprecated methods (eval,
       alert, ...)
• Part of qooxdoo
• Works with any JavaScript


Fabian Jakobs | 1&1
Lint – Ecmalint

    Use of undefined or global identifier 'xO'



                Unused identifier 'j'


     Use of undefined or global identifier 'i'


             Map key 'add' redefined


    Use of deprecated global identifier 'alert'



Fabian Jakobs | 1&1
Lint – JSLint

• Checks for bad coding style
• by Douglas Crockford
     – “Will hurt your feelings”
• Reports
     – Missing semicolons
     – Unreachable code
     – Missing blocks
     – Many more

Fabian Jakobs | 1&1
Lint – JSLint
                Missing semicolon.



       Expected '{' and instead saw 'sum'.


          Use '===' to compare with '0'.


      Expected '{' and instead saw 'throw'.


                Missing semicolon.


        Unreachable 'return' after 'return'.

Fabian Jakobs | 1&1
Lint – Summary

• Lint tools can help fnding bugs early
• Should be run regularly
• Should be integrated into the build system


                 BUT: Cannot replace testing!



Fabian Jakobs | 1&1
API Documentation




Fabian Jakobs | 1&1
API Documentation

• Generate API documentation
• Most JavaScript Frameworks have API
  documentation for their classes
• Must understand the framework




Fabian Jakobs | 1&1
API Documentation – JSDoc

•   Non framework tool
•   Uses JavaDoc like documentation comments
•   Only basic JavaScript OO features
•   Does not understand
     – OO notation of most frameworks
     – OO notation of qooxdoo
• Generates boring static HTML :-)


Fabian Jakobs | 1&1
API Documentation – Demo




Fabian Jakobs | 1&1
Deploy

• Optimize application for deployment
     – Compress fles
           • Gzip
           • JavaScript compression
     – Combine fles
           • Improves startup time
           • JavaScript, CSS, images
     – Optimize/Obfuscate JavaScript


Fabian Jakobs | 1&1
Deploy – JavaScript Packer
                Remove     Remove      Rename      safe   Client
                comments   white space local              performance
                                       variables          impact
Dean            yes        yes         yes         yes    negative
Edward's                                                  (uses eval)
Packer

YUI             yes        yes         yes         yes    neutral
Compressor

Dojo            yes        yes         yes         yes    neutral
ShrinkSafe
Doulas          yes        yes         no          no     neutral
Crockford's
JSMin
qooxdoo         yes        yes         yes         yes    positive
generator.py                                              (string
                                                          optimizer)


Fabian Jakobs | 1&1
Deploy – JavaScript Packer




Fabian Jakobs | 1&1
Deploy – JavaScript Packer
• Remove local variables




Fabian Jakobs | 1&1
Deploy – JavaScript Packer
• Optimize strings




Fabian Jakobs | 1&1
Deploy – JavaScript Packer
• Remove white space




Fabian Jakobs | 1&1
Packer – Demo




Fabian Jakobs | 1&1
Deploy - Further optimizations

• Rename private members
     – Needs framework knowledge
• Remove debugging code
• Generate browser specifc builds
• Inline HTML Templates
     – Dojo inlines dijit template
• Combine images and CSS



Fabian Jakobs | 1&1
Questions?




Fabian Jakobs | 1&1
Links – Linker, integrated build systems

• dojo build system
    http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/package-system-and-custom-builds

• qooxdoo generator2
    http://qooxdoo.org/documentation/general/generator2




Fabian Jakobs | 1&1
Links

• API Documentation
   – JSDoc http://jsdoc.sourceforge.net/
   – dojo API viewer http://api.dojotoolkit.org/
   – ExtJS API viewer http://extjs.com/deploy/dev/docs/
   – qooxdoo API viewer http://api.qooxdoo.org/
• Lint
   – JSLint http://www.jslint.com/
   – JavaScript Lint http://www.javascriptlint.com/


Fabian Jakobs | 1&1
Links - Packer

• Dean Edward's Packer
  http://dean.edwards.name/packer/
• YUI Compressor
  http://developer.yahoo.com/yui/compressor/
• dojo ShrinkSafe http://dojotoolkit.org/docs/shrinksafe
• JSMin http://www.crockford.com/javascript/jsmin.html




Fabian Jakobs | 1&1

Más contenido relacionado

La actualidad más candente

Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010Ignacio Coloma
 
キレイ会議 on Laravel
キレイ会議 on Laravelキレイ会議 on Laravel
キレイ会議 on LaravelNʎ Nkogues
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To GrailsEric Berry
 
GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28Jorge Hidalgo
 
GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18Jorge Hidalgo
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Lunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and CapybaraLunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and CapybaraMarc Seeger
 
Webpack & EcmaScript 6 (Webelement #32)
Webpack & EcmaScript 6 (Webelement #32)Webpack & EcmaScript 6 (Webelement #32)
Webpack & EcmaScript 6 (Webelement #32)srigi
 
Launchpad: Lessons Learnt
Launchpad: Lessons LearntLaunchpad: Lessons Learnt
Launchpad: Lessons LearntTim Penhey
 
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOUHOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOULucas Jellema
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony frameworkStefan Koopmanschap
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Stefan Koopmanschap
 

La actualidad más candente (13)

Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010
 
キレイ会議 on Laravel
キレイ会議 on Laravelキレイ会議 on Laravel
キレイ会議 on Laravel
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
 
GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28
 
GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Lunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and CapybaraLunch and learn: Cucumber and Capybara
Lunch and learn: Cucumber and Capybara
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
Webpack & EcmaScript 6 (Webelement #32)
Webpack & EcmaScript 6 (Webelement #32)Webpack & EcmaScript 6 (Webelement #32)
Webpack & EcmaScript 6 (Webelement #32)
 
Launchpad: Lessons Learnt
Launchpad: Lessons LearntLaunchpad: Lessons Learnt
Launchpad: Lessons Learnt
 
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOUHOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony framework
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)
 

Destacado

Beampoint Purchase Pricing Partners 12030
Beampoint Purchase Pricing Partners 12030Beampoint Purchase Pricing Partners 12030
Beampoint Purchase Pricing Partners 12030guestb30ea0
 
Matsuo Katsu
Matsuo KatsuMatsuo Katsu
Matsuo KatsuKotone
 

Destacado (7)

Barberis - Protocube
Barberis - ProtocubeBarberis - Protocube
Barberis - Protocube
 
Beampoint Purchase Pricing Partners 12030
Beampoint Purchase Pricing Partners 12030Beampoint Purchase Pricing Partners 12030
Beampoint Purchase Pricing Partners 12030
 
Matsuo Katsu
Matsuo KatsuMatsuo Katsu
Matsuo Katsu
 
Uudrt 01 1954
Uudrt 01 1954Uudrt 01 1954
Uudrt 01 1954
 
Uu 16 1951
Uu 16 1951Uu 16 1951
Uu 16 1951
 
Uu 01 1950
Uu 01 1950Uu 01 1950
Uu 01 1950
 
Uudrt 07 1958
Uudrt 07 1958Uudrt 07 1958
Uudrt 07 1958
 

Similar a DLW Europe - JavaScript Tooling

Why Architecture in Web Development matters
Why Architecture in Web Development mattersWhy Architecture in Web Development matters
Why Architecture in Web Development mattersLars Jankowfsky
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?jbandi
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09Michael Neale
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008rajivmordani
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overviewjeresig
 
A Re-Introduction to JavaScript
A Re-Introduction to JavaScriptA Re-Introduction to JavaScript
A Re-Introduction to JavaScriptSimon Willison
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for youSimon Willison
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)jeresig
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedFabian Jakobs
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)jeresig
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The OverviewAtlassian
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency ManagementSean Duncan
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYBnukeevry1
 

Similar a DLW Europe - JavaScript Tooling (20)

Why Architecture in Web Development matters
Why Architecture in Web Development mattersWhy Architecture in Web Development matters
Why Architecture in Web Development matters
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008
 
Practical Groovy DSL
Practical Groovy DSLPractical Groovy DSL
Practical Groovy DSL
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
A Re-Introduction to JavaScript
A Re-Introduction to JavaScriptA Re-Introduction to JavaScript
A Re-Introduction to JavaScript
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The Overview
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency Management
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYB
 

Más de Fabian Jakobs

Amsterdam.js talk: node webkit
Amsterdam.js talk: node webkitAmsterdam.js talk: node webkit
Amsterdam.js talk: node webkitFabian Jakobs
 
Bespin, Skywriter, Ace The Past, Present and Future of online Code Editing
Bespin, Skywriter, Ace The Past, Present and Future of online Code EditingBespin, Skywriter, Ace The Past, Present and Future of online Code Editing
Bespin, Skywriter, Ace The Past, Present and Future of online Code EditingFabian Jakobs
 
Kick ass code editing and end to end JavaScript debugging
Kick ass code editing and end to end JavaScript debuggingKick ass code editing and end to end JavaScript debugging
Kick ass code editing and end to end JavaScript debuggingFabian Jakobs
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Und es geht doch - TDD für GUIs
Und es geht doch - TDD für GUIsUnd es geht doch - TDD für GUIs
Und es geht doch - TDD für GUIsFabian Jakobs
 
Qooxdoo 0.8 - Das Neue Gui Toolkit
Qooxdoo 0.8 - Das Neue Gui ToolkitQooxdoo 0.8 - Das Neue Gui Toolkit
Qooxdoo 0.8 - Das Neue Gui ToolkitFabian Jakobs
 
Ajax In Action 2008 - Gui Development With qooxdoo
Ajax In Action 2008 - Gui Development With qooxdooAjax In Action 2008 - Gui Development With qooxdoo
Ajax In Action 2008 - Gui Development With qooxdooFabian Jakobs
 

Más de Fabian Jakobs (11)

Amsterdam.js talk: node webkit
Amsterdam.js talk: node webkitAmsterdam.js talk: node webkit
Amsterdam.js talk: node webkit
 
Bespin, Skywriter, Ace The Past, Present and Future of online Code Editing
Bespin, Skywriter, Ace The Past, Present and Future of online Code EditingBespin, Skywriter, Ace The Past, Present and Future of online Code Editing
Bespin, Skywriter, Ace The Past, Present and Future of online Code Editing
 
Kick ass code editing and end to end JavaScript debugging
Kick ass code editing and end to end JavaScript debuggingKick ass code editing and end to end JavaScript debugging
Kick ass code editing and end to end JavaScript debugging
 
Autopsy Of A Widget
Autopsy Of A WidgetAutopsy Of A Widget
Autopsy Of A Widget
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Tdd For GuIs
Tdd For GuIsTdd For GuIs
Tdd For GuIs
 
Und es geht doch - TDD für GUIs
Und es geht doch - TDD für GUIsUnd es geht doch - TDD für GUIs
Und es geht doch - TDD für GUIs
 
Going Virtual
Going VirtualGoing Virtual
Going Virtual
 
Going Virtual
Going VirtualGoing Virtual
Going Virtual
 
Qooxdoo 0.8 - Das Neue Gui Toolkit
Qooxdoo 0.8 - Das Neue Gui ToolkitQooxdoo 0.8 - Das Neue Gui Toolkit
Qooxdoo 0.8 - Das Neue Gui Toolkit
 
Ajax In Action 2008 - Gui Development With qooxdoo
Ajax In Action 2008 - Gui Development With qooxdooAjax In Action 2008 - Gui Development With qooxdoo
Ajax In Action 2008 - Gui Development With qooxdoo
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

DLW Europe - JavaScript Tooling

  • 1. Fabian Jakobs | 1&1 JavaScript Tooling Minimize, Lint & Co
  • 2. About me • Fabian Jakobs <fabian.jakobs@1und1.de> • JavaScript Framework developer at 1&1 – Framework architect of the Javascript GUI Framework qooxdoo Fabian Jakobs | 1&1
  • 3. Overview • Professional tooling for JavaScript • Focus on larger JavaScript based applications • Will demonstrate the presented techniques on a simple example application Fabian Jakobs | 1&1
  • 4. Example Program • Performs „Filter-as-you- type“ • Separation of – Content (HTML) – Style (CSS) – Behavior (JavaScript) • Uses qooxdoo DOM API • No qooxdoo GUI application Demo Fabian Jakobs | 1&1
  • 6. Demo – Style body { h1 { background-color: #1D1D20; color: #FFFFFF padding: 40px 20px; } color: #BBBBBB; font: 11px quot;Lucida Grandequot;, quot;sans-serifquot;; #result { text-align: center; margin: 20px; } background-color: #1D1D20; padding: 20px; #searchContainer { color: #BBBBBB; position: absolute; -moz-border-radius: 8px; background-color: #7389AE; -webkit-border-radius: 8px; width: 500px; } margin: 20px 0px 0px -265px; padding: 15px; .match { left: 50%; font-weight: bold; color: white; color: #FACE8F; -moz-border-radius: 7px; } -webkit-border-radius: 7px; } Fabian Jakobs | 1&1
  • 8. Overview - Tools • Linker • API documentation • Lint • Optimizer/Packer Fabian Jakobs | 1&1
  • 9. What is under the hood? ShrinkSafe JSLint qooxdoo tools YUI Compressor (JavaScript (Python JS parser) (Rhino) JS parser) Syntax Tree JSMin Parser JSDoc Tokens Scanner (RegExp) JavaScript Fabian Jakobs | 1&1
  • 10. Linker • Detect dependencies between JavaScript fles • Sorted list of fles to include • Generate an optimized version of the application Fabian Jakobs | 1&1
  • 11. Linker – Motivation • The dependency Graph of the demo Fabian Jakobs | 1&1
  • 12. Linker – Motivation • Been there – done that Fabian Jakobs | 1&1
  • 13. Linker – Common Scenario • Scenario – Use of a pre build version of the framework used – Manage include list of own JavaScript fles manually • Problems – You always include the full framework even if only parts of it are used – managing dependencies manually doesn't scale – Needs separate solution for deployment (combination of fles) Fabian Jakobs | 1&1
  • 14. Linker - Solution • Solution – (semi-) automatic detection of dependencies • needs knowledge about the Framework – Generation of loader scripts – Generation of „compiled“ application fles • Implementations – dojo build system • evaluates „dojo.require()“ – qooxdoo • „knows“ qooxdoo class defnitions Fabian Jakobs | 1&1
  • 15. Linker – Demo Fabian Jakobs | 1&1
  • 16. Lint • Static code analysis – fnd common coding mistakes – enforce coding guidelines • Especially useful in dynamic languages, where errors – often occur only at runtime – only under certain conditions – have strange side effects and are hard to fnd Fabian Jakobs | 1&1
  • 17. Lint – Can you fnd all errors? • This code is full of – errors – bad JavaScript style • Demonstrate two lint tools – JSLint by Douglas Crockford – ecmalint (part of qooxdoo) • Other tools – JavaScript Lint – YUI packer (-v parameter) Fabian Jakobs | 1&1
  • 18. Lint – Ecmalint • Finds – errors related to variable scope • undefned variables • unused variables – redefnition of map keys – deprecated methods (eval, alert, ...) • Part of qooxdoo • Works with any JavaScript Fabian Jakobs | 1&1
  • 19. Lint – Ecmalint Use of undefined or global identifier 'xO' Unused identifier 'j' Use of undefined or global identifier 'i' Map key 'add' redefined Use of deprecated global identifier 'alert' Fabian Jakobs | 1&1
  • 20. Lint – JSLint • Checks for bad coding style • by Douglas Crockford – “Will hurt your feelings” • Reports – Missing semicolons – Unreachable code – Missing blocks – Many more Fabian Jakobs | 1&1
  • 21. Lint – JSLint Missing semicolon. Expected '{' and instead saw 'sum'. Use '===' to compare with '0'. Expected '{' and instead saw 'throw'. Missing semicolon. Unreachable 'return' after 'return'. Fabian Jakobs | 1&1
  • 22. Lint – Summary • Lint tools can help fnding bugs early • Should be run regularly • Should be integrated into the build system BUT: Cannot replace testing! Fabian Jakobs | 1&1
  • 24. API Documentation • Generate API documentation • Most JavaScript Frameworks have API documentation for their classes • Must understand the framework Fabian Jakobs | 1&1
  • 25. API Documentation – JSDoc • Non framework tool • Uses JavaDoc like documentation comments • Only basic JavaScript OO features • Does not understand – OO notation of most frameworks – OO notation of qooxdoo • Generates boring static HTML :-) Fabian Jakobs | 1&1
  • 26. API Documentation – Demo Fabian Jakobs | 1&1
  • 27. Deploy • Optimize application for deployment – Compress fles • Gzip • JavaScript compression – Combine fles • Improves startup time • JavaScript, CSS, images – Optimize/Obfuscate JavaScript Fabian Jakobs | 1&1
  • 28. Deploy – JavaScript Packer Remove Remove Rename safe Client comments white space local performance variables impact Dean yes yes yes yes negative Edward's (uses eval) Packer YUI yes yes yes yes neutral Compressor Dojo yes yes yes yes neutral ShrinkSafe Doulas yes yes no no neutral Crockford's JSMin qooxdoo yes yes yes yes positive generator.py (string optimizer) Fabian Jakobs | 1&1
  • 29. Deploy – JavaScript Packer Fabian Jakobs | 1&1
  • 30. Deploy – JavaScript Packer • Remove local variables Fabian Jakobs | 1&1
  • 31. Deploy – JavaScript Packer • Optimize strings Fabian Jakobs | 1&1
  • 32. Deploy – JavaScript Packer • Remove white space Fabian Jakobs | 1&1
  • 33. Packer – Demo Fabian Jakobs | 1&1
  • 34. Deploy - Further optimizations • Rename private members – Needs framework knowledge • Remove debugging code • Generate browser specifc builds • Inline HTML Templates – Dojo inlines dijit template • Combine images and CSS Fabian Jakobs | 1&1
  • 36. Links – Linker, integrated build systems • dojo build system http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/package-system-and-custom-builds • qooxdoo generator2 http://qooxdoo.org/documentation/general/generator2 Fabian Jakobs | 1&1
  • 37. Links • API Documentation – JSDoc http://jsdoc.sourceforge.net/ – dojo API viewer http://api.dojotoolkit.org/ – ExtJS API viewer http://extjs.com/deploy/dev/docs/ – qooxdoo API viewer http://api.qooxdoo.org/ • Lint – JSLint http://www.jslint.com/ – JavaScript Lint http://www.javascriptlint.com/ Fabian Jakobs | 1&1
  • 38. Links - Packer • Dean Edward's Packer http://dean.edwards.name/packer/ • YUI Compressor http://developer.yahoo.com/yui/compressor/ • dojo ShrinkSafe http://dojotoolkit.org/docs/shrinksafe • JSMin http://www.crockford.com/javascript/jsmin.html Fabian Jakobs | 1&1