SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
The Dojo Build System
    Tobias von Klipstein - uxebu Ltd.
         klipstein@uxebu.com
What?
• Process for
 • compressing your JS files
 • grouping several JS files into one
 • interning external non-JS files (HTML
    Templates)
 • resolving of css @import statements
                 Speed up your app
We need?

• Dojo source release
• Java 1.5 (recommended) for running Rhino
• A Dojo application, we want to optimize
Dojo Source Release

• dojo (Base / Core)
• dijit
• dojox
• util (Rhino / Shrinksafe)
Our App
GET index.html
                    index.html


             @import url(quot;dojo.cssquot;);
                     dojo.css

            @import url(quot;tundra.cssquot;);
                    tundra.css

         @import quot;dijit/form/Button.cssquot;;
              dijit/form/Button.css
                        ...




Client
                                             Webserver




          <script src=“dojo.js“></script>
                      dojo.js

         dojo.require(“dijit.form.Button“)
                dijit/form/Button.js
                                                         Usual Page Load




            dojo.require(“dojo.string“)
                   dojo/string.js
                        ...
GET index.html
                   index.html




               @import style.css
                    style.css




Client
                                           Webserver




         <script src=“dojo.js“></script>
                                                       Optimized Page Load




                     dojo.js
Build Profile (1)

•   like ant‘s build.xml or Makefiles

•   consists of

    •   layers

    •   modules

•   util/buildscripts/profiles/<profile name>.profile.js
Build Profile (2)
 The simplest build profile


            ¶
