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
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
Workers Cache を知る
syumai
0
360
R8 の設定見直しでアプリサイズ削減
andpad
0
220
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
golang-bob.pdf
iwatsukayura
0
130
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
カツオ、ご期待ください
suneo3476
0
190
Next.js: The final boss of Web Performance
guaca
0
260
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
ActionController meets Protocol Buffers
sorah
0
530
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
970
Writing Fast Ruby
sferik
630
63k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Thoughts on Productivity
jonyablonski
76
5.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
We Have a Design System, Now What?
morganepeng
55
8.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
570
Building AI with AI
inesmontani
PRO
1
1.3k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.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!