SlideShare uma empresa Scribd logo
1 de 10
Introduction to
By Ahmed EL-Harouny
24 September 2014
RequireJS
Page
Agenda
› WhatisRequireJS?
› Why?
› Buildingblocks(define,require,config)
› Shims
› Optimization
› Demoonhowweareusingit.
/ Copyright ©2014 by Readify Pty Ltd2
Page
What is RequireJS?
/ Copyright ©2014 by Readify Pty Ltd3
• RequireJS is a JavaScript file and module loader.
• It supports Asynchronous Module Definition AMD.
• Asynchronous Module Definition (AMD) API specifies a
mechanism for defining modules such that the module and its
dependencies can be asynchronously loaded.
Page
Why?
/ Copyright ©2014 by Readify Pty Ltd4
common.js
common.config.js
1-Scripts loads faster.
2-Manage script dependencies.
Page
Building blocks
/ Copyright ©2014 by Readify Pty Ltd5
• define
• defines a RequireJS module.
define(<moduleName>, <dependencies>, <anyObject>)
• require
• requires a RequireJS module.
require(<dependencies>, <function>)
• config
• configures RequireJS.
require.config(<configObject>)
Page
Building blocks
/ Copyright ©2014 by Readify Pty Ltd6
alias
full path
Returns window._
Page
Shims
/ Copyright ©2014 by Readify Pty Ltd7
Configure the dependencies, exports, and custom initialization for older, traditional
"browser globals" scripts that do not use define().
• deps
• I depend on.
• exports
• I export.
• init
Initialization logic.
Page
Optimization
/ Copyright ©2014 by Readify Pty Ltd8
• Combine related scripts together into minified files.
• Uses r.js file.
• node is recommended to run it. (java, browser can do it as well).
Build output
configs
Build folder
Page
Demo
/ Copyright ©2014 by Readify Pty Ltd9
How we are using it.
How it can help us in unit tests.
Thank you

Mais conteúdo relacionado

Mais procurados

Modular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S MakModular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S Makmfrancis
 
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?MarkupBox
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applicationsSC5.io
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application DevelopmentChristian Baranowski
 
OSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon KaegiOSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon Kaegimfrancis
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp ArchitectureMorgan Cheng
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJSInfragistics
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptSpike Brehm
 
JSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic AppsJSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic AppsSpike Brehm
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deploymentklcodanr
 
Requirejs
RequirejsRequirejs
Requirejssioked
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Spike Brehm
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with WebpackJake Peyser
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS IntroductionCarlos Morales
 
Isomorphic JS - new silver bullet
Isomorphic JS - new silver bulletIsomorphic JS - new silver bullet
Isomorphic JS - new silver bulletimevs
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsSpike Brehm
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVAYash Mody
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSM R Rony
 
Building Isomorphic JavaScript Apps - NDC 2015
Building Isomorphic JavaScript Apps - NDC 2015Building Isomorphic JavaScript Apps - NDC 2015
Building Isomorphic JavaScript Apps - NDC 2015Eirik Vullum
 

Mais procurados (20)

Modular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S MakModular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S Mak
 
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
AngularJS vs React JS vs Node JS: Which is Best For Web Development ?
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
OSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon KaegiOSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon Kaegi
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp Architecture
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScript
 
JSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic AppsJSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic Apps
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deployment
 
Requirejs
RequirejsRequirejs
Requirejs
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS Introduction
 
Isomorphic JS - new silver bullet
Isomorphic JS - new silver bulletIsomorphic JS - new silver bullet
Isomorphic JS - new silver bullet
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
Building Isomorphic JavaScript Apps - NDC 2015
Building Isomorphic JavaScript Apps - NDC 2015Building Isomorphic JavaScript Apps - NDC 2015
Building Isomorphic JavaScript Apps - NDC 2015
 

Semelhante a Introduction to require js

Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjsAhmed Elharouny
 
Application development using Zend Framework
Application development using Zend FrameworkApplication development using Zend Framework
Application development using Zend FrameworkMahmud Ahsan
 
Spring intro classes-in-mumbai
Spring intro classes-in-mumbaiSpring intro classes-in-mumbai
Spring intro classes-in-mumbaivibrantuser
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...Edureka!
 
Con11257 schifano con11257-best practices for deploying highly scalable virtu...
Con11257 schifano con11257-best practices for deploying highly scalable virtu...Con11257 schifano con11257-best practices for deploying highly scalable virtu...
Con11257 schifano con11257-best practices for deploying highly scalable virtu...Berry Clemens
 
Spring introduction
Spring introductionSpring introduction
Spring introductionManav Prasad
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?NexSoftsys
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!Muhammad Ghazali
 
JavaScript Modules in Practice
JavaScript Modules in PracticeJavaScript Modules in Practice
JavaScript Modules in PracticeMaghdebura
 
Framework adoption for java enterprise application development
Framework adoption for java enterprise application developmentFramework adoption for java enterprise application development
Framework adoption for java enterprise application developmentClarence Ho
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node jsHabilelabs
 
Dog food conference creating modular webparts with require js in sharepoint
Dog food conference   creating modular webparts with require js in sharepointDog food conference   creating modular webparts with require js in sharepoint
Dog food conference creating modular webparts with require js in sharepointfahey252
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project Elad Hirsch
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
 
AngularJS with RequireJS
AngularJS with RequireJSAngularJS with RequireJS
AngularJS with RequireJSJohannes Weber
 
The Power of Enterprise Java Frameworks
The Power of Enterprise Java FrameworksThe Power of Enterprise Java Frameworks
The Power of Enterprise Java FrameworksClarence Ho
 
Web sphere liberty2
Web sphere liberty2Web sphere liberty2
Web sphere liberty2JyothirmaiG4
 

Semelhante a Introduction to require js (20)

Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjs
 
Require js training
Require js trainingRequire js training
Require js training
 
Application development using Zend Framework
Application development using Zend FrameworkApplication development using Zend Framework
Application development using Zend Framework
 
Spring intro classes-in-mumbai
Spring intro classes-in-mumbaiSpring intro classes-in-mumbai
Spring intro classes-in-mumbai
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
 
Spring
SpringSpring
Spring
 
Con11257 schifano con11257-best practices for deploying highly scalable virtu...
Con11257 schifano con11257-best practices for deploying highly scalable virtu...Con11257 schifano con11257-best practices for deploying highly scalable virtu...
Con11257 schifano con11257-best practices for deploying highly scalable virtu...
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?
 
LoopbackJS the intro
LoopbackJS the introLoopbackJS the intro
LoopbackJS the intro
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
 
JavaScript Modules in Practice
JavaScript Modules in PracticeJavaScript Modules in Practice
JavaScript Modules in Practice
 
Framework adoption for java enterprise application development
Framework adoption for java enterprise application developmentFramework adoption for java enterprise application development
Framework adoption for java enterprise application development
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
 
Dog food conference creating modular webparts with require js in sharepoint
Dog food conference   creating modular webparts with require js in sharepointDog food conference   creating modular webparts with require js in sharepoint
Dog food conference creating modular webparts with require js in sharepoint
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project 
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 
AngularJS with RequireJS
AngularJS with RequireJSAngularJS with RequireJS
AngularJS with RequireJS
 
The Power of Enterprise Java Frameworks
The Power of Enterprise Java FrameworksThe Power of Enterprise Java Frameworks
The Power of Enterprise Java Frameworks
 
Web sphere liberty2
Web sphere liberty2Web sphere liberty2
Web sphere liberty2
 

Mais de Ahmed Elharouny

Deep dive into azure durable functions
Deep dive into azure durable functionsDeep dive into azure durable functions
Deep dive into azure durable functionsAhmed Elharouny
 
Applying microservices principles to front end
Applying microservices principles to front endApplying microservices principles to front end
Applying microservices principles to front endAhmed Elharouny
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJsAhmed Elharouny
 

Mais de Ahmed Elharouny (7)

Deep dive into azure durable functions
Deep dive into azure durable functionsDeep dive into azure durable functions
Deep dive into azure durable functions
 
Applying microservices principles to front end
Applying microservices principles to front endApplying microservices principles to front end
Applying microservices principles to front end
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Advanced Jquery
Advanced JqueryAdvanced Jquery
Advanced Jquery
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
Design patterns
Design patternsDesign patterns
Design patterns
 

Último

Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 

Último (20)

Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 

Introduction to require js

  • 1. Introduction to By Ahmed EL-Harouny 24 September 2014 RequireJS
  • 2. Page Agenda › WhatisRequireJS? › Why? › Buildingblocks(define,require,config) › Shims › Optimization › Demoonhowweareusingit. / Copyright ©2014 by Readify Pty Ltd2
  • 3. Page What is RequireJS? / Copyright ©2014 by Readify Pty Ltd3 • RequireJS is a JavaScript file and module loader. • It supports Asynchronous Module Definition AMD. • Asynchronous Module Definition (AMD) API specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded.
  • 4. Page Why? / Copyright ©2014 by Readify Pty Ltd4 common.js common.config.js 1-Scripts loads faster. 2-Manage script dependencies.
  • 5. Page Building blocks / Copyright ©2014 by Readify Pty Ltd5 • define • defines a RequireJS module. define(<moduleName>, <dependencies>, <anyObject>) • require • requires a RequireJS module. require(<dependencies>, <function>) • config • configures RequireJS. require.config(<configObject>)
  • 6. Page Building blocks / Copyright ©2014 by Readify Pty Ltd6 alias full path Returns window._
  • 7. Page Shims / Copyright ©2014 by Readify Pty Ltd7 Configure the dependencies, exports, and custom initialization for older, traditional "browser globals" scripts that do not use define(). • deps • I depend on. • exports • I export. • init Initialization logic.
  • 8. Page Optimization / Copyright ©2014 by Readify Pty Ltd8 • Combine related scripts together into minified files. • Uses r.js file. • node is recommended to run it. (java, browser can do it as well). Build output configs Build folder
  • 9. Page Demo / Copyright ©2014 by Readify Pty Ltd9 How we are using it. How it can help us in unit tests.