build icon indicating copy to clipboard operation
build copied to clipboard

Update build and serve APIs to make use of package:build_daemon

Open natebosch opened this issue 8 years ago • 8 comments

natebosch avatar Aug 09 '17 18:08 natebosch

For now this is probably enough, but we need to come up with a design for the testing story as well, and that will require running a separate test command most likely while a regular build/serve are happening?

jakemac53 avatar Aug 10 '17 15:08 jakemac53

Yeah I think eventually we'll want to make them cooperate across processes somehow

natebosch avatar Aug 10 '17 15:08 natebosch

A simple mechanism could be a build.lock-file for now, no?

matanlurey avatar Oct 16 '17 05:10 matanlurey

yes for now something like that would be an improvement

jakemac53 avatar Oct 16 '17 13:10 jakemac53

Moving to M1, you have to be a bit careful about how you use watch/serve together with test today (among other scenarios) but solving this properly is going to take some work.

jakemac53 avatar Jan 10 '18 20:01 jakemac53

@jakemac53 can you elaborate on what you mean by

a bit careful about how you use watch/serve together with test today

What I'm seeing right now (and the core team that works on https://github.com/Workiva/over_react are trying to figure out) is... is it actually possible to be serving, lets say - the example/ dir, and then run tests via pub run build_runner test simultaneously - without first stopping the serving of the example dir - without destroying the asset graph?

Any guidance / current workarounds would be very appreciated and welcome.

cc/ @robbecker-wf @evanweible-wf @corwinsheahan-wf @greglittlefield-wf

aaronlademann-wf avatar Feb 07 '19 19:02 aaronlademann-wf

@aaronlademann-wf right now the only safe thing to do is kill the other server before running tests - which is obviously not a great solution.

However, @grouma has been actively working on the build_daemon which solves this problem (there is already a daemon command actually, and you can use the build_daemon package to create a client if you want to play with it). It is already integrated into the webdev package at HEAD, but is still a little ways off from being released as we are actively working through all the edge cases. We will integrate it with the built-in build_runner commands once it is ready for prime time as well.

This is a fairly fundamental change and there will be some restrictions - for instance you won't be able to provide different build flags from different clients (it will ask you to kill the existing server in that case before running tests).

jakemac53 avatar Feb 07 '19 20:02 jakemac53

Assigning Gary as he has been the one working on this, I forgot we actually had an issue filed :).

jakemac53 avatar Feb 07 '19 20:02 jakemac53