Repository navigation
Share replay watch logic and fix watcher startup - #9108
Draft
isaacroldan wants to merge 1 commit into
Draft
isaacroldan wants to merge 1 commit into
isaacroldan wants to merge 1 commit into
Conversation
1 of 4 tasks
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/private/node/dev-instance-output.d.ts@@ -2,18 +2,18 @@ import { zod } from '../../public/node/schema.js';
import { Writable, type WritableOptions } from 'stream';
export declare const devInstanceLogOutputSchema: import("../../public/node/json-output-schema.js").JsonOutputSchema<zod.ZodObject<{
timestamp: zod.ZodString;
- source: zod.ZodOptional<zod.ZodString>;
+ source: zod.ZodString;
level: zod.ZodOptional<zod.ZodEnum<["debug", "info", "warning", "error"]>>;
message: zod.ZodString;
}, "strict", zod.ZodTypeAny, {
+ source: string;
message: string;
timestamp: string;
- source?: string | undefined;
level?: "info" | "error" | "debug" | "warning" | undefined;
}, {
+ source: string;
message: string;
timestamp: string;
- source?: string | undefined;
level?: "info" | "error" | "debug" | "warning" | undefined;
}>>;
/** One line of a dev instance's JSON Lines log. */
@@ -30,7 +30,7 @@ export declare function createDevInstanceOutput({ logFile, logOutput, isActive,
timestamp?: string;
}) => Promise<void>;
tee: (target: Writable, { source, stringWritesAreMessages }: {
- source?: string;
+ source: string;
stringWritesAreMessages?: boolean;
}) => DevInstanceOutput;
flush: () => Promise<PromiseSettledResult<void>[]>;
packages/cli-kit/dist/private/node/output-context.d.ts@@ -2,8 +2,6 @@ export interface ConcurrentOutputContext {
outputPrefix?: string;
/** Controls ANSI stripping for terminal output. JSON diagnostics are always unstyled. */
stripAnsi?: boolean;
- /** Captures console messages before the terminal renderer handles them. */
- consoleWarn?: (message: string) => void;
}
export declare function useConcurrentOutputContext<T>(context: ConcurrentOutputContext, callback: () => T): T;
/** Returns the source and styling context for the current output write. */
packages/cli-kit/dist/public/node/dev-instance.d.ts@@ -80,8 +80,7 @@ export interface DevInstance {
* The returned stream forwards the original bytes to `target` unchanged.
*/
tee: (target: Writable, options: {
- /** Omit the source field when the stream does not need to distinguish producers. */
- source?: string;
+ source: string;
/** Treat each string write as a complete message. Byte writes remain buffered into lines. */
stringWritesAreMessages?: boolean;
}) => Writable;
packages/cli-kit/dist/public/node/upgrade.d.ts@@ -5,11 +5,9 @@ export { getAutoUpgradeEnabled, setAutoUpgradeEnabled };
* Utility function for generating an install command for the user to run
* to install an updated version of Shopify CLI.
*
- * @param version - The version or dist-tag to install. Homebrew can't
- * install a specific version, so it always upgrades to the formula's current version.
* @returns A string with the command to run, or undefined if the package manager cannot be determined.
*/
-export declare function cliInstallCommand(version: string): string | undefined;
+export declare function cliInstallCommand(): string | undefined;
/**
* Options for {@link runCLIUpgrade}.
*/
@@ -21,13 +19,6 @@ export interface RunCLIUpgradeOptions {
* their `package.json` / lockfile in the background.
*/
autoupgrade?: boolean;
- /**
- * The exact version to install. The auto-upgrade hook passes the version it already
- * vetted, such as one that isn't a major version change, so the install can't drift to
- * whatever `latest` points at by the time the package manager runs. When omitted, the
- * CLI installs `latest`.
- */
- version?: string;
}
/**
* Runs the CLI upgrade using the appropriate package manager.
packages/cli-kit/dist/private/node/api/status-checks.d.ts@@ -2,6 +2,6 @@
* Checks whether an HTTP status indicates a gateway-level failure.
*
* @param status - The HTTP status to check.
- * @returns Whether the status is 502, 503, 504, or a Cloudflare edge error from 520 to 524.
+ * @returns Whether the status is 502, 503, or 504.
*/
export declare function isGatewayErrorStatus(status: number | undefined): boolean;
\ No newline at end of file
|
1 of 4 tasks
isaacroldan
force-pushed
the
codex/function-replay-shared-watch
branch
from
November 9, 2026 14:49
a21fc33 to
7a563b8
Compare
isaacroldan
force-pushed
the
codex/function-replay-shared-watch
branch
from
November 9, 2026 17:13
7a563b8 to
76ad225
Compare
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?
Text Function replay has its own watch loop, and shared watcher startup can report readiness before the initial scan or a startup rebuild finishes. A rebuild failure during that scan can also be hidden by an older successful build result.
WHAT is this pull request doing?
Use the replay loop introduced by #9056 for both text and JSON presentation. Keep text input, output, logs, and instruction statistics, continue after recoverable failures, and stop the UI on fatal runner failures.
Enable scan readiness and command context retention by default for the shared watcher. Wait for pending startup file events and include their latest extension build results before emitting
ready. Cancellation during startup prevents dev preview upload. Preserve the explicit readiness opt-out.This follow-up contains the text UI refactor, generic watcher readiness and startup state machinery, and raw replay loop tests extracted from #9056. #9056 remains independently mergeable. Active process and build shutdown changes stay in #9057, which follows this PR.
How to manually test your changes?
Use a test app with a Function and a saved Function log.
pnpm shopify app function replay --path <function-directory> --log <log-id>.qto quit. Repeat with--json --no-inputto check that the JSON records retain their contract.pnpm shopify app dev --path <app-directory>in a test app with many watched files. Edit an extension during startup. Check that preview startup uses the latest completed build result.Validation
Checklist