deno_core
deno_core copied to clipboard
Create an `ExtensionSet` to handle logic around multiple extensions
There is a fair amount of logic in JsRuntime
that deals with collating the data from multiple Extensions
. We should move all of this logic to an ExtensionSet
that can be initialized from a slice of extensions.
In addition, the ExtensionSet
should be extendable to add more extensions to it at a later time. This will allow us to build a base ExtensionSet
for the snapshot, then extend it when loading further extensions (for example, for the worker and CLI).
Finally, investigate if we can or should persist the ExtensionSet
as part of the snapshot for the purpose of verifying that the correct extensions were passed in as part of snapshot init, or potentially to avoid having to re-create the set of Extension
s for the base snapshot.
For https://github.com/denoland/deno/issues/19399 I need to expand snapshot_module_load_cb
to affect non-snapshotted extensions. Rather than adding RuntimeOptions::extension_module_load_cb
I figure it would be nice in ExtensionSet
.
Edit: Went with different approach.