Devtoolers,
This post is about 'the how'. If you want to learn and ask about 'the
why', here's this previous thread:
"Devtools impact on Firefox package and performances":
https://groups.google.com/forum/#!topic/mozilla.dev.developer-tools/rUmAom_L3kc
Installing DevTools as an add-on has been recently made possible
thanks to the work done for the add-on contribution workflow [1].
With a set of simple patches [2], you can already experience DevTools
installed as an add-on:
* Install a Firefox with Devtools removed. See [3] for d/l links,
* Enjoy a slimmer Firefox where "Tools > Web developer" menu contains
only "View Source" (which is a platform feature, not a devtools one),
* Go to about:config and toggle "xpinstall.signatures.required" pref to false,
* Install add-on from link [4],
* Be relieved, the Devtools are back! Menu, key shortcuts, toolboxes, ...
These patches are about:
- Stripping Devtools from Firefox builds (everything: frontend,
backend, prefs, locales, ...),
- Fixing Firefox codepaths relying on Devtools. Two typical patterns
are: firefox trying to read a Devtools pref and throws because they
are not set. The second is firefox code using event-emitter module
which lives in devtools...
- Fixing small bugs in the DevTools add-on (install the prefs on addon
startup and fix a l10n url bug),
- Generating the DevTools add-on on Taskcluster.
What to do next if we want to move forward?
- Get these patches landed. It shouldn't be too hard. They need some
polish, but none is very complex.
- Reinsert some UI elements builtin into Firefox in order to ease
installing this
add-on.
If we strip devtools it looks like Firefox no longer has any. We still
need to reference them in the UI and make it super easy to install'n
use them.
We already have a good experience with that in WebIDE as we
auto-install ADB Helper and Valence. This would surely require a
fine-tuned and polished work involving UX thoughts.
- Figure out all the release engineering issues it raises!
For me, this is mostly a release engineering thing:
- How to build the add-on?
I imagine that's quite straithforward. I already have a Taskcluster
Task to build it. But we need some more work to get it signed.
- How to release it?
One unique Add-on for all Firefoxes? One per major version? One per
changeset? Per locale? Per experiment?
- How to keep running tests on CI?
I have multiple options here. It is mostly about mozilla-central
build system and Taskcluster tasks running DevTools tests.
The complexity depends entirely on how we plan to release it and it
isn't really specific to using add-ons as distribution channel!
We would have to answer to the same questions if we end up hosting
tools on https.
I think gofaster and test pilot teams have very valuable information
and process to share! But I'm convinced that's a reasonable goal if we
release add-ons for each Firefox release/mozilla-central changeset.
The key to simplify things here is to avoid multiple combinations.
You know this eternal story where the old guard prefer a unique repo
with a unique changeset where we can test everything with a very
precise environment.
Finally, I keep hearing about using Service Workers to release
DevTools. But we are far from being able to use that. We can only
distribute tools via https and Service Workers if our panels are able
to load without any privileges. We surely can for the new Debugger.
But this is still in progress for the Console and the Inspector. Even
the Debugger isn't ready for release. And what about everything else?
But suppose we are ready. The add-on has the advantage of stripping
more things, basically everything related to devtools (frontend,
backend, prefs, l10n, firefox integration).
And as everything ship altogether, it will also ease handling versioning.
Then, there are many advantages of packaged versus hosted. We
learned a lot about that in Firefox OS and that is why Packaged
WebApps won over Hosted ones:
* Signatures: better control of what we ship and what users receive and run,
* Performances: files are read from disk, always. Reading files from jar
is optimized. No need of caching or merging resources to reduce HTTP
requests...
* Offline: you do not have to think about offline at all.
Now you can surely address that using recent Web APIs like Service
Worker, but it requires some more work.
++
Alex
[1] Contributing on DevTools from Nightly
https://developer.mozilla.org/en-US/docs/Tools/Contributing/Contribute_on_nightly
[2] Patch queue for DevTools as Add-on experiment
https://hg.mozilla.org/try/log/81230c5331508cefef68e76cf3c86413dd4b3a85
[3] Firefox builds without DevTools
# Windows:
https://archive.mozilla.org/pub/firefox/try-builds/apo...@mozilla.com-81230c5331508cefef68e76cf3c86413dd4b3a85/try-win32/firefox-52.0a1.en-US.win32.zip
# MaxOS:
https://archive.mozilla.org/pub/firefox/try-builds/apo...@mozilla.com-81230c5331508cefef68e76cf3c86413dd4b3a85/try-macosx64/firefox-52.0a1.en-US.mac.dmg
# Linux64:
https://archive.mozilla.org/pub/firefox/try-builds/apo...@mozilla.com-81230c5331508cefef68e76cf3c86413dd4b3a85/try-linux64/firefox-52.0a1.en-US.linux-x86_64.tar.bz2
[4] DevTools as an Add-on (built from a Taskcluster Task)
https://queue.taskcluster.net/v1/task/UgBuF_jrSkOEzzpyT-pQ3A/runs/0/artifacts/public%2Fdevtools%40mozilla.org.xpi