Coding Shorts: What Surprised Me About ECMAScript Modules

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 10

  • @BrianHallmanac
    @BrianHallmanac Рік тому +1

    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 UA-cam! I'll have to restart my Pluralsight subscription to go watch your course now. 🙂

  • @DannyHille
    @DannyHille 11 місяців тому +1

    Hi Shawn, no need to 'use strict' in modules, all modules are treated as strict by default

    • @swildermuth
      @swildermuth  11 місяців тому

      Exactly right, just forgot to remove it when I made it a module.

  • @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.

  • @collinsk8754
    @collinsk8754 Рік тому

    Really interesting! Thanks. Would you need a try-catch block for the asynchronous imports?

    • @swildermuth
      @swildermuth  Рік тому +1

      Depends, likely if that fails you can't recover but if you want to catch it and re-try that's possible.

  • @soneryldrm3075
    @soneryldrm3075 Рік тому +1

    Great video, thx.