Make JsPropertyProvider work the same for regular and Worker context
Categories
(DevTools :: Console, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: nchevobbe, Unassigned)
References
Details
| Reporter | ||
Comment 1•6 years ago
|
||
ChromeUtils was made available in worker context in Bug 1533202, which is awesome and might help us here.
Unfortunately, we cant fix this bug yet, because lazyImporter throws in devtools/shared/worker/loader.js#419-421.
I guess it's because ChromeUtils wasn't available, since the function used in "regular" context use it devtools/shared/builtin-modules.js#141-189.
Brian, do you know if there is any other blockers to load jsm files in worker context?
Comment 2•6 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)
Brian, do you know if there is any other blockers to load jsm files in worker context?
Sorry, I don't have enough familiarity with the module loading code to say either way. What API is used to load JSMs on the main thread?
Comment 3•6 years ago
|
||
mozJSComponentLoader is the thing that deals with loading JSMs. kmag might have a better sense of what would be needed to use them on workers, but off hand it seems like it would be a fair amount of work, because there's a lot of XPConnect stuff involved.
Comment 4•6 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #3)
kmag might have a better sense of what would be needed to use them on workers, but off hand it seems like it would be a fair amount of work, because there's a lot of XPConnect stuff involved.
This is pretty much a non-starter. Just about every part of the component loader relies on having a single instance running on the main thread. We'd need an entirely separate implementation for worker threads, and I'm not even really sure what it would look like.
At that point, it would make more sense to put the work into getting an ES6 module loader working on worker threads, and converting JSMs to ES6-module-like semantics.
| Reporter | ||
Comment 5•6 years ago
|
||
Thanks for the info all
| Reporter | ||
Comment 6•6 years ago
|
||
Maybe Bug 1568823 will help us here, as we may turn the file into regular js
Updated•3 years ago
|
Description
•