Build profile (3)
dependencies = {
   layers: [
      {
         //always quot;../[....]quot; or just quot;dojo.jsquot;
         name: quot;../beer/layername.jsquot;,
          dependencies: [
             quot;dojo.stringquot;
             quot;dijit.form.Buttonquot;
          ],
         //relative to the util/buildscripts
         //directory or an absolute path.
         copyrightFile: quot;myCopyright.txtquot;
      }
   ],
   prefixes: [
      //relative to the dojo/dojo.js file
      [quot;dijitquot;, quot;../dijitquot;,
      [quot;beerquot;, quot;../beerquot;, quot;../beer/copyright.txtquot;],
   ]
};
Doing a Build

• cd util/buildscripts
• build.sh [or .bat]
     profile=<profile name>
     action=release
     + [more options]
build.sh [options] (1)

• releaseName [default: dojo]
• releaseDir [default: ../../release/]
• version [default: 0.0.0.dev]
• profileFile (instead of profile option)
• localeList [default: de-de, en-gb, ...]
build.sh [options] (2)


• loader [default or xdomain]
• scopeDjConfig
build.sh [options] (3)
• cssOptimize (comments or
  comments.keepLines)
• optimize (shrinksafe / shrinksafe.keepLines /
  packer)
• layerOptimize [default: shrinksafe]
• mini [default: false]
Shrinksafe (1)

• removing whitespace
• removing comments
• replacing non-public symbols (argument /
  variable / function names) with shorter
  ones
Shrinksafe (2)

function MyClass(){
    this.foo = function(argument1, argument2)
{
        var addedArgs = parseInt(argument1)+    function MyClass(){
                        parseInt(argument2);    this.foo=function(_1,_2){
        return addedArgs;                       var _3=parseInt(_1)+parseInt(_2);
    }                                           return _3;
    var anonymousInnerFunction = function(){    };
        // do stuff here!                       var _4=function(){
    }                                           };
}                                               }
function MyFunc(){                              function MyFunc(){
    // this is a top-level function             }
}
// we've got multiple lines of whitespace
here
Let‘s build


./build.sh profile=beer action=clean,release
What else you can do?
• Use a CDN (if just <5 modules are used)
• GZIP your content
• Loading your javascript files at the end and
  CSS upfront
• Creating a separate domain for your js
  files: js.example.com (xdomain)
• Determine often used modules (regularly)
Links
• docs.dojocampus.org/quickstart/custom-
  builds
• dojotoolkit.org/docs/shrinksafe
• dojocampus.org/content/2008/05/03/dojo-
  build-101-basics/
• dojocampus.org/content/2008/05/26/dojo-
  build-201-layers-and-css-optimizing-builds/
• download.dojotoolkit.org (source release)

Contenu connexe

Tendances

JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance PatternsStoyan Stefanov
 
Web UI performance tuning
Web UI performance tuningWeb UI performance tuning
Web UI performance tuningAndy Pemberton
 
High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social PluginsStoyan Stefanov
 
React.js触ってみた 吉澤和香奈
React.js触ってみた 吉澤和香奈React.js触ってみた 吉澤和香奈
React.js触ってみた 吉澤和香奈Wakana Yoshizawa
 
the 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp IIthe 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp IIDirk Ginader
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in reactImran Sayed
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱NAVER D2
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes
 
Odoo - Create themes for website
Odoo - Create themes for websiteOdoo - Create themes for website
Odoo - Create themes for websiteOdoo
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreRemy Sharp
 
Mojolicious, real-time web framework
Mojolicious, real-time web frameworkMojolicious, real-time web framework
Mojolicious, real-time web frameworktaggg
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-BootstrapBootstrap과 UI-Bootstrap
Bootstrap과 UI-BootstrapWebFrameworks
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Anatoly Sharifulin
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"LogeekNightUkraine
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Jeado Ko
 

Tendances (20)

Geb presentation
Geb presentationGeb presentation
Geb presentation
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
 
前端概述
前端概述前端概述
前端概述
 
Web UI performance tuning
Web UI performance tuningWeb UI performance tuning
Web UI performance tuning
 
High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social Plugins
 
React.js触ってみた 吉澤和香奈
React.js触ってみた 吉澤和香奈React.js触ってみた 吉澤和香奈
React.js触ってみた 吉澤和香奈
 
the 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp IIthe 5 layers of web accessibility - Open Web Camp II
the 5 layers of web accessibility - Open Web Camp II
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in react
 
C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱C3 웹기술로만드는모바일앱
C3 웹기술로만드는모바일앱
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
 
Odoo - Create themes for website
Odoo - Create themes for websiteOdoo - Create themes for website
Odoo - Create themes for website
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
Mojolicious, real-time web framework
Mojolicious, real-time web frameworkMojolicious, real-time web framework
Mojolicious, real-time web framework
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-BootstrapBootstrap과 UI-Bootstrap
Bootstrap과 UI-Bootstrap
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
 
SocketStream
SocketStreamSocketStream
SocketStream
 
Hack tutorial
Hack tutorialHack tutorial
Hack tutorial
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 

Similaire à The Dojo Build System

Meetup Performance
Meetup PerformanceMeetup Performance
Meetup PerformanceGreg Whalin
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindSam Keen
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenerytoddbr
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践Jacky Chi
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008Volkan Unsal
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest servicesIoan Eugen Stan
 
mago3D Technical Workshop Material
mago3D Technical Workshop Material mago3D Technical Workshop Material
mago3D Technical Workshop Material SANGHEE SHIN
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009Christopher Judd
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBen Limmer
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 

Similaire à The Dojo Build System (20)

Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
YUI 3
YUI 3YUI 3
YUI 3
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
mago3D Technical Workshop Material
mago3D Technical Workshop Material mago3D Technical Workshop Material
mago3D Technical Workshop Material
 
dojo.Patterns
dojo.Patternsdojo.Patterns
dojo.Patterns
 
Trimming The Cruft
Trimming The CruftTrimming The Cruft
Trimming The Cruft
 
How Akamai Made ESI Testing Simpler
How Akamai Made ESI Testing SimplerHow Akamai Made ESI Testing Simpler
How Akamai Made ESI Testing Simpler
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profit
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 

Dernier

AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxNeo4j
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 

Dernier (20)

AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 

The Dojo Build System

  • 1. The Dojo Build System Tobias von Klipstein - uxebu Ltd. klipstein@uxebu.com
  • 2. What? • Process for • compressing your JS files • grouping several JS files into one • interning external non-JS files (HTML Templates) • resolving of css @import statements Speed up your app
  • 3. We need? • Dojo source release • Java 1.5 (recommended) for running Rhino • A Dojo application, we want to optimize
  • 4. Dojo Source Release • dojo (Base / Core) • dijit • dojox • util (Rhino / Shrinksafe)
  • 6. GET index.html index.html @import url(quot;dojo.cssquot;); dojo.css @import url(quot;tundra.cssquot;); tundra.css @import quot;dijit/form/Button.cssquot;; dijit/form/Button.css ... Client Webserver <script src=“dojo.js“></script> dojo.js dojo.require(“dijit.form.Button“) dijit/form/Button.js Usual Page Load dojo.require(“dojo.string“) dojo/string.js ...
  • 7. GET index.html index.html @import style.css style.css Client Webserver <script src=“dojo.js“></script> Optimized Page Load dojo.js
  • 8. Build Profile (1) • like ant‘s build.xml or Makefiles • consists of • layers • modules • util/buildscripts/profiles/<profile name>.profile.js
  • 9. Build Profile (2) The simplest build profile ¶
  • 10. Build profile (3) dependencies = { layers: [ { //always quot;../[....]quot; or just quot;dojo.jsquot; name: quot;../beer/layername.jsquot;, dependencies: [ quot;dojo.stringquot; quot;dijit.form.Buttonquot; ], //relative to the util/buildscripts //directory or an absolute path. copyrightFile: quot;myCopyright.txtquot; } ], prefixes: [ //relative to the dojo/dojo.js file [quot;dijitquot;, quot;../dijitquot;, [quot;beerquot;, quot;../beerquot;, quot;../beer/copyright.txtquot;], ] };
  • 11. Doing a Build • cd util/buildscripts • build.sh [or .bat] profile=<profile name> action=release + [more options]
  • 12. build.sh [options] (1) • releaseName [default: dojo] • releaseDir [default: ../../release/] • version [default: 0.0.0.dev] • profileFile (instead of profile option) • localeList [default: de-de, en-gb, ...]
  • 13. build.sh [options] (2) • loader [default or xdomain] • scopeDjConfig
  • 14. build.sh [options] (3) • cssOptimize (comments or comments.keepLines) • optimize (shrinksafe / shrinksafe.keepLines / packer) • layerOptimize [default: shrinksafe] • mini [default: false]
  • 15. Shrinksafe (1) • removing whitespace • removing comments • replacing non-public symbols (argument / variable / function names) with shorter ones
  • 16. Shrinksafe (2) function MyClass(){ this.foo = function(argument1, argument2) { var addedArgs = parseInt(argument1)+ function MyClass(){ parseInt(argument2); this.foo=function(_1,_2){ return addedArgs; var _3=parseInt(_1)+parseInt(_2); } return _3; var anonymousInnerFunction = function(){ }; // do stuff here! var _4=function(){ } }; } } function MyFunc(){ function MyFunc(){ // this is a top-level function } } // we've got multiple lines of whitespace here
  • 18. What else you can do? • Use a CDN (if just <5 modules are used) • GZIP your content • Loading your javascript files at the end and CSS upfront • Creating a separate domain for your js files: js.example.com (xdomain) • Determine often used modules (regularly)
  • 19. Links • docs.dojocampus.org/quickstart/custom- builds • dojotoolkit.org/docs/shrinksafe • dojocampus.org/content/2008/05/03/dojo- build-101-basics/ • dojocampus.org/content/2008/05/26/dojo- build-201-layers-and-css-optimizing-builds/ • download.dojotoolkit.org (source release)