HTTPArchive / almanac.httparchive.org

HTTP Archive's annual "State of the Web" report made by the web community

Home Page:https://almanac.httparchive.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feedback about dynamic `import()` in JS chapter

rviscomi opened this issue · comments

From the 2022 JS chapter:

A staggeringly low 0.34% of all observed mobile pages currently use dynamic import(), while 0.41% of desktop pages use it. This is a missed opportunity to ship less code during startup. Perhaps dynamic import() is not seeing much use because it shifts the loading of JavaScript on-demand for features, rather than upfront.

I got feedback that this section might be overlooking other ways of doing code splitting. Assigning to @malchata to think if we can better phrase this.

Do you have the specific feedback you can paste in here @rviscomi?

My understanding is most bundlers transpile dynamic import() into something that works in ES5 browsers, so while 0.34% is probably accurate in terms of actual feature use. I don't think it follows that most sites aren't using code splitting.

Ah, gotcha. I can work on an amendment to this.