Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: migrate to script context based host defined options #44923

Closed
wants to merge 3 commits into from

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Oct 8, 2022

This is not ready to be reviewed properly. Just a preview of the solution.

deps: v8: [runtime] Store host-defined options in the context

CR-URL: https://chromium-review.googlesource.com/c/v8/v8/+/3172764

module: migrate to script context based host defined options

This allows the host-defined options to be an arbitrary JavaScript value
so that the module/script wrapper object can be used as the host-defined
options instead. In this way, we can move away from the id-based module
tables and fixes the problem that the scripts can out lives the module
wrapper objects.

Fixes: #43681
Fixes: #43205
Fixes: #44438

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Oct 8, 2022
@SimenB
Copy link
Member

SimenB commented Oct 11, 2022

I'm beyond happy to see movement on this issue more than a year and a half after it was pointed to as a blocker of stabilization of vm ESM 🎉

@ywave620
Copy link
Contributor

Can this PR get landed before the v8 team decides to adopt your change? @legendecas

@legendecas
Copy link
Member Author

@ywave620 that's not in accord with the working process. I don't think we should land this before the v8 CL gets landed first.

@targos
Copy link
Member

targos commented Nov 8, 2022

@legendecas What's the status on the V8 side?

@legendecas
Copy link
Member Author

@targos thanks for the ping. I'll reach out to Camillo to see the next steps.

This allows the host-defined options to be an arbitrary JavaScript value
so that the module/script wrapper object can be used as the host-defined
options instead. In this way, we can move away from the id-based module
tables and fixes the problem that the scripts can out lives the module
wrapper objects.
@legendecas
Copy link
Member Author

#48510 fixed the crashes with an alternative approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
5 participants