SlideShare a Scribd company logo
Dependency Management
    with RequireJS
      http://requirejs.org/
Who ?
Julien Cabanès
Front End Developper
mail : julien@zeeagency.com
twitter : @JulienCabanes
github : github.com/ZeeAgency
What are we talkin’ about?

• RequireJS.org : Script Module Loader
• Browsers && Node && Rhino
• Dependencies
• Global Pollution
• Optimization
Context
Libs of choice

  jQuery


 Backbone

Recommended for you

Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript

Ever wondered how to get rid of that spaghetti, single-filed JavaScript code? Wouldn't it be nice if you could write maintainable modules, easily test them, port them to different projects, handle its library dependencies, and have them decoupled from other modules? In this talk, we'll see how using the AMD API and an event-driven design will help taming an application's JavaScript code and scaling it to the future and beyond.

event-drivenjavascriptarchitecture
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala

Para desenvolver um site institucional simples ou um hotsite pequeno, não é preciso muito mais que um pouco de HTML, um ou dois arquivos de CSS, alguns arquivos de JavaScript, e um sistema de CMS. No entanto, à medida que a complexidade de um site aumenta, o código passa a se tornar cada vez mais extenso, complexo, difícil de ser organizado, e projeto acaba virando um grande "code spaghetti". Para garantir que isso não aconteça, é necessário implementar uma estrutura sólida para o HTML, CSS e JavaScript, de modo que os componentes da aplicação funcionem independentemente e sejam facilmente mantidos e modificados. Nesta palestra, mostrei como elaborar uma arquitetura de front-end que sustente uma aplicação de larga escala.

htmlcssmodular
Creating Alloy Widgets
Creating Alloy WidgetsCreating Alloy Widgets
Creating Alloy Widgets

The document discusses Alloy Widgets, which are self-contained UI components that encapsulate logic and can be reused across projects. It provides an example of creating a custom table view widget that manages cross-platform differences. The widget file structure is described, and it is shown how widgets can be used in a main app via the Require tag, passing parameters that can be accessed in the widget controller. Styling of widget elements is recommended to be done in the main app for reusability.

titaniummobile data systemsalloy
Context
Libs of choice   Plugins

  jQuery


 Backbone
Context
Libs of choice   Plugins   Your Code

  jQuery


 Backbone
Bad Context
Libs of choice     Plugins   Your Code

  jQuery


 Backbone
Good Context
Libs of choice   Plugins   Your Code

  jQuery


 Backbone

Recommended for you

Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator

This document provides best practices for developing apps using Titanium Appcelerator. It discusses software quality characteristics from both the user and developer perspectives. Key aspects of a good software project are stability, performance, rapid development, and readability. Specific practices covered include avoiding global scope, nulling object references, using namespaces, lazy script loading, avoiding memory leaks with event listeners, optimizing images, and best practices for databases.

appceleratorandroidmobile
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf

The document discusses the importance of testing services and provides various strategies and tools for doing so effectively when developing software applications. It begins by defining what a service is and why testing services is important for building reliable applications. It then outlines challenges with testing external APIs and services that are beyond a developer's control. The document spends significant time exploring different approaches for stubbing or mocking external services in tests to avoid real network requests. These include built-in stubbing tools, services that provide pre-recorded responses, and technologies that can automatically record and replay API responses for future tests. It emphasizes the benefits of each approach and provides examples of implementing them. Finally, it discusses additional techniques for verifying tests that interact with external services.

soarubyrails
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...

Are you ready for production? Are you sure? Is your application prefetchable? Is it readable for search engine robots? Will it fit into Content Delivery Network? Do you want to make it even faster? Meet the Server-Side Rendering concept. Learn how to implement it in your application and gain knowledge about best practices, such as transfer state and route resolving strategies.

fwdaysjsjavascriprt
Dependencies
Libs of choice     Plugins   Your Code

  jQuery


 Backbone
