SlideShare a Scribd company logo
Module System of
JavaScript
Junichi Shinohara @ HDE, Inc.
1
Motivation
โ– We donโ€™t decide to use Module
System of JavaScript yet
โ– So, I investigated module
system of JavaScript
2
What is module system?
โ– Provided Features
โ– Namespace
โ– Dependence resolution
3
Past: The Dark Ages โˆผ 2011
4
JavaScript of Early Date
โ– No module system
โ– Only window as namespace
โ– jQuery
โ– $ (or jQuery)
โ– $.fn[pluginName]
โ– Not enough solution
โ– No dependence of resolution
5
Present: Age of Discovery 2011โˆผ2015
6
โ– Two Speci๏ฌcation for module
system
โ– CommonJS
โ– AMD
Specifications of Module System
7
CommonJS
โ– Speci๏ฌcation of module system
โ– To de๏ฌne modules
โ– export or module.export
โ– To resolve dependence
โ– require
โ– Implementations
โ– Node.js (Server-Side)
โ– Browser๏ฌy (Client-Side)
โ– Reference
โ– CommonJS Speci๏ฌcation ( http://www.commonjs.org/ )
โ– Node.js HP ( https://nodejs.org/ )
โ– Browserify HP ( http://browserify.org/ )
8
Example
AMD (Asynchronous Module Definition)
โ– Speci๏ฌcation of module system
โ– Load modules asynchronously
โ– To de๏ฌne modules / To resolve
dependence
โ– de๏ฌne
โ– Implementations
โ– RequireJS
โ– References
โ– AMD API Speci๏ฌcation ( https://github.com/amdjs/
amdjs-api/wiki/AMD )
โ– RequireJS HP ( http://requirejs.org/ )
9
Example
...and then, toward
the future?
201Xโˆผ
10
ECMAScript 6
โ– Speci๏ฌcation of scripting languages such as
JavaScript
โ– In June 2015, ES 6th Edition was issued
โ– Module syntax
โ– CommonJS Style
โ– Named Exports
โ– All browsers donโ€™t implement the syntax yet
โ– Implementations
โ– Babel (Poly๏ฌll)
โ– TypeScript (AltJS)
โ– References
โ– Babel ( https://github.com/babel/babel )
โ– ECMAScript 6 compatible table ( http://kangax.github.io/compat-table/es6/ )
โ– ECMAScript 6 modules: the ๏ฌnal syntax ( http://www.2ality.com/2014/09/es6-
modules-๏ฌnal.html )
โ– ECMA-262 6th Edition (http://www.ecma-international.org/ecma-262/6.0/ )
11
CommonJS Style
Named Exports
Module System of AngularJS
โ– AngularJS has an original module
system
โ– AngularJS supports CommonJS
style from 1.4, 1.3.14
โ– AngularJS 2 will support ES6-
module
โ– References
โ– About Angular 1.4 ( http://
angularjs.blogspot.jp/2015/02/new-angularjs-
releases-140-beta5-and.html )
โ– About Angular 2.0 ( http://
angularjs.blogspot.jp/2014/03/angular-20.html )
12
Example
You should adopt CommonJS Style so far
Conclusion
13

More Related Content

Similar to Module System of JavaScript (20)

PPTX
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
Leonardo Zanivan
ย 
PPTX
Java in the cloud with Jelastic
jkops78
ย 
PDF
What we can expect from Java 9 by Ivan Krylov
J On The Beach
ย 
PDF
OTN Developer Days - GlassFish
glassfish
ย 
PPTX
[Mas 500] Software Development Strategies
rahulbot
ย 
PDF
Java 9 preview
Ivan Krylov
ย 
PPTX
[Mas 500] Web Basics
rahulbot
ย 
PPTX
Road Trip To Component
Marketa Adamova
ย 
PDF
Core Java
Prakash Dimmita
ย 
ODP
Java EE web project introduction
Ondrej Mihรกlyi
ย 
PDF
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
JUG Lausanne
ย 
PPTX
Version Management in Maven
Geert Pante
ย 
PPT
Introduction to java programming part 1
university of education,Lahore
ย 
PDF
Ad111
ddrschiw
ย 
PDF
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
ddrschiw
ย 
PDF
Glassfish An Introduction
Jumping Bean
ย 
PDF
NLOUG 2018 - Future of JSF and ADF
Daniel Merchรกn Garcรญa
ย 
PPTX
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Mihail Stoynov
ย 
PPTX
001. Introduction about React
Binh Quan Duc
ย 
PDF
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Otรกvio Santana
ย 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
Leonardo Zanivan
ย 
Java in the cloud with Jelastic
jkops78
ย 
What we can expect from Java 9 by Ivan Krylov
J On The Beach
ย 
OTN Developer Days - GlassFish
glassfish
ย 
[Mas 500] Software Development Strategies
rahulbot
ย 
Java 9 preview
Ivan Krylov
ย 
[Mas 500] Web Basics
rahulbot
ย 
Road Trip To Component
Marketa Adamova
ย 
Core Java
Prakash Dimmita
ย 
Java EE web project introduction
Ondrej Mihรกlyi
ย 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
JUG Lausanne
ย 
Version Management in Maven
Geert Pante
ย 
Introduction to java programming part 1
university of education,Lahore
ย 
Ad111
ddrschiw
ย 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
ddrschiw
ย 
Glassfish An Introduction
Jumping Bean
ย 
NLOUG 2018 - Future of JSF and ADF
Daniel Merchรกn Garcรญa
ย 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Mihail Stoynov
ย 
001. Introduction about React
Binh Quan Duc
ย 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Otรกvio Santana
ย 

Recently uploaded (20)

PDF
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
ย 
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
ย 
PPTX
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
ย 
PPTX
declaration of Variables and constants.pptx
meemee7378
ย 
PDF
OpenChain Webinar - AboutCode - Practical Compliance in One Stack โ€“ Licensing...
Shane Coughlan
ย 
PDF
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
ย 
PPTX
Agentforce โ€“ TDX 2025 Hackathon Achievement
GetOnCRM Solutions
ย 
PDF
Rewards and Recognition (2).pdf
ethan Talor
ย 
PDF
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
ย 
PDF
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
ย 
PDF
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
ย 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
PDF
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
ย 
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
ย 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
ย 
PPTX
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
ย 
PDF
Which Hiring Management Tools Offer the Best ROI?
HireME
ย 
PDF
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
ย 
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
ย 
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
ย 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
ย 
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
ย 
declaration of Variables and constants.pptx
meemee7378
ย 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack โ€“ Licensing...
Shane Coughlan
ย 
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
ย 
Agentforce โ€“ TDX 2025 Hackathon Achievement
GetOnCRM Solutions
ย 
Rewards and Recognition (2).pdf
ethan Talor
ย 
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
ย 
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
ย 
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
ย 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
ย 
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
ย 
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
ย 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
ย 
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
ย 
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
ย 
Which Hiring Management Tools Offer the Best ROI?
HireME
ย 
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
ย 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
ย 
Ad

Module System of JavaScript

  • 1. Module System of JavaScript Junichi Shinohara @ HDE, Inc. 1
  • 2. Motivation โ– We donโ€™t decide to use Module System of JavaScript yet โ– So, I investigated module system of JavaScript 2
  • 3. What is module system? โ– Provided Features โ– Namespace โ– Dependence resolution 3
  • 4. Past: The Dark Ages โˆผ 2011 4
  • 5. JavaScript of Early Date โ– No module system โ– Only window as namespace โ– jQuery โ– $ (or jQuery) โ– $.fn[pluginName] โ– Not enough solution โ– No dependence of resolution 5
  • 6. Present: Age of Discovery 2011โˆผ2015 6
  • 7. โ– Two Speci๏ฌcation for module system โ– CommonJS โ– AMD Specifications of Module System 7
  • 8. CommonJS โ– Speci๏ฌcation of module system โ– To de๏ฌne modules โ– export or module.export โ– To resolve dependence โ– require โ– Implementations โ– Node.js (Server-Side) โ– Browser๏ฌy (Client-Side) โ– Reference โ– CommonJS Speci๏ฌcation ( http://www.commonjs.org/ ) โ– Node.js HP ( https://nodejs.org/ ) โ– Browserify HP ( http://browserify.org/ ) 8 Example
  • 9. AMD (Asynchronous Module Definition) โ– Speci๏ฌcation of module system โ– Load modules asynchronously โ– To de๏ฌne modules / To resolve dependence โ– de๏ฌne โ– Implementations โ– RequireJS โ– References โ– AMD API Speci๏ฌcation ( https://github.com/amdjs/ amdjs-api/wiki/AMD ) โ– RequireJS HP ( http://requirejs.org/ ) 9 Example
  • 10. ...and then, toward the future? 201Xโˆผ 10
  • 11. ECMAScript 6 โ– Speci๏ฌcation of scripting languages such as JavaScript โ– In June 2015, ES 6th Edition was issued โ– Module syntax โ– CommonJS Style โ– Named Exports โ– All browsers donโ€™t implement the syntax yet โ– Implementations โ– Babel (Poly๏ฌll) โ– TypeScript (AltJS) โ– References โ– Babel ( https://github.com/babel/babel ) โ– ECMAScript 6 compatible table ( http://kangax.github.io/compat-table/es6/ ) โ– ECMAScript 6 modules: the ๏ฌnal syntax ( http://www.2ality.com/2014/09/es6- modules-๏ฌnal.html ) โ– ECMA-262 6th Edition (http://www.ecma-international.org/ecma-262/6.0/ ) 11 CommonJS Style Named Exports
  • 12. Module System of AngularJS โ– AngularJS has an original module system โ– AngularJS supports CommonJS style from 1.4, 1.3.14 โ– AngularJS 2 will support ES6- module โ– References โ– About Angular 1.4 ( http:// angularjs.blogspot.jp/2015/02/new-angularjs- releases-140-beta5-and.html ) โ– About Angular 2.0 ( http:// angularjs.blogspot.jp/2014/03/angular-20.html ) 12 Example
  • 13. You should adopt CommonJS Style so far Conclusion 13