Repository navigation
Add typed JSON output to hydrogen build --watch - #4256
gonzaloriestra merged 1 commit into
Conversation
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
157138a to
6833438
Compare
6833438 to
0d29b8e
Compare
0d29b8e to
bb116d2
Compare
bb116d2 to
8aeaa68
Compare
fredericoo
left a comment
There was a problem hiding this comment.
thank u so much, this is great! gotta do a few fixes but overall it's near done! lmk when you change it so we merge it asap
8aeaa68 to
ddf9db1
Compare
ddf9db1 to
9560e39
Compare
fredericoo
left a comment
There was a problem hiding this comment.
thanks for turning these around so quickly! the trigger dedupe and the JSON-only comment are sorted, but the cycle: 4 flake still reproduces and the slimmed-down unit test lost the normal-stop cleanup checks - details inline
9560e39 to
ede9303
Compare
fredericoo
left a comment
There was a problem hiding this comment.
all sorted, thanks! looped the build suite 40 times (plus 20 under CPU load) with no flakes, and the new normal-stop test catches each cleanup line being removed. LGTM
one thing for a follow-up: a doubled fs event still gives JSON consumers an extra build-started/build-failed pair, so skipping client cycles with no changes would be worth doing at some point
ede9303 to
0f5b5fc
Compare
WHY are these changes introduced?
Fixes https://github.com/shop/issues-develop/issues/24323.
Agents need structured rebuild results and errors while production build watchers keep running.
build --jsoncurrently rejects--watch.WHAT is this pull request doing?
Add typed JSONL records for watch startup, build cycles, output paths, recoverable compilation errors, and shutdown. Coordinate client and server watchers with a temporary trigger so client-only edits, including plugin-managed inputs, complete their JSON cycles. Ignore repeated trigger notifications for an already-consumed client build when reporting cycles and invoking server callbacks.
Close both Vite watchers on cancellation and clean up the client watcher and trigger if server setup fails. Keep finite JSON results and text presentation intact, refresh schema help and the manifest, and add a minor changeset.
HOW to test your changes?
In a Hydrogen 2026-04 project, run
shopify hydrogen build --watch --json > /tmp/hydrogen-build.jsonl 2> /tmp/hydrogen-build.log. Change a server source file, introduce a syntax error, then fix it. Check that failures are followed by successful rebuild records with existing artifact paths. Edit a client-only entry or a file watched by a client plugin and verify another completed cycle. Press Ctrl-C and verifywatch-stoppedand exit 130. Compare text watch output and finitebuild --json; inspectbuild --json-schema.Checklist