Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScript Modules & Current Updates
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Rizqy Hidayat
November 23, 2021
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript Modules & Current Updates
Rizqy Hidayat
November 23, 2021
More Decks by Rizqy Hidayat
See All by Rizqy Hidayat
PHP in AI Age: The Laravel Way
rizqyhi
0
7
HTMX: Back to Basic
rizqyhi
0
60
Exploring PEMPA Architecture on Dicoding.com
rizqyhi
0
53
Menjelajah Dunia Frontend Lebih Jauh
rizqyhi
0
21
Introduction to Open Source & Hacktoberfest
rizqyhi
0
110
Frontend is Enough
rizqyhi
0
43
Other Decks in Programming
See All in Programming
カツオ、ご期待ください
suneo3476
0
190
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
APNsからLive Activityを開始する話
yumnumm
0
170
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
699
190k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Why Our Code Smells
bkeepers
PRO
340
58k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
What's in a price? How to price your products and services
michaelherold
247
13k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
How to Talk to Developers About Accessibility
jct
2
580
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
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!