-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat: ES module snapshotting #17460
feat: ES module snapshotting #17460
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe to skip handling of modules in non-global realms, would you agree @andreubotella?
I guess that depends on the use case for module snapshotting. For However, in this use case it would probably be good to make sure that any non-GC'd realms have an empty module map when snapshotting. If this PR lands before #15760 I'll make sure to add that check. |
Co-authored-by: Andreu Botella <andreu@andreubotella.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, exciting to finally land this.
This commit adds support for snapshotting ES modules. This is done by
adding an ability to serialize and deserialize a "ModuleMap" and attach it
to the snapshot, using "add_context_data" API.
This has been tested with 400 modules and seems to not have a limit on
the number of modules that might be snapshotted.