[ann] |mach watch| -- Incremental front-end builds with filesystem watching

56 views
Skip to first unread message

Nicholas Alexander

unread,
Feb 11, 2018, 10:43:56 PM2/11/18
to Firefox Dev
Hello Firefox front-end developers!

Long before Austin, Brian Grinstead and I did some work on improving the Firefox front-end developer workflow.  We started with a lightweight filesystem watcher called |mach watch| to incrementally run |mach build faster|.

The first bits of that work landed [1] [2] but there were some issues around purging startup caches [3] [4] that prevented us publicizing it widely.  I think I've addressed those issues now, so we're ready for wider usage!

Bare-bones instructions are at


Basically, run |mach watch| in one terminal, run |mach run| in another, and use the Quick Restart hot-key to test your editor changes quickly.

I'm currently working on incorporating |mach watch| into |mach run| and adding a Web Socket server to |mach watch| [5].  That will let us immediately refresh browser CSS in a running browser, and also allow us to reload in-content pages like about: pages.  This functionality will mimic the webpack watcher (but does not use any of the same implementation, sadly).

After that, the sky is the limit: anything you might like to do with a bidirectional communication channel between the build system and development environment, and the browser under development, could be possible.

Thanks to Brian for browser integration, and to Dave Townsend and Myk Melez for helpful conversations; to many in the Firefox front-end team and devtools team for early feedback; and to Greg Szorc for reviewing build system patches.

Best,
Nick

Matthew N.

unread,
Feb 12, 2018, 1:00:46 AM2/12/18
to Nicholas Alexander, Firefox Dev
Hey Nick, this will be especially useful on Windows where symlinks aren't used in the obj. dir. (IIUC)!

The MDN page says that this requires an artifact build. What's the technical reason for that and are were considering making it work for changes supported by `mach build faster` in non-artifact builds?

Cheers,
Matthew N. (:MattN)

_______________________________________________
firefox-dev mailing list
firef...@mozilla.org
https://mail.mozilla.org/listinfo/firefox-dev


Nihanth Subramanya

unread,
Feb 12, 2018, 11:37:55 AM2/12/18
to Nicholas Alexander, firefox-dev
This is *awesome*, thanks for your work!

Nicholas Alexander

unread,
Feb 13, 2018, 11:53:19 AM2/13/18
to Matthew N., Firefox Dev
Hi MattN,

On Sun, Feb 11, 2018 at 10:00 PM, Matthew N. <Ma...@mozilla.com> wrote: 
Hey Nick, this will be especially useful on Windows where symlinks aren't used in the obj. dir. (IIUC)!

Correct!

The MDN page says that this requires an artifact build. What's the technical reason for that and are were considering making it work for changes supported by `mach build faster` in non-artifact builds?

There is no technical reason for this; it was just done to prevent some confusion.  My concern is that it can be difficult to know that you need a |mach build faster| already in artifact builds, and even harder to know that you need a |mach build| in non-artifact builds.  I was considering making it |mach watch faster| so that it would make sense in the future to |mach watch| (everything).

If it would be helpful to use this for non-artifact builds, we can easily unlock that.

Best,
Nick

Brian Grinstead

unread,
Feb 13, 2018, 12:29:12 PM2/13/18
to Nicholas Alexander, Matthew N., Firefox Dev
FWIW this is the second request we’ve had to support non-artifact builds (see also Bug 1437712).

Brian Grinstead

unread,
Feb 13, 2018, 12:30:48 PM2/13/18
to Nicholas Alexander, Matthew N., Firefox Dev
Correction: Bug 1391106.
Reply all
Reply to author
Forward
0 new messages