The library is added in devtools/client/shared/vendor, like the other third-party
libraries we use in DevTools.
This was the latest file that justified the debugger-specific vendor machinery,
so we can clean that up now.
First, we can remove the vendor.js file.
With this, this means that bin/bundle.js now only bundles the workers, using rollup,
so we can remove webpack and its associated packages from package.json, as well
as the webpack.config.js.
Finally, we can stop handling debugger vendors in build-debugger.js
Differential Revision: https://phabricator.services.mozilla.com/D193916
This is needed to handle the new Regexp `v` flag.
I'm taking this as an opportunity to fix a couple issue in the bundle script.
Differential Revision: https://phabricator.services.mozilla.com/D180675
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.
Differential Revision: https://phabricator.services.mozilla.com/D159115
For now, it was vendored by a manual run to webpack from the debugger folder (node bin/bundle.js).
Ship a more explicit bundle of it, next to all other already existing vendored files.
$ git clone [email protected]:mozilla/source-map.git
$ cd source-map/
$ git checkout 0.8.0-beta.0
$ rm -rf .git/
/!\ lib/read-wasm.js has been edited and need to be preserved/rebased /!\
$ hg/git add source-map.js LICENCE lib/
Also, hopefully temporarily vendor whatwg-url:
$ git clone [email protected]:jsdom/whatwg-url.git
$ cd whatwg-url/
$ npm install
$ npm run build
$ npm run build-live-viewer
$ cp live-viewer/whatwg-url.js ..
$ hg/git add whatwg-url.js
and also temporarily replace source-map/lib/url.js with source-map/lib/url-browser.js
And edit this file to do:
module.exports = require("devtools/client/shared/vendor/whatwg-url").URL;
Hopefully, we can remove whatwg-url dependency and remove all this.
Differential Revision: https://phabricator.services.mozilla.com/D159113
The two functions we were using, makeBundle and copyFile, were simple
enough so we could directly inline them in the script.
The task run as before, but for some reason the order of some modules
changed in the resulting bundles.
Differential Revision: https://phabricator.services.mozilla.com/D94108