How Hot Module Replacement REALLY Works | JS Toolchain From Scratch

  Рет қаралды 2,401

Lachlan Miller

Lachlan Miller

Ай бұрын

🎉 NEW book on tooling (build your own tools!) Coming 2024, register for updates): lachlan-miller.ck.page/92dfa0...
⚠️ NOTE: I refer to HMR as Hot Module RELOAD - it's actually "Replacement", I had been saying in wrong for years.
🐦 My Twitter: / lachlan19900
✏️ Diagram/notes from video: app.eraser.io/workspace/W1ZOW...
🔨 I am building an entire JS toolchain from (mostly) scratch. In this video, we lay the foundations and build out a naive but simple and functional hot module replacement (HMR) implementation.
Source: github.com/lmiller1990/build-...

Пікірлер: 20
@LachlanMiller
@LachlanMiller Ай бұрын
The R in HMR is for "replacement" - I say "reload" in this video (and have done so for years). Sorry about that 🤦‍♂ Enjoy!
@TheAlexLichter
@TheAlexLichter Ай бұрын
I was today years old that it is Replacement and not Reload 🙈 Thanks for the video Lachlan 🙌🏻
@LachlanMiller
@LachlanMiller Ай бұрын
Thanks! Been tuning in to you & Michael's podcast, great stuff! SSR / hydration isn't something I know well, might have to hit you up for some help when I get to making a video about how that works under the hood...
@TheAlexLichter
@TheAlexLichter Ай бұрын
@@LachlanMiller Glad you enjoy the podcast ☺ Oh yes, absolutely! My DMs are always open 🙌🏻
@Pablitox26
@Pablitox26 Ай бұрын
This is amazing! Learned a lot, thanks so much!! 😃
@dimasheiko
@dimasheiko Ай бұрын
great video! please keep this tooling series going 👏
@LachlanMiller
@LachlanMiller Ай бұрын
Will do!
@Mac501pl
@Mac501pl Ай бұрын
Great video! Nice to know how things we take for granted actually work
@Kevin-xo5ul
@Kevin-xo5ul Ай бұрын
This is something I've been wanting to look into for a while, so great timing on the video.
@LachlanMiller
@LachlanMiller Ай бұрын
Hope you find it useful!
@aaditolkar
@aaditolkar Ай бұрын
Great series! It can be hard to understand how these tools work at a basic level but you made it very digestable!
@LachlanMiller
@LachlanMiller Ай бұрын
Thank you - I am glad you are enjoying it!
@sravansuresh7460
@sravansuresh7460 Ай бұрын
This was awesome. Loving the series.
@LachlanMiller
@LachlanMiller Ай бұрын
Thanks, glad you are enjoying it! Not sure what to focus on next, any recommendations?
@sravansuresh7460
@sravansuresh7460 Ай бұрын
@@LachlanMiller I have always been curious about source maps and how the browser uses them. I would also love to see a basic bundler & transpiler built with something like esbuild and what to keep in mind when working with them.
@LachlanMiller
@LachlanMiller Ай бұрын
@@sravansuresh7460 Source maps for sure, to show this off I think we need a bundler / transpiler first, that might be next 🔥
@rameshramesh-bd2wu
@rameshramesh-bd2wu Ай бұрын
Awesome content, when can we expect your book ?
@LachlanMiller
@LachlanMiller Ай бұрын
Hopefully later this year, this kind of content takes a ton of time! I will send out email updates as they come.
@bk1507
@bk1507 Ай бұрын
im confused in the hotmodule class you have an accept method that takes in a callback. but then the accept method is not called anywhere so where is the callback coming from?
@LachlanMiller
@LachlanMiller Ай бұрын
Confusing right... it is called in the `child,.js`, it is `import.meta.hot.accept(...)`. It is called as soon at the module is loaded. See here: github.com/lmiller1990/build-your-own-vite/blob/371c6a991615f881ac1562ebcbb2ffdf02fe9c6e/dev-server/src/child.js#L3
Visual Guide to the Modern Frontend Toolchain (Vite)
9:18
Lachlan Miller
Рет қаралды 72 М.
3 Ways to Avoid Prop Drilling in Vue/React
9:34
Lachlan Miller
Рет қаралды 3,8 М.
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 6 МЛН
The magical amulet of the cross! #clown #小丑 #shorts
00:54
好人小丑
Рет қаралды 20 МЛН
This is so bad it's dangerous (Copilot CLI review)
22:32
Theo - t3․gg
Рет қаралды 59 М.
My Favorite TypeScript Tips and Tricks
10:21
Lachlan Miller
Рет қаралды 4,4 М.
The Difference Between Vue and React
10:27
Lachlan Miller
Рет қаралды 26 М.
Google IO 2024 Full Breakdown: Google is RELEVANT Again!
27:35
Matthew Berman
Рет қаралды 35 М.
OpenAI SHOCKED Everyone! Voice, Vision, & Free?!
8:58
Theoretically Media
Рет қаралды 44 М.
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 34 М.
INSANE OpenAI News: GPT-4o and your own AI partner
28:48
AI Search
Рет қаралды 288 М.
React Crash Course 2024
3:04:36
Traversy Media
Рет қаралды 221 М.
Xiaomi Note 13 Pro по безумной цене в России
0:43
Простые Технологии
Рет қаралды 1,3 МЛН
Best Gun Stock for VR gaming. #vr #vrgaming  #glistco
0:15
Glistco
Рет қаралды 2,2 МЛН
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Рет қаралды 3,5 МЛН
Купите ЭТОТ БЮДЖЕТНИК вместо флагманов от Samsung, Xiaomi и Apple!
13:03
Thebox - о технике и гаджетах
Рет қаралды 61 М.
Радиоприемник из фольги, стаканчика и светодиода с батарейкой?
1:00
M4 iPad Pro Impressions: Well This is Awkward
12:51
Marques Brownlee
Рет қаралды 6 МЛН