Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
94
0
Share
JavaScript Modules & Current Updates
Rizqy Hidayat
November 23, 2021
More Decks by Rizqy Hidayat
See All by Rizqy Hidayat
HTMX: Back to Basic
rizqyhi
0
56
Exploring PEMPA Architecture on Dicoding.com
rizqyhi
0
39
Menjelajah Dunia Frontend Lebih Jauh
rizqyhi
0
18
Introduction to Open Source & Hacktoberfest
rizqyhi
0
110
Frontend is Enough
rizqyhi
0
33
Other Decks in Programming
See All in Programming
ハーネスエンジニアリングとは?
kinopeee
13
7k
Agentic AI & UI: Arcitecture, HITL, Emerging Standards
manfredsteyer
PRO
0
100
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
360
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
410
Sans tests, vos agents ne sont pas fiables
nabondance
0
130
AgentCore Optimizationを始めよう!
licux
3
240
[BalkanRuby 2026] Drop your app/services!
palkan
0
120
From Formal Specification to Property Based Test
ohbarye
0
2.6k
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
210
[RubyKaigi 2026] Require Hooks
palkan
1
320
AIを導入する前にやるべきこと
negima
2
360
Back to the roots of date
jinroq
0
860
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
380
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Building AI with AI
inesmontani
PRO
1
990
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
780
Product Roadmaps are Hard
iamctodd
PRO
55
12k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Large-scale JavaScript Application Architecture
addyosmani
515
110k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
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!