Conversation
|
What does this fix? Can you provide example code on replit/runkit that fails before and passes now? It seems to me like you are not changing anything minus deleting the .mjs wrapper. There is no difference in JS doing module.exports = v
v.Vec3 = Vec3and module.exports = v
module.exports.Vec3 = Vec3as they are both objects pointing to the same thing. |
|
In fact there is. I can't find the blog post that said this, but I tested this on my own machine and this lets |
|
Please provide an example on repit/runkit or similar tool that demonstrate what changes. This doesn't seem right to me. |
Screencast.from.2023-02-23.09-21-14.webm |
|
I looked into the source code and see that this interop was a recent change to Node.js, merged in 2020. Seems like a giant hack to me, but worthwhile for the sake of compatibility. Naturally there is a large percent of modules that wouldn't work with this compatibility feature. nodejs/node#35249 As written there by @guybedford :
So seems to me there is no reason to merge this to make it work with that compat hack given the current master that already has a proper module wrapper. |
No description provided.