Repository navigation
feat: poll git state for live reload instead of watching files - #471
Open
rafaelsteil wants to merge 2 commits into
Open
rafaelsteil wants to merge 2 commits into
rafaelsteil wants to merge 2 commits into
Conversation
@parcel/watcher walked the whole tree at startup and dominated boot on large repos. Polling git is cheaper, scopes reloads by diff mode, and drops the native dependency from the CLI and VS Code extension.
git status --porcelain reports only status letters, so a file that is already dirty kept the same signal after every later edit. Hash the patch instead so the poller fires whenever the rendered diff changes.
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.
Summary
@parcel/watcherfilesystem watching with git-state polling for live reloadHEADonly, index, or worktree)@parcel/watcherwalked the whole tree at startup (globs inignoredo not prune the walk). On a large monorepo that dominated boot (~30s for the watcher alone). Polling git is cheaper, andgit rev-parse --git-dirreplaces a fullgit statusinvalidateCommitfor the same "am I in a repo?" check.Test plan
pnpm check/pnpm test/pnpm buildpassHEAD) mode: uncommitted edits do not trigger a reload; creating a commit does@parcel/watcher