$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JavaScript Modules & Current Updates
Search
Rizqy Hidayat
November 23, 2021
Programming
0
91
JavaScript Modules & Current Updates
Rizqy Hidayat
November 23, 2021
Tweet
Share
More Decks by Rizqy Hidayat
See All by Rizqy Hidayat
HTMX: Back to Basic
rizqyhi
0
51
Exploring PEMPA Architecture on Dicoding.com
rizqyhi
0
32
Menjelajah Dunia Frontend Lebih Jauh
rizqyhi
0
12
Introduction to Open Source & Hacktoberfest
rizqyhi
0
97
Frontend is Enough
rizqyhi
0
29
Other Decks in Programming
See All in Programming
Cap'n Webについて
yusukebe
0
150
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
250
AIコーディングエージェント(Manus)
kondai24
0
210
Vibe codingでおすすめの言語と開発手法
uyuki234
0
110
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
280
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
120
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
260
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.4k
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.3k
New Earth Scene 8
popppiees
0
1.2k
How to make the Groovebox
asonas
2
1.8k
From π to Pie charts
rasagy
0
91
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Speed Design
sergeychernyshev
33
1.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
250
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
55
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
65
35k
GraphQLとの向き合い方2022年版
quramy
50
14k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
88
Transcript
JavaScript Modules & Current Updates Rizqy Hidayat PRODUCT ENGINEER, DICODING
Aloha 👋 Rizqy Hidayat PRODUCT ENGINEER, DICODING
[email protected]
- @rizqyhi
Prehistoric module Era 🦕 • • • JavaScript doesn't have
built-in support for modules Modular files, global scope Dependencies should be loaded before and configured manually
None
COMMONJS AMD UMD ESM Used in NodeJS (server) Used in
browser (client) Works for both node & browser Newest stanndard on ES6 ✨ History of Modules in JavaScript
CommonJS • • • Standard used in NodeJS for working
with modules Load modules synchronously Simple syntax
Asynchronous Module Definition (AMD) • • • • Alternative to
CommonJS, usually used in browser Needs library to handle module resolution Load modules asynchronously Slightly complex syntax
What if our library used by many teams? And they
used CommonJS and AMD?
Universal Module Definition (UMD) • • • Unify CommonJS and
AMD More complex syntax Use build tool to help generate exported modules
None
EcmaScript Module (ESM) • • • • Part of ES6/ES2015
standard The best from both CommonJS and AMD: Simple syntax Load module asynchronously
Use ESM in Browser Now • • • Import directly
from file/CDN No transpilation needed No need to bundle
None
Does it work on old browsers? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
ESM in Older Browser • • • Write code in
ES6 Transpile to ES5 Bundle into one file or split into chunks
Takeaways • • • • • Use ESM to work
with modules Write JavaScript in newest standard Or TypeScript if necessary Transpile to older format when in needs to support old browsers Use best tools available that suites your needs
Thanks!