During a perf audit for a client, I read this in a PR: "The module should only be loaded once, not every time a file is selected." When I read it, something didn't add up, so I started digging. And the result surprised me. I wrote a post joanleon.dev/en/dynamic-i... #JS #WebPerf
joanleon.devDynamic import(): the browser already caches our modules | Joan LeónCalling import() every time a feature is used doesn't download or evaluate the module again: the browser reuses it from its module map. What it guarantees, when the same module stops being the same, a...
1 repost4 likes