Repository navigation
Add JSON streaming to Function replay watch mode - #9056
Draft
isaacroldan wants to merge 3 commits into
Draft
isaacroldan wants to merge 3 commits into
isaacroldan wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Function replay watches by default, but rejects
--jsonunless--no-watchis set.WHAT is this pull request doing?
Add typed JSONL records for watch status, rebuilds, and Function results. Keep diagnostics on stderr and preserve native runner fields and numeric tokens. Keep the finite JSON result and existing text presentation.
Use one replay loop for watching files, running the Function, and handling rebuilds. The JSON writer and React hook consume its events instead of maintaining separate watch logic.
Wait for the file watcher's initial scan before reporting
watching, so an immediate edit is not missed.This is the JSON portion of #9007, which remains unchanged. Shared build and process shutdown behavior stays unchanged here; the second PR in this stack adds those fixes.
How to manually test your changes?
Use an app with a Function and a saved Function log.
pnpm shopify app function replay --path <function-directory> --log <log-id> --json --no-input > replay.jsonl 2> replay.stderr.cancelledrecord and exit code 130.--json. Check the input, output, logs, and instruction statistics. Repeat the build error and recovery steps, then pressqto quit.--no-watch --json. Check that stdout contains one native runner result, not a watch record.pnpm shopify app function replay --json-schema. Check that it describes both finite results and watch records without starting replay.Validation
watching, execution ordering, updated extensions, callback cancellation, and React effect cleanup.qshortcut.--version.Checklist