Convert devtools-source-map debugger package into regular devtools commonjs modules, and vendor source-map npm package more explicitly
Categories
(DevTools :: Debugger, enhancement)
Tracking
(firefox108 fixed)
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
The debugger host an inline npm "devtools-source-map" package:
https://searchfox.org/mozilla-central/source/devtools/client/debugger/packages/devtools-source-map
It introduces lots of complexify because:
- it uses webpack to craft the files hosted in https://searchfox.org/mozilla-central/source/devtools/client/shared/source-map
- this generated code in used by Toolbox, so it doesn't belong to debugger at all
- it pulls the source-map package via npm and implicitly vendor it in devtools https://searchfox.org/mozilla-central/rev/f118dae98073bc17efb8604a32abfcb7b4e05880/devtools/client/debugger/packages/devtools-source-map/package.json
- so that the sources of source-map package isn't available in tree and makes it hard to modify it
- it also implicitly vendor md5 and whatwg-url modules
- it complexify the migration to ESM because of the usage of webpack and lack of resource://devtools URI in node...
- because it has to run in nodejs, and nodejs doesn't support Web Worker, we have to pull the fork of "workerjs", which is out of tree and unmaintained. But this is used for the other workers of the debugger... We might want to convert/remove all jest tests involving workers to mochitests.
The plan here would be to:
- migrate devtools-source-map to devtools/client/shared/source-map
- stop generating any bundle code
- load the modules of this folder as-is. It means using a naive commonjs loader from the worker thread. https://searchfox.org/mozilla-central/source/toolkit/components/workerloader/require.js
- vendor explicitly md5, whatwg-url and source-map package in devtools/client/shared/vendor/ (bug 1794692)
- migrate jest tests to mochitest
- followup cleanup as this code is now gecko/mozilla-central only (i.e. no longer need to support node)
Assignee | ||
Comment 1•2 years ago
|
||
This used to be a node package. Let's make it become regular commonjs devtools modules.
This will make it trivial to migrate this to ES Modules.
Also possibly make this code become the unique layer in m-c on top of the source-map package.
We no longer use webpack to build the two bundles (index.js and worker.js),
instead, we are using the toolkit worker loader (require.js) in order to load
all this code without any build step.
As this is no longer a node package, I removed node-specific modules (assertRoot/wasmAsset)
and simplify the definition of wasm file URIs as they are now fixed.
Also moving the debugger to load internal "devtools/client/shared/source-map/source-map.js"
module in jest as running the Web Worker instantiated by source-map/index.js is too complex.
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Comment 4•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7a14bff20eae
https://hg.mozilla.org/mozilla-central/rev/0c0dc33dbc88
Description
•