Coding Shorts: What Surprised Me About ECMAScript Modules

  Рет қаралды 1,420

Shawn Wildermuth

Shawn Wildermuth

Күн бұрын

The Pluralsight Course:
shawnl.ink/jsmod
While creating my Pluralsight course (Modules in JavaScript), I learned some new things about ECMAScript Modules. Take a look at some things that surprised me:
00:00 - Introduction
00:21 - Without Modules
02:48 - Using CommonJS
03:19 - Renaming to .mjs
03:40 - Enabling ESM for Node.js Project
06:10 - Integrating with CommonJS NPM Packages
08:06 - ESM import() function
10:09 - Wrapping Up
Source code: github.com/shawnwildermuth/co...
If you like this video, you might like other videos in my Instructional Videos:
- • Instructional Videos
You can hire me too! You can reach me at my new website:
- shawn.wildermuth.com

Пікірлер: 10
@soneryldrm3075
@soneryldrm3075 Жыл бұрын
Great video, thx.
@BrianHallmanac
@BrianHallmanac Жыл бұрын
Good stuff Shawn. I was just looking at starting an upgrade process of some of our javascript to use ECMAScript modules in a web project. Perfect timing! I've been following your content for years. I'm glad I found you on KZbin! I'll have to restart my Pluralsight subscription to go watch your course now. 🙂
@swildermuth
@swildermuth Жыл бұрын
Awesome. Glad to reconnect!
@DannyHille
@DannyHille 6 ай бұрын
Hi Shawn, no need to 'use strict' in modules, all modules are treated as strict by default
@swildermuth
@swildermuth 6 ай бұрын
Exactly right, just forgot to remove it when I made it a module.
@collinsk8754
@collinsk8754 Жыл бұрын
Really interesting! Thanks. Would you need a try-catch block for the asynchronous imports?
@swildermuth
@swildermuth Жыл бұрын
Depends, likely if that fails you can't recover but if you want to catch it and re-try that's possible.
@FlippieCoetser
@FlippieCoetser Жыл бұрын
ES6 modules works a bit different in browser than node at 6:00 onwards. See importmaps to use NPM modules in browser using bare imports.
@FlippieCoetser
@FlippieCoetser Жыл бұрын
BTW, Love the coding shorts!
@swildermuth
@swildermuth Жыл бұрын
I'll take a look.
Coding Shorts: Generating Sample Data in C# (with Bogus)
23:45
Shawn Wildermuth
Рет қаралды 3,8 М.
Coding Shorts: DaisyUI
15:56
Shawn Wildermuth
Рет қаралды 1 М.
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 95 МЛН
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 8 МЛН
Дибала против вратаря Легенды
00:33
Mr. Oleynik
Рет қаралды 4,3 МЛН
Coding Shorts: C# Dialects and Idioms
19:13
Shawn Wildermuth
Рет қаралды 3,1 М.
Why You Shouldn't Mix Direct Returns with Callbacks
14:52
Senior Code Review Buddy
Рет қаралды 385
Protocol Buffers Crash Course
36:07
Hussein Nasser
Рет қаралды 236 М.
Coding Shorts: .NET Aspire - The Host
13:32
Shawn Wildermuth
Рет қаралды 2,1 М.
Coding Shorts: Running Async Jobs in ASP.NET Core
9:52
Shawn Wildermuth
Рет қаралды 3,7 М.
The Problem with Wind Energy
16:47
Real Engineering
Рет қаралды 1,1 МЛН
Coding Shorts #102: Using SQL Server Containers for Dev
11:00
Shawn Wildermuth
Рет қаралды 1,9 М.
Coding Shorts: Methods, Funcs & Actions...Oh, My!
11:02
Shawn Wildermuth
Рет қаралды 2,1 М.
Physicists Claim They Can Send Particles Into the Past
7:21
Sabine Hossenfelder
Рет қаралды 110 М.
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 39 МЛН
Ультрабюджетная игровая мышь? 💀
1:00