Ancestors

Written by Blake Watson :prami: on 2025-01-21 at 19:03

Does anyone know what the current best practice is for using ES modules in the browser? How many is too many in terms of HTTP requests?

=> More informations about this toot | More toots from bw@social.lol

Written by Jared “Indie Social Web” White on 2025-01-21 at 19:12

@bw do you mean like buildless, locally? or pulling from an ES-friendly CDN?

If the latter, I recommend either esm.sh, or jsdelivr (ESM version).

If the former, it's more tricky to be sure. I think buildless is a bit of a pipe dream, and I always reach for esbuild, which makes it very easy to go from local node_modules to output bundles with a minimum of fuss (and it's very fast!).

=> More informations about this toot | More toots from jaredwhite@indieweb.social

Written by Blake Watson :prami: on 2025-01-21 at 19:49

@jaredwhite I’m mostly talking about first-party modules. For example, I have a project with about a dozen first-party modules and 3 not-too-big libs. If I pull all that in from my local server, is that fine, or am I (well, the person visiting) paying a performance cost?

Esbuild is nice, I agree. I’m just wondering how far I can go without a build before it’s problematic.

=> More informations about this toot | More toots from bw@social.lol

Written by Jared “Indie Social Web” White on 2025-01-21 at 19:52

@bw worth a close look at the network tab…I think anything that's in the low 100kb or less in total (uncompressed, hopefully you can serve Brotli or Gzip) is OK, but I'd try to make sure none of it is blocking — aka HTML loads in fine first and JS can init later.

=> More informations about this toot | More toots from jaredwhite@indieweb.social

Toot

Written by Blake Watson :prami: on 2025-01-21 at 19:58

@jaredwhite Yeah that’s good advice. Unfortunately in my specific case, the DOM needs to be rendered with JavaScript.

It’s an app that must work as a webpage and a browser extension. Bundling would probably speed up the web page, but it’s discouraged by extension guidelines. But I might be able to bundle only the web version.

=> More informations about this toot | More toots from bw@social.lol

Descendants

Written by Jared “Indie Social Web” White on 2025-01-21 at 20:11

@bw ah, that's an oddball I guess. Yeah, might be that you can use something like esbuild just on the web version to trim off some of the fat.

=> More informations about this toot | More toots from jaredwhite@indieweb.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113868112783218388
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
615.650521 milliseconds
Gemini-to-HTML Time
1.104614 milliseconds

This content has been proxied by September (3851b).