Solution ?
<script   src="jquery.min.js"></script>
<script   src="backbone.min.js"></script>
...
<script   src="jquery.plugin.js"></script>
<script   src="jquery.plugin.js"></script>
...
<script   src="my-code.js"></script>
<script   src="my-code.js"></script>
<script   src="my-code.js"></script>
<script   src="my-code.js"></script>
<script   src="my-code.js"></script>
...
Async Solution ?
<script src="LAB.js"></script>
<script type="text/javascript">
$LAB
	 .script('jquery.min.js')
	 .script('backbone.min.js')
	 ...
	 .script('jquery.plugin.js')
	 .script('jquery.plugin.js')
	 .script('jquery.plugin.js')
	 ...
	 .script('my-code.js')
	 .script('my-code.js')
	 .script('my-code.js');
</script>
Namespace ?
var MyNamespace = {};

MyNamespace.Config = {…};

MyNamespace.Product = function() {…};

MyNamespace.Video = function() {…};

MyNamespace.Audio = function() {…};

MyNamespace.Mail = function() {…};

Recommended for you

Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJS

AngularJS is an open-source web application framework that uses declarative programming to build user interfaces. Its core principle is that declarative programming should be used for building UIs and wiring software components, while imperative programming is excellent for expressing business logic. The document then provides links to learn more about AngularJS through its official documentation, video instruction, blogs, and other resources.

angularjs javascript
An introduction to Ember.js
An introduction to Ember.jsAn introduction to Ember.js
An introduction to Ember.js

This document provides an overview of Ember.js, including its history, core concepts, and key features. Ember.js is a JavaScript MVC framework for building single page web applications. It includes features like classes and instances, computed properties, bindings, observers, routing, and integration with Ember Data for model management. The document discusses Ember's application architecture, run loop, object model, and prototype extensions for arrays, strings, and functions. It also covers views, controllers, templates, routing, and testing in Ember.

emberjs
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018

The document discusses various techniques for optimizing mobile test automation, including: 1) Mocking API responses and disabling animations to speed up test execution times significantly. 2) Implementing shortcuts like unique IDs and headers to scripts tests once across platforms. 3) Saving time by parallelizing test execution and preventing inconsistent test data issues.

appiumreact nativefrontmania
AMD

Not your CPU...
Asynchronous Module Definition

https://github.com/amdjs/amdjs-api/wiki/AMD
define()
API
define(id?, dependencies?, factory);


Usage
define('My-Module', ['Another-Module'],
	 function(AnotherModule) {
	 	 // Do Something

	 }
);
Example

// App/Conf.js
define(function() {
	 return {
	 	 path: '...',
	 	 debug: true,
	 	 ...
	 };
});
Example

// App/Conf.js
define(function() {
	 return {
	 	 path: '...',
	 	 debug: true,
	 	 ...
	 };
});

Recommended for you

Architecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouterArchitecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouter

UIRouter is a routing framework for AngularJS that uses states instead of URLs to organize an application's interface. Unlike ngRoute, which only supports one view, UIRouter supports nested views and named views. It allows resolving data dependencies before views are loaded. UIRouter provides events like $stateChangeStart that can be used to handle authorization and redirect users if needed. The routing is configured through the $stateProvider by defining states with names, URLs, templates, and resolve functions.

angularjavascriptangularjs
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction

AngularJS is a JavaScript framework for building single-page applications. It enhances HTML with new attributes and uses MVC/MVVM patterns. Key features include data binding, directives, filters, expressions and dependency injection. AngularJS makes it easier to organize web apps at the client-side by defining ways to structure code and adding custom tags/attributes to HTML. It also helps with common tasks in SPAs like routing, data loading and handling user events.

jsangularjsbeginners
Extend sdk
Extend sdkExtend sdk
Extend sdk

Kumar Pratik presented an overview of the Langoor feature SDK and API. The summary includes: 1) The SDK allows developers to create custom features for the Langoor editor with widgets, databases, and responses to actions like install and getProperty. 2) Features have main classes that define constructor, install, and other functions, while widgets define functions for HTML output, properties, and more. 3) The API uses responses to communicate with the editor, including forms, HTML, and actions like opening dialogs or the widget panel. 4) Developers need to understand HTML, CSS, JavaScript, PHP and MySQL to code features and widgets, which can include creating databases and handlers for functions

langoornetlangoorextendlangoornet
Example
// App/Controller/Product.js
define(['App/Conf', 'App/Models/Product', 'App/Views/Product'],
function(Conf, Model, View) {
	
	   // Locale & Private Vars !!!
	   var myPrivateVar = {...};
	
	   // API
	   return {
	   	 show: function(productId) {
	   	
	   	 	 console.log(Conf.path);
	   	 	
	   	 	 var productView = new View();
	   	 	 productView.setModel(Model.getById(productId));
	   	 	
	   	 	 return productView.render();
	   	 },
       ...
	   };
});
Example
// App/Controller/Product.js
define(['App/Conf', 'App/Models/Product', 'App/Views/Product'],
function(Conf, Model, View) {
	
	   // Locale & Private Vars !!!
	   var myPrivateVar = {...};
	
	   // API
	   return {
	   	 show: function(productId) {
	   	
	   	 	 console.log(Conf.path);
	   	 	
	   	 	 var productView = new View();
	   	 	 productView.setModel(Model.getById(productId));
	   	 	
	   	 	 return productView.render();
	   	 },
       ...
	   };
});
Example
// App/Controller/Product.js
define(['App/Conf', 'App/Models/Product', 'App/Views/Product'],
function(Conf, Model, View) {
	
	   // Locale & Private Vars !!!
	   var myPrivateVar = {...};
	
	   // API
	   return {
	   	 show: function(productId) {
	   	
	   	 	 console.log(Conf.path);
	   	 	
	   	 	 var productView = new View();
	   	 	 productView.setModel(Model.getById(productId));
	   	 	
	   	 	 return productView.render();
	   	 },
       ...
	   };
});
Example
// App/Controller/Product.js
define(['App/Conf', 'App/Models/Product', 'App/Views/Product'],
function(Conf, Model, View) {
	
	   // Locale & Private Vars !!!
	   var myPrivateVar = {...};
	
	   // API
	   return {
	   	 show: function(productId) {
	   	
	   	 	 console.log(Conf.path);
	   	 	
	   	 	 var productView = new View();
	   	 	 productView.setModel(Model.getById(productId));
	   	 	
	   	 	 return productView.render();
	   	 },
       ...
	   };
});

Recommended for you

Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016

Ember.js is a JavaScript framework for building web applications. It provides conventions and architecture to make applications more organized and testable. Key aspects of Ember.js include Ember objects, computed properties, templates powered by Handlebars, routes for navigation, and a data modeling layer using Ember Data. Components are also used to build reusable isolated views. Ember follows a "data down, actions up" pattern where data flows from parent to child components and user actions bubble up through the components.

frameworkjavascriptfrontend
Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js

Slides from my presentation at the Ember.js Southern California Meetup. Demo application source: https://gist.github.com/jayphelps/6036938

javascriptmeetupember.js
Styling recipes for Angular components
Styling recipes for Angular componentsStyling recipes for Angular components
Styling recipes for Angular components

There are multiple ways to style a component in Angular. This slide was created for my talk at AngularIL August meet up and contains recepis for styling.

angularangular2typescript
Example
// App/Controller/Product.js
define(['App/Conf', 'App/Models/Product', 'App/Views/Product'],
function(Conf, Model, View) {
	
	   // Locale & Private Vars !!!
	   var myPrivateVar = {...};
	
	   // API
	   return {
	   	 show: function(productId) {
	   	
	   	 	 console.log(Conf.path);
	   	 	
	   	 	 var productView = new View();
	   	 	 productView.setModel(Model.getById(productId));
	   	 	
	   	 	 return productView.render();
	   	 },
       ...
	   };
});
Scope vs. Global Pollution
// App/Controller/Product.js
define(['App/Conf', 'App/Models/Product', 'App/Views/Product'],
function(Conf, Model, View) {
	
	   // Locale & Private Vars !!!
	   var myPrivateVar = {...};
	
	   // API
	   return {
	   	 show: function(productId) {
	   	
	   	 	 console.log(Conf.path);
	   	 	
	   	 	 var productView = new View();
	   	 	 productView.setModel(Model.getById(productId));
	   	 	
	   	 	 return productView.render();
	   	 },
...
	   };
});
Plugins Example
// App/View/Product.js
define([
	   'order!FirstModule',
	   'order!SecondModule',
    'i18n!fr/some-i18n-bundle',
	   'text!some-text-file.txt',
    'cs!some-coffee',
	   'tpl!App/View/Product.tpl'
], function(First, Second, bundle, text, coffee, productTpl) {
	
	   // API
	   return Backbone.View.extend({
	
	   	 render: function() {
	   	 	 return productTpl({
	   	 	 	 model: this.model.toJSON()
	   	 	 });
	   	 }
	   });
});
Order Plugin
// App/View/Product.js
define([
    	'order!FirstModule',            // Keep execution order
	    'order!SecondModule',           // requirejs.org/docs/api.html#order
     'i18n!fr/some-i18n-bundle',
	    'text!some-text-file.txt',
     'cs!some-coffee',
	    'tpl!App/View/Product.tpl'
], function(First, Second, bundle, text, coffee, productTpl) {
	
	    // API
	    return Backbone.View.extend({
	
	    	 render: function() {
	    	 	 return productTpl({
	    	 	 	 model: this.model.toJSON()
	    	 	 });
	    	 }
	    });
});

Recommended for you

Testing C# and ASP.net using Ruby
Testing C# and ASP.net using RubyTesting C# and ASP.net using Ruby
Testing C# and ASP.net using Ruby

This document discusses using Ruby testing techniques with C# and ASP.NET. It begins by explaining how the mindset and practices of Ruby testing, such as test-driven development (TDD) and behavior-driven development (BDD), can be applied. It then provides examples of writing Ruby-style tests for C# code using tools like RSpec and describes testing strategies like sharing examples across tests. The document advocates an outside-in approach of writing acceptance tests first before unit tests.

qconlondonqconqconlondon2010
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance

Talk at HTMl5DevConf on April 1, 2013 about IndexedDB, Plugins for IndexedDB and performance analysis of IndexedDB.

html5dev confindexeddb
A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJS

The document discusses various aspects of single-page applications built with AngularJS including data binding, modules, controllers, directives, services, dependency injection, routing, and events. It provides code examples for defining a module, controller, directive, filter, and service as well as injecting services into controllers and emitting and broadcasting events. The document encourages joining the AngularJS community by testing apps, following style guides, reading publications, and subscribing to newsletters to learn more about building single-page apps with AngularJS.

beginnersangularjsclean code
i18n Plugin
// App/View/Product.js
define([
    	'order!FirstModule',
	    'order!SecondModule',
     'i18n!fr/some-i18n-bundle',     // Load i18n bundle
	    'text!some-text-file.txt',      // requirejs.org/docs/api.html#i18n
     'cs!some-coffee',
	    'tpl!App/View/Product.tpl'
], function(First, Second, bundle, text, coffee, productTpl) {
	
	    // API
	    return Backbone.View.extend({
	
	    	 render: function() {
	    	 	 return productTpl({
	    	 	 	 model: this.model.toJSON()
	    	 	 });
	    	 }
	    });
});
Text Plugin
// App/View/Product.js
define([
    	'order!FirstModule',
	    'order!SecondModule',
     'i18n!fr/some-i18n-bundle',
	    'text!some-text-file.txt',      // Guess what ?
     'cs!some-coffee',               // requirejs.org/docs/api.html#text
	    'tpl!App/View/Product.tpl'
], function(First, Second, bundle, text, coffee, productTpl) {
	
	    // API
	    return Backbone.View.extend({
	
	    	 render: function() {
	    	 	 return productTpl({
	    	 	 	 model: this.model.toJSON()
	    	 	 });
	    	 }
	    });
});
CoffeeScript Plugin
// App/View/Product.js
define([
    	'order!FirstModule',
	    'order!SecondModule',
     'i18n!fr/some-i18n-bundle',
	    'text!some-text-file.txt',
     'cs!some-coffee',               // returns compiled CoffeeScript !
	    'tpl!App/View/Product.tpl'      // github.com/jrburke/require-cs
], function(First, Second, bundle, text, coffee, productTpl) {
	
	    // API
	    return Backbone.View.extend({
	
	    	 render: function() {
	    	 	 return productTpl({
	    	 	 	 model: this.model.toJSON()
	    	 	 });
	    	 }
	    });
});
Template Plugin
// App/View/Product.js
define([
    	'order!FirstModule',
	    'order!SecondModule',
     'i18n!fr/some-i18n-bundle',
	    'text!some-text-file.txt',      // My Favorite Plugin ! (mine...)
     'cs!some-coffee',               // Returns a compiled template !
	    'tpl!App/View/Product.tpl'      // github.com/ZeeAgency/requirejs-tpl
], function(First, Second, bundle, text, coffee, productTpl) {
	
	    // API
	    return Backbone.View.extend({
	
	    	 render: function() {
	    	 	 return productTpl({
	    	 	 	 model: this.model.toJSON()
	    	 	 });
	    	 }
	    });
});

Recommended for you

Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)

Over the past year or so, we’ve seen the emergence of a new way of building JavaScript web apps that share code between the web browser and the server, using Node.js — a technique that has come to be known as "isomorphic JavaScript.” There are a variety of use cases for isomorphic JavaScript; some apps render HTML on both the server and the client, some apps share just a few small bits of application logic, while others share the entire application runtime between client and server to provide advanced offline and realtime features. Why go isomorphic? The main benefits are performance, maintainability, reusability, and SEO. This talk shares examples of isomorphic JavaScript apps running in the wild, explore the exploding ecosystem of asset building tools, such as Browserify, Webpack, and Gulp, that allow developers to build their own isomorphic JavaScript apps with open-source libraries, demonstrate how to build an isomorphic JavaScript module from scratch, and explore how libraries like React and Flux can be used to build a single-page app that renders on the server.

javascriptisomorphicjsconfasia
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...

This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.

sammyjshtml5javascript
Api development with rails
Api development with railsApi development with rails
Api development with rails

En esta platica trate de transmitir mejores practicas que se deben tener en cuenta cuando se diseña una API, y como ruby on rails te podria ayudar a desarrollarla en muy poco tiempo

spanishweb apiruby on rails
Optimization



node r.js -o name=bootstrap out=built.js baseUrl=js



          http://requirejs.org/docs/optimization.html
Remember ?
Libs of choice    Plugins   Your Code

  jQuery


 Backbone
Optimized !
Libs of choice   Ready for Production

  jQuery
Optimized !
Libs of choice   Ready for Production

  jQuery




                   CoffeeScript ?

Recommended for you

Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS

Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.

symfony2single page interfaceangularjs
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services

A presentation made for the AngularJS-IL meetup group that took place in oct 2014 at Google TLV Campus (http://www.meetup.com/AngularJS-IL/events/207559572/) its an overview of how to use services in your app. this slideshow contain a link for a reference code on github. (link in the last slide)

angularjavascriptsingeltons
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS

The document discusses creating modular test-driven single page applications (SPAs) using Spring and AngularJS. It provides an overview of AngularJS concepts and how to integrate AngularJS with Spring, including building and deploying AngularJS apps, modularization, and testing. It also covers AngularJS basics like models, views, controllers, directives, and modules.

springangularjsgrunt
Optimized !
Libs of choice   Ready for Production

  jQuery




                   CoffeeScript ?
                    Templates ?
Optimized !
Libs of choice       Ready for Production

  jQuery




                     CoffeeScript ?
                      Templates ?
                  Compiled & Minified
           so browser doesn’t need to...
Optimized !
Libs of choice    Ready for Production

  jQuery




                    CoffeeScript ?
                     Templates ?
                 Compiled & Minified
Thx !

Recommended for you

A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization development

The more your AngularJS App is growing the more important is modularization. It starts with the naming convention, file structure, AMD, goes through the build process, loading and packaging strategies and ends in the browser. We are going to give proposed solutions in practice as a ground for discussion. Further, you are welcome to present your ideas in slides or code, which demonstrate how to manage modularization in Angular.js projects. Speaker Bio: Johannes Weber has spent more than 10 years in front- and backend development. He works for Mayflower GmbH where he focuses on the migration of SPA and MPA. David Amend ist seit Jahren im Banken-Umfeld mit Schwerpunkt auf der Frontend-Entwicklung mithilfe von Java und JavaScript in Projekten tätig.

javascriptmodularizationangularjs
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference

AppBuilder in 45 Minutes - Presentation given at TelerikNEXT showing some of the many capabilities of Telerik AppBuilder.

appstelerikmobile
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for Beginners

This fast-paced overview for beginners discusses some aspects of AngularJS 1.x and 2.x, which versions to learn (and why), and the technologies that you need to learn. We'll delve into examples of combining AngularJS with other technologies (such as BackboneJS and D3.js), and also address the +/- of AngularJS.

angularjs angular2 typescript d3 backbonejs

More Related Content

What's hot

Refactoring JavaScript Applications
Refactoring JavaScript ApplicationsRefactoring JavaScript Applications
Refactoring JavaScript Applications
Jovan Vidić
 
CFUGbe talk about Angular JS
CFUGbe talk about Angular JSCFUGbe talk about Angular JS
CFUGbe talk about Angular JS
Alwyn Wymeersch
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
Eduardo Shiota Yasuda
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
Eduardo Shiota Yasuda
 
Creating Alloy Widgets
Creating Alloy WidgetsCreating Alloy Widgets
Creating Alloy Widgets
Mobile Data Systems Ltd.
 
Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
Alessio Ricco
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf
neal_kemp
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Fwdays
 
Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJS
Aaronius
 
An introduction to Ember.js
An introduction to Ember.jsAn introduction to Ember.js
An introduction to Ember.js
codeofficer
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
Wim Selles
 
Architecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouterArchitecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouter
Christopher Caplinger
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
Harsha Nagaraj
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
Sandino Núñez
 
Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js
Jay Phelps
 
Styling recipes for Angular components
Styling recipes for Angular componentsStyling recipes for Angular components
Styling recipes for Angular components
Nir Kaufman
 
Testing C# and ASP.net using Ruby
Testing C# and ASP.net using RubyTesting C# and ASP.net using Ruby
Testing C# and ASP.net using Ruby
Ben Hall
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
Parashuram N
 

What's hot (20)

Refactoring JavaScript Applications
Refactoring JavaScript ApplicationsRefactoring JavaScript Applications
Refactoring JavaScript Applications
 
CFUGbe talk about Angular JS
CFUGbe talk about Angular JSCFUGbe talk about Angular JS
CFUGbe talk about Angular JS
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
 
Creating Alloy Widgets
Creating Alloy WidgetsCreating Alloy Widgets
Creating Alloy Widgets
 
Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
 
Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJS
 
An introduction to Ember.js
An introduction to Ember.jsAn introduction to Ember.js
An introduction to Ember.js
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
 
Architecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouterArchitecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouter
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
 
Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js
 
Styling recipes for Angular components
Styling recipes for Angular componentsStyling recipes for Angular components
Styling recipes for Angular components
 
Testing C# and ASP.net using Ruby
Testing C# and ASP.net using RubyTesting C# and ASP.net using Ruby
Testing C# and ASP.net using Ruby
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 

Similar to ParisJS #10 : RequireJS

A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJS
Gregor Woiwode
 
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
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Api development with rails
Api development with railsApi development with rails
Api development with rails
Edwin Cruz
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
Antonio Peric-Mazar
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services
Nir Kaufman
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
Gunnar Hillert
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization development
Johannes Weber
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
Jen Looper
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for Beginners
Oswald Campesato
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
Spike Brehm
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
Python Ireland
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
Antônio Roberto Silva
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure Functions
Sébastien Levert
 
Containers & Dependency in Ember.js
Containers & Dependency in Ember.jsContainers & Dependency in Ember.js
Containers & Dependency in Ember.js
Matthew Beale
 
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
Wim Selles
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
Yakov Fain
 
Drupal 8, Where Did the Code Go? From Info Hook to Plugin
Drupal 8, Where Did the Code Go? From Info Hook to PluginDrupal 8, Where Did the Code Go? From Info Hook to Plugin
Drupal 8, Where Did the Code Go? From Info Hook to Plugin
Acquia
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
Frank Rousseau
 

Similar to ParisJS #10 : RequireJS (20)

A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJS
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Api development with rails
Api development with railsApi development with rails
Api development with rails
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization development
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for Beginners
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure Functions
 
Containers & Dependency in Ember.js
Containers & Dependency in Ember.jsContainers & Dependency in Ember.js
Containers & Dependency in Ember.js
 
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
 
Drupal 8, Where Did the Code Go? From Info Hook to Plugin
Drupal 8, Where Did the Code Go? From Info Hook to PluginDrupal 8, Where Did the Code Go? From Info Hook to Plugin
Drupal 8, Where Did the Code Go? From Info Hook to Plugin
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 

Recently uploaded

The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 

Recently uploaded (20)

The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 

ParisJS #10 : RequireJS

  • 1. Dependency Management with RequireJS http://requirejs.org/
  • 2. Who ? Julien Cabanès Front End Developper mail : julien@zeeagency.com twitter : @JulienCabanes github : github.com/ZeeAgency
  • 3. What are we talkin’ about? • RequireJS.org : Script Module Loader • Browsers && Node && Rhino • Dependencies • Global Pollution • Optimization
  • 4. Context Libs of choice jQuery Backbone
  • 5. Context Libs of choice Plugins jQuery Backbone
  • 6. Context Libs of choice Plugins Your Code jQuery Backbone
  • 7. Bad Context Libs of choice Plugins Your Code jQuery Backbone
  • 8. Good Context Libs of choice Plugins Your Code jQuery Backbone
  • 9. Dependencies Libs of choice Plugins Your Code jQuery Backbone
  • 10. Solution ? <script src="jquery.min.js"></script> <script src="backbone.min.js"></script> ... <script src="jquery.plugin.js"></script> <script src="jquery.plugin.js"></script> ... <script src="my-code.js"></script> <script src="my-code.js"></script> <script src="my-code.js"></script> <script src="my-code.js"></script> <script src="my-code.js"></script> ...
  • 11. Async Solution ? <script src="LAB.js"></script> <script type="text/javascript"> $LAB .script('jquery.min.js') .script('backbone.min.js') ... .script('jquery.plugin.js') .script('jquery.plugin.js') .script('jquery.plugin.js') ... .script('my-code.js') .script('my-code.js') .script('my-code.js'); </script>
  • 12. Namespace ? var MyNamespace = {}; MyNamespace.Config = {…}; MyNamespace.Product = function() {…}; MyNamespace.Video = function() {…}; MyNamespace.Audio = function() {…}; MyNamespace.Mail = function() {…};
  • 13. AMD Not your CPU... Asynchronous Module Definition https://github.com/amdjs/amdjs-api/wiki/AMD
  • 14. define() API define(id?, dependencies?, factory); Usage define('My-Module', ['Another-Module'], function(AnotherModule) { // Do Something } );
  • 15. Example // App/Conf.js define(function() { return { path: '...', debug: true, ... }; });
  • 16. Example // App/Conf.js define(function() { return { path: '...', debug: true, ... }; });
  • 17. Example // App/Controller/Product.js define(['App/Conf', 'App/Models/Product', 'App/Views/Product'], function(Conf, Model, View) { // Locale & Private Vars !!! var myPrivateVar = {...}; // API return { show: function(productId) { console.log(Conf.path); var productView = new View(); productView.setModel(Model.getById(productId)); return productView.render(); }, ... }; });
  • 18. Example // App/Controller/Product.js define(['App/Conf', 'App/Models/Product', 'App/Views/Product'], function(Conf, Model, View) { // Locale & Private Vars !!! var myPrivateVar = {...}; // API return { show: function(productId) { console.log(Conf.path); var productView = new View(); productView.setModel(Model.getById(productId)); return productView.render(); }, ... }; });
  • 19. Example // App/Controller/Product.js define(['App/Conf', 'App/Models/Product', 'App/Views/Product'], function(Conf, Model, View) { // Locale & Private Vars !!! var myPrivateVar = {...}; // API return { show: function(productId) { console.log(Conf.path); var productView = new View(); productView.setModel(Model.getById(productId)); return productView.render(); }, ... }; });
  • 20. Example // App/Controller/Product.js define(['App/Conf', 'App/Models/Product', 'App/Views/Product'], function(Conf, Model, View) { // Locale & Private Vars !!! var myPrivateVar = {...}; // API return { show: function(productId) { console.log(Conf.path); var productView = new View(); productView.setModel(Model.getById(productId)); return productView.render(); }, ... }; });
  • 21. Example // App/Controller/Product.js define(['App/Conf', 'App/Models/Product', 'App/Views/Product'], function(Conf, Model, View) { // Locale & Private Vars !!! var myPrivateVar = {...}; // API return { show: function(productId) { console.log(Conf.path); var productView = new View(); productView.setModel(Model.getById(productId)); return productView.render(); }, ... }; });
  • 22. Scope vs. Global Pollution // App/Controller/Product.js define(['App/Conf', 'App/Models/Product', 'App/Views/Product'], function(Conf, Model, View) { // Locale & Private Vars !!! var myPrivateVar = {...}; // API return { show: function(productId) { console.log(Conf.path); var productView = new View(); productView.setModel(Model.getById(productId)); return productView.render(); }, ... }; });
  • 23. Plugins Example // App/View/Product.js define([ 'order!FirstModule', 'order!SecondModule', 'i18n!fr/some-i18n-bundle', 'text!some-text-file.txt', 'cs!some-coffee', 'tpl!App/View/Product.tpl' ], function(First, Second, bundle, text, coffee, productTpl) { // API return Backbone.View.extend({ render: function() { return productTpl({ model: this.model.toJSON() }); } }); });
  • 24. Order Plugin // App/View/Product.js define([ 'order!FirstModule', // Keep execution order 'order!SecondModule', // requirejs.org/docs/api.html#order 'i18n!fr/some-i18n-bundle', 'text!some-text-file.txt', 'cs!some-coffee', 'tpl!App/View/Product.tpl' ], function(First, Second, bundle, text, coffee, productTpl) { // API return Backbone.View.extend({ render: function() { return productTpl({ model: this.model.toJSON() }); } }); });
  • 25. i18n Plugin // App/View/Product.js define([ 'order!FirstModule', 'order!SecondModule', 'i18n!fr/some-i18n-bundle', // Load i18n bundle 'text!some-text-file.txt', // requirejs.org/docs/api.html#i18n 'cs!some-coffee', 'tpl!App/View/Product.tpl' ], function(First, Second, bundle, text, coffee, productTpl) { // API return Backbone.View.extend({ render: function() { return productTpl({ model: this.model.toJSON() }); } }); });
  • 26. Text Plugin // App/View/Product.js define([ 'order!FirstModule', 'order!SecondModule', 'i18n!fr/some-i18n-bundle', 'text!some-text-file.txt', // Guess what ? 'cs!some-coffee', // requirejs.org/docs/api.html#text 'tpl!App/View/Product.tpl' ], function(First, Second, bundle, text, coffee, productTpl) { // API return Backbone.View.extend({ render: function() { return productTpl({ model: this.model.toJSON() }); } }); });
  • 27. CoffeeScript Plugin // App/View/Product.js define([ 'order!FirstModule', 'order!SecondModule', 'i18n!fr/some-i18n-bundle', 'text!some-text-file.txt', 'cs!some-coffee', // returns compiled CoffeeScript ! 'tpl!App/View/Product.tpl' // github.com/jrburke/require-cs ], function(First, Second, bundle, text, coffee, productTpl) { // API return Backbone.View.extend({ render: function() { return productTpl({ model: this.model.toJSON() }); } }); });
  • 28. Template Plugin // App/View/Product.js define([ 'order!FirstModule', 'order!SecondModule', 'i18n!fr/some-i18n-bundle', 'text!some-text-file.txt', // My Favorite Plugin ! (mine...) 'cs!some-coffee', // Returns a compiled template ! 'tpl!App/View/Product.tpl' // github.com/ZeeAgency/requirejs-tpl ], function(First, Second, bundle, text, coffee, productTpl) { // API return Backbone.View.extend({ render: function() { return productTpl({ model: this.model.toJSON() }); } }); });
  • 29. Optimization node r.js -o name=bootstrap out=built.js baseUrl=js http://requirejs.org/docs/optimization.html
  • 30. Remember ? Libs of choice Plugins Your Code jQuery Backbone
  • 31. Optimized ! Libs of choice Ready for Production jQuery
  • 32. Optimized ! Libs of choice Ready for Production jQuery CoffeeScript ?
  • 33. Optimized ! Libs of choice Ready for Production jQuery CoffeeScript ? Templates ?
  • 34. Optimized ! Libs of choice Ready for Production jQuery CoffeeScript ? Templates ? Compiled & Minified so browser doesn’t need to...
  • 35. Optimized ! Libs of choice Ready for Production jQuery CoffeeScript ? Templates ? Compiled & Minified
  • 36. Thx !