Wesley Wigham
Wesley Wigham
@jkrems I'm talking about how If I have ```js // @filename: root.js import {thing} from "./setUpThing.js"; import "some-library"; import {consume} from "./consumeThing.js"; consume(thing); // @filename: setUpThing.js export let thing =...
> Which means that code like this is no longer safe: TLA does the _same_ for esm. That's the tradeoff TLA makes: ```js const x = fs.createReadStream('./x'); await import('./foo'); //...
The moral here is that using TLA is observable by people who require/import you, as it yields back to the event loop. That's really it. That's true in `esm`, so...
As I demonstrated [`here`](https://github.com/nodejs/modules/issues/454#issuecomment-564235707), you do not need an `await` in any code _you control_ to witness the change.
`Atomics.wait` also exists and blocks... This isn't even the only function that can do that.
And the _overwhelmingly common_ case is that no event loop turns happen _at all_. It's only if they're _required_ (because a module requires asynchronous execution) that it occurs.
I've opened https://github.com/nodejs/node/pull/30891 so people more familiar with how `node`'s testing infrastructure and stuff is set up can help.
> There could be future investigations with things like the debugger protocol are likely what I'd recommend but cannot provide a path forward on how to do this currently. The...
>Early on we ruled out require of ESM, though I don’t remember why. Was it because we assumed it just wouldn’t be possible technically? Is there a spec concern with...
> Or looked at another way, my package’s CommonJS exports and ESM exports are different You have two different API surfaces. Ship two different packages. > A user whose project...