ASSIGNED 212907
[GLib] Provide public API to allow customizing the module loader
https://bugs.webkit.org/show_bug.cgi?id=212907
Summary [GLib] Provide public API to allow customizing the module loader
Adrian Perez
Reported 2020-06-08 12:02:11 PDT
Currently the JS “import” statement in a bare JSCContext—as created by “jsc_context_new()”—is not usable because the GLib API layer is not providing the needed callbacks to provide module sources back to JSC. Today I was having a conversation with Carlos García and this was my proposal: <aperezdc> I think we could have a JSCContext.load-module signal which receives a JSCModuleRequest object (or similarly named), which is responsible for finding the source code for the module, and then it calls webkit_module_request_complete(request, module_source_as_gbytes) or webkit_module_request_fail(request, ...) <aperezdc> The default implementation could be “always fail for a bare JSCContext, and use WebKit's default module loader for a JSCContext associated with a WebView” <aperezdc> (actually, I am not completely sure that we want to allow configuring/overriding how module loading for a web view — maybe we just want to support it only for bare JSCContext instances) This bug is to try and implement something among the lines described above, and see whether the API feels ”right” :)
Attachments
Note You need to log in before you can comment on or make changes to this bug.