Skip to content

Extract custom watch paths to specifications#7220

Draft
isaacroldan wants to merge 2 commits into04-08-use_extension_handle_to_identify_extensions_in_file-watcherfrom
04-08-extract_custom_watch_paths_to_specifications
Draft

Extract custom watch paths to specifications#7220
isaacroldan wants to merge 2 commits into04-08-use_extension_handle_to_identify_extensions_in_file-watcherfrom
04-08-extract_custom_watch_paths_to_specifications

Conversation

@isaacroldan
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan commented Apr 8, 2026

WHY are these changes introduced?

The current file watching system for dev sessions uses a hardcoded approach where function extensions have custom watch paths while other extensions watch everything. This creates inconsistent behavior and makes it difficult for different extension types to define their own watching requirements.

WHAT is this pull request doing?

Refactors the dev session file watching system to use a specification-based approach:

  • Replaces devSessionCustomWatchPaths with a new devSessionWatchConfig method on extension specifications
  • Introduces a DevSessionWatchConfig interface that allows extensions to define both paths to watch and patterns to ignore
  • Moves function-specific watch logic from the base ExtensionInstance class to the function specification
  • Adds watch configuration for admin extensions that only watches the static_root directory when configured
  • Sets default behavior where 'configuration' experience extensions watch nothing and 'extension' experience extensions watch everything
  • Moves default ignore patterns from the file watcher service to the extension instance level

How to test your changes?

  1. Create a function extension with custom build.watch configuration and verify it only watches the specified paths plus default files (locales, GraphQL, TOML)
  2. Create an admin extension with static_root configured and verify it only watches files in that directory
  3. Create other extension types and verify they follow the default watching behavior based on their experience type
  4. Run dev sessions and confirm file changes trigger rebuilds appropriately for each extension type

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, so I've added a changelog entry with pnpm changeset add

Copy link
Copy Markdown
Contributor Author

isaacroldan commented Apr 8, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@isaacroldan isaacroldan force-pushed the 04-08-extract_custom_watch_paths_to_specifications branch 3 times, most recently from 0748fb6 to 756d842 Compare April 8, 2026 15:56
@isaacroldan isaacroldan changed the base branch from main to graphite-base/7220 April 8, 2026 16:19
@isaacroldan isaacroldan force-pushed the 04-08-extract_custom_watch_paths_to_specifications branch from 756d842 to d70b812 Compare April 8, 2026 16:19
@isaacroldan isaacroldan changed the base branch from graphite-base/7220 to 04-08-use_extension_handle_to_identify_extensions_in_file-watcher April 8, 2026 16:19
@isaacroldan isaacroldan force-pushed the 04-08-extract_custom_watch_paths_to_specifications branch from d70b812 to dbe5497 Compare April 8, 2026 16:49
@isaacroldan isaacroldan changed the base branch from 04-08-use_extension_handle_to_identify_extensions_in_file-watcher to graphite-base/7220 April 8, 2026 16:53
@isaacroldan isaacroldan force-pushed the 04-08-extract_custom_watch_paths_to_specifications branch from dbe5497 to d33c06d Compare April 8, 2026 17:12
isaacroldan and others added 2 commits April 9, 2026 12:25
Co-authored-by: Claude Code <claude-code@anthropic.com>
…onWatchConfig

Co-authored-by: Claude Code <claude-code@anthropic.com>
@isaacroldan isaacroldan force-pushed the 04-08-extract_custom_watch_paths_to_specifications branch from d33c06d to 1e0e9ea Compare April 9, 2026 10:25
@isaacroldan isaacroldan changed the base branch from graphite-base/7220 to 04-08-use_extension_handle_to_identify_extensions_in_file-watcher April 9, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant