mastodon.ar.al is one of the many independent Mastodon servers you can use to participate in the fediverse.
This is my personal fediverse server.

Administered by:

Server stats:

1
active users

@aral I'm mostly clueless about ESM, but do previous version of the dataset (with a different ?update= date) hang around in some kind of cache, or is ESM smarter about that?

I see you can explicitly delete the cache entry in CommonJS, but I'm wondering whether ESM supports anything like that. (Although I guess with your 227 MB dataset, memory leaks would be pretty apparent.)

@kristof@pleroma.marussy.com Good question. I don’t know. But I’ll look into it. (Thanks) :)

@aral This is a neat technique, but doesn't it potentially introduce a memory leak compared to the `delete require.cache` approach? I imagine Node is still caching the old versions of the module and they're never deleted. Probably a very tiny leak, but could matter if the module size is large and the cache is frequently busted.

BTW love your posts on ESM! I learn a lot reading these. 🙂

@nolan I’m actually look into that right now and, yeah, it doesn’t look good.

@aral That's really disappointing. It seems like something that should be solved at the spec level, since you might want to clear the cache in both Node and the browser.

@nolan @aral yeah the TL;DR seems to be (based on the conversation in twitter.com/davidmarkclem/stat) is that a large chunk of (/almost all?) use cases seem to be around hot module replacement, and solving that issue specifically can solve the leakage without having to expose the cache.

TwitterDavid Mark Clements on TwitterBy David Mark Clements

@aral this is super funny as I was researching this exact issue and was writing up a response here, for updating 11ty (a static site generator) to work with ESM :))
github.com/11ty/eleventy/issue

This is an excellent reference, thank you for writing it up and now I can safely delete half of my work-in-progress comment 😂

github.comModify Eleventy to work with ECMAScript Modules (ESM) by default · Issue #836 · 11ty/eleventyNode 13 projects can switch to ECMAScript Modules using "type": "module" in package.json, using .mjs files, or --input-type https://nodejs.org/docs/latest-v13.x/api/esm.html#esm...

@flakoot w00t! Very happy to hear it helped (and my condolences for your half comment. May it live forever happy in half-comment heaven).

@aral also fyi there's a follow-up conversation on the birdsite about this problem space that you might be interested in! twitter.com/slsoftworks/status

Twitterflaki on TwitterBy flaki