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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
14
Introduction to Open Source & Hacktoberfest
rizqyhi
0
100
Frontend is Enough
rizqyhi
0
30
Other Decks in Programming
See All in Programming
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
250
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
ぼくの開発環境2026
yuzneri
0
120
CSC307 Lecture 03
javiergs
PRO
1
490
Fluid Templating in TYPO3 14
s2b
0
130
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
AtCoder Conference 2025
shindannin
0
1k
AI時代の認知負荷との向き合い方
optfit
0
150
高速開発のためのコード整理術
sutetotanuki
1
390
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
Documentation Writing (for coders)
carmenintech
77
5.2k
Building Adaptive Systems
keathley
44
2.9k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
The Spectacular Lies of Maps
axbom
PRO
1
520
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How to build a perfect <img>
jonoalderson
1
4.9k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
For a Future-Friendly Web
brad_frost
182
10k
Faster Mobile Websites
deanohume
310
31k
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!