fix: wire --poll flag through to chokidar in theme dev#7024
Draft
graygilmore wants to merge 1 commit intomainfrom
Draft
fix: wire --poll flag through to chokidar in theme dev#7024graygilmore wants to merge 1 commit intomainfrom
graygilmore wants to merge 1 commit intomainfrom
Conversation
The --poll flag was defined on the dev command but never passed to chokidar's usePolling option. On Linux/Windows, chokidar's fs.watch backend compares mtimeMs and suppresses change events when mtime hasn't changed. Build tools (like Gulp + Sass) that preserve the original source file's timestamp on compiled output cause chokidar to silently drop these events. This wires poll through the full chain: command -> service -> mountThemeFileSystem -> chokidar.watch. When --poll is set, both usePolling: true and useFsEvents: false are passed to chokidar. useFsEvents: false is required because on macOS chokidar prefers FSEvents over polling even when usePolling is true. Also unhides the --poll flag and improves its description to tell users when they'd want it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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/public/node/themes/types.d.ts@@ -30,6 +30,7 @@ export interface ThemeFileSystemOptions {
listing?: string;
noDelete?: boolean;
notify?: string;
+ poll?: boolean;
}
/**
* Represents a theme on the file system.
|
Contributor
Coverage report
Test suite run success3813 tests passing in 1473 suites. Report generated by 🧪jest coverage report action from d4fdcb5 |
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.
Summary
--pollflag was defined ontheme devbut never wired through to chokidar'susePollingoption, making it a no-opfs.watchbackend comparesmtimeMsand suppresses change events when the timestamp hasn't changed. Build tools (like Gulp + Sass) that preserve the original source file's timestamp on compiled output cause file change events to be silently droppedpollthrough the full chain: command → service →mountThemeFileSystem→chokidar.watch. When--pollis set, bothusePolling: trueanduseFsEvents: falseare passed to chokidar (useFsEvents: falseis required because on macOS chokidar prefers FSEvents over polling even whenusePolling: trueis set)--pollflag and improves its description to tell users when to use itRelated: https://community.shopify.dev/t/theme-dev-sometimes-misses-file-updates/29269/4
Test plan
usePolling: true+useFsEvents: falseare passed to chokidar whenpoll: trueusePollinganduseFsEventsare absent from chokidar options whenpollis not settheme-fs.test.tscontinue to passshopify theme dev --pollenables chokidar polling modeshopify theme dev --helpshows the--pollflag with improved description🤖 Generated with Claude Code