deno_core icon indicating copy to clipboard operation
deno_core copied to clipboard

Create an `ExtensionSet` to handle logic around multiple extensions

Open mmastrac opened this issue 1 year ago • 1 comments

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 Extensions for the base snapshot.

mmastrac avatar Jul 19 '23 01:07 mmastrac

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.

nayeemrmn avatar Aug 02 '23 00:08 nayeemrmn