You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
Update 5/11/2018: The Dynamic Modules implementation is now complete in v8, pending further review (at https://chromium-review.googlesource.com/c/v8/v8/+/1303725). This means we can have named exports in transparent interop of ESM from CJS
As you know, I've been pushing a Dynamic Modules specification for ensuring named exports on CommonJS while retaining a correct execution order in transparent initerop. This spec has been carefully worked out at https://github.com/guybedford/proposal-dynamic-modules.
While transparent interop remains a possibility, I believe this specification and work is important to follow so we can provide the best experience to users.
Initially this was created as a Stage 1 TC39 proposal, but it turns out the model is better served by having a Node-specific module record specification implemented in V8, just like Web Assembly will be its own module specification outside of TC39.
This way only a few ECMA262 specification changes are needed to support dynamic modules - tc39/ecma262#1306.
This PR was discussed at the latest TC39 meeting, and it was determined that it should only land following implementation work / feedback.
Work with v8 to get an implementation together. I will be blocking off a full week or two as needed here to do the C++ work myself in the coming month, if anyone else is able to assist with this please let me know - it would be great to pair on the work.
With implementation feedback from v8, get the spec changes merged back into ECMA262.
While this work all rests on a hypothetical, I hope we can all appreciate it is an important consideration on that hypothetical, and should be pushed regardless.
Nice work! I played around with the test case to try some more module graphs (e.g. multiple imports of the same dynamic import) and it worked without a hitch. :)
(There's a single else on its own line in api.cc but I think the V8 code formatter should be able to take care of that..?)
@jkrems awesome to hear it didn't immediately break :)
@devsnek that would be great - feel free to leave feedback at the repo there in the mean time, as it will probably take me a few more days yet to get to items 1 - 3.
Further update on dynamic modules - the implementation at guybedford/v8@master...guybedford:dynamic-modules is now fully spec-complete, and just needs some refactoring work on the data structure and module class side.
@devsnek you mentioned you had some ideas for how to handle the script metadata part of dynamic modules - would value your thoughts on that as I'm starting work on that now.
Activity
devsnek commentedon Sep 28, 2018
i'd be happy to help with the v8 impl.
hybrist commentedon Oct 3, 2018
I've done some work on
import.metain V8 in the past. Happy to help!guybedford commentedon Oct 3, 2018
Thanks @jkrems, whats the best way to reach you to discuss the details further?
hybrist commentedon Oct 3, 2018
Most likely email or GChat (jan.krems@groupon.com) or Twitter DM (@jankrems). The former definitely is the more reliable way of reaching me quickly.
guybedford commentedon Oct 3, 2018
@jkrems ok I believe I've sent you an invite there, but let me know if you don't see it.
hybrist commentedon Oct 3, 2018
I'm not seeing an invite (including in my spam). Just in case you can also try my personal email (jan.krems@gmail.com).
hybrist commentedon Oct 3, 2018
Let me know if there's any communication method you'd prefer in case this doesn't work out. :)
guybedford commentedon Oct 15, 2018
To further update on the spec and implementation here:
The API can be seen in the test case here using HostExecuteDynamicModuleCallback and module->SetExport.
The following implementation steps are pending:
@jkrems @devsnek thanks both of you for feedback so far, do try it out again if you can!
hybrist commentedon Oct 15, 2018
Nice work! I played around with the test case to try some more module graphs (e.g. multiple imports of the same dynamic import) and it worked without a hitch. :)
(There's a single
elseon its own line inapi.ccbut I think the V8 code formatter should be able to take care of that..?)devsnek commentedon Oct 15, 2018
@guybedford nice work! i have some feedback on the v8 internals that i can put up once you have a CL.
guybedford commentedon Oct 15, 2018
@jkrems awesome to hear it didn't immediately break :)
@devsnek that would be great - feel free to leave feedback at the repo there in the mean time, as it will probably take me a few more days yet to get to items 1 - 3.
guybedford commentedon Oct 27, 2018
Further update on dynamic modules - the implementation at guybedford/v8@master...guybedford:dynamic-modules is now fully spec-complete, and just needs some refactoring work on the data structure and module class side.
@devsnek you mentioned you had some ideas for how to handle the
scriptmetadata part of dynamic modules - would value your thoughts on that as I'm starting work on that now.guybedford commentedon Oct 27, 2018
PR for review at guybedford/v8#2. Comments welcome.
[-]Update on Dynamic Modules[/-][+]Dynamic Modules Status[/+]guybedford commentedon Nov 5, 2018
The implementation of dynamic modules was finally completed to spec (and the spec worked out as written). Review at https://chromium-review.googlesource.com/c/v8/v8/+/1303725.
MylesBorins commentedon Dec 4, 2018
I'd like us to discuss this one more time in tomorrow's meeting and ensure we have explicit consensus from our group that we want this moving forward.
guybedford commentedon Dec 4, 2018
Sure, I'd be happy to provide an update here on how last week's TC39 went.
guybedford commentedon Dec 7, 2018
As per the meeting, I've posted a Node.js issue with a status update at nodejs/node#24894.