| 03:18 | <Jack Works> | What’s this? Looks like the future. Install @jackworks/typescript@4.8.0-dev.20220802-2 (do not open source map, it will crash) |
| 03:19 | <Kris Kowal> | I see. You’re hacking TS :-) |
| 03:29 | <Jack Works> | I also could buy import x from 'y' as module, but that doesn’t address the “what’s a module? i thought module was a synecdoche of module exports namespace exotic objects.” import x from 'y' as uninitialized |
| 03:31 | <Kris Kowal> | I dislike uninitialized because:
import x from 'y';
import x as xModule from 'y' as uninitialized; // <- actually initialized
|
| 16:23 | <yulia> | Good morning, all. I wanted to reiterate a bit on what I said in plenary and also afterwards direct to Kris last week.
The layered modules APIs that Kris presented are great at permitting a bunch of use-cases. In particular I like the idea of using them for achieving mocking in a test runner (avoiding the need for code to use DI patterns or custom host hooks).
The bigger win (value proposition) is if we can identify features that will allow the wider ecosystem to adopt ES modules. npm & Node mostly ship and execute CommonJS. No one has provided a compelling or easy migration story. So we have a situation that may even be worse than the Python 2/3 switchover.
A key specific use-case that CJS still beats ESM on is the ability to ergonomically/quickly achieve fast load times via lazy loading. Meaning the Babel option "lazy" on the ESM->CJS transform that injects conditional synchronous requires to defer loading static imports to instead be just-in-time.
ESM has no ergonomic way to achieve this. Instead users are forced to rewrite their app to become async and use dynamic `import() `. Because switching sync->async functions have ripple effects back to the caller.
Originally Yulia's defer-eval proposal looked like it might solve this problem. But I understand the sync part of that proposal is now under debate.
My purpose in conveying this is not to demand sync loading. It is to highlight that, if you can make migration from CJS to ESM easier, then (1) the community/ecosystem will love you and see the value of your work, and (2) it will be easier to fund this work stream. Sorry I am really late on this. I want to call out this part of this:
Originally Yulia's defer-eval proposal looked like it might solve this problem. But I understand the sync part of that proposal is now under debate.
I would need to clarify what "sync" means here, but i would say that the proposal is still very much in its original form and goal. The goal is described here: https://docs.google.com/presentation/d/17NsxHzAC2RlP5rB3wrns9O2Z-NduSpcm2_GOVo2TnKE/edit#slide=id.p -- I think it may be worthwhile to go over this proposal with the group again, and talk a bit more about the alternative (that I presented back in 2021, and recently got more feedback on) in light of the discussion in this group
|
| 16:26 | <yulia> | I don't think this conflicts much with what we are discussion which is why I haven't been bringing it up. It can benefit from the adjustments that are made by the core proposal. |
| 16:26 | <yulia> | So, I haven't dropped it, in case anyone was wondering |
| 19:12 | <littledan> | Yeah, I like the idea of going through this proposal with the group again when you have the chance |