Skip to content

Exclude build output and temporary files from app dev watchers - #8993

Merged
isaacroldan merged 3 commits into
mainfrom
codex/app-dev-watcher-static-ignores
Oct 23, 2026
Merged

isaacroldan merged 3 commits into
mainfrom
codex/app-dev-watcher-static-ignores

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Related to https://community.shopify.dev/t/high-cpu-due-to-file-watcher-for-app-dev-command/38774/4

app dev traverses Cargo build output, Function output directories, and CLI temporary files before it filters file events. This creates unnecessary file watchers and polling work.

WHAT is this pull request doing?

Exclude complete Cargo target directories when their parent contains Cargo.toml, Function output directories, .shopify files, Finder metadata, and editor temporary files before Chokidar traverses them. Other source and imported files in target, dist, and generated remain watched.

Refresh Function output rules when the app reloads, without restarting the watcher. Real-watcher tests use bounded readiness checks and guaranteed cleanup.

Validation: 51 app-event tests, a separate polling-mode probe, app type checking, and changed-file lint passed. The reload regression fails with the old matcher.

How to manually test your changes?

  1. Run pnpm shopify app dev --path <app> for an app with a Rust Function and a UI extension. Edit Rust source and confirm that the Function rebuilds.
  2. Run a Cargo build in another terminal and check watcher CPU use while build output changes.
  3. While the dev session runs, generate another Function with pnpm shopify app generate extension --path <app>. Edit its source and confirm that it builds.
  4. Import a UI module from a shared target/release, dist, or generated directory outside the extension. Edit that module and confirm that the extension rebuilds.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

Limit Cargo output ignores to Rust function roots so source files and imports under similarly named paths remain watched.

Co-authored-by: River <river@shopify.com>
@isaacroldan
isaacroldan requested a review from a team as a code owner October 23, 2026 09:15
@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Oct 23, 2026
@gonzaloriestra

Copy link
Copy Markdown
Contributor

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Built from bdb2926fbceda04fb278c9656c7b23e79486a683. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261023095012

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra gonzaloriestra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tophatted and confirmed that it fixes the original issue 👌

@isaacroldan
isaacroldan added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit fa5b4a3 Oct 23, 2026
49 of 53 checks passed
@isaacroldan
isaacroldan deleted the codex/app-dev-watcher-static-ignores branch October 23, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants