Guy Bedford
Guy Bedford
I've just implemented some basic top-level await support in SystemJS 0.21.4 so that the `system` module format output can potentially support this via the `execute` property being an async function...
@loganfsmyth that is a really great idea, I've created https://github.com/systemjs/systemjs/issues/1826 to track this further. Let's do it!
There is one issue here though, and that is that the async function approach then becomes tricky for supporting top-level await... as we have the hoisting problem for the async...
From a TDZ perspective also note that the format isn't designed to catch all invalid runtime scenarios (eg you can import named exports that don't exist). Rather it is designed...
Right, it would effectively be a wrapped and nested implementation of the entire main parser.
@CxRes can you share more details on the exact source patterns you need supported? It would be first worth assessing if this feature would really solve the problem. I am...
So this issue wouldn't solve that. That's actually multiple separate issues to get to work: 1. Supporting `module.exports = _identifier_ = {... object ...}` form 2. Supporting getters / setters...
Yes CommonJS will be around for another 10 years at least! For what it is worth, an ESM wrapper is not that hard to do / not that much maintenance,...
Perhaps you could write a script that does `Object.keys(require('fs'))` then uses that to emit the wrapper automatically so you could just update it from time to time.
Thanks @zhoukekestar it's just a lot of work to review, release, and get the backport approvals through Node.js at this point to get this update through. It would be possible...