Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(watcher): ignore events in .git directory #9556

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

frandiox
Copy link
Contributor

It looks like files under .git/** are tracked by @parcel/watcher when calling generate({..., watch: true}).
This PR adds a small change to ignore the well-known .git directory by default.

For example, from changing 1 tracked file a few times, it gets many events from .git. The fsmonitor--daemon changes come from Git's fs monitor and are unrelated to the app. I've added a logger to show this in parcelWatcher.subscribe, and only the first two lines are relevant to the app:

Event: update app/root.tsx
Event: update app/storefrontapi.generated.d.ts
Event: delete .git/fsmonitor--daemon/cookies/10981-11489
Event: update .git/FETCH_HEAD
Event: delete .git/fsmonitor--daemon/cookies/10981-11490
Event: update .git/FETCH_HEAD
Event: delete .git/objects/maintenance.lock
Event: delete .git/fsmonitor--daemon/cookies/10981-11491
Event: delete .git/fsmonitor--daemon/cookies/10981-11492
Event: delete .git/fsmonitor--daemon/cookies/10981-11493
Event: delete .git/fsmonitor--daemon/cookies/10981-11494
Event: delete .git/fsmonitor--daemon/cookies/10981-11495
Event: delete .git/fsmonitor--daemon/cookies/10981-11496
Event: delete .git/fsmonitor--daemon/cookies/10981-11497
Event: delete .git/fsmonitor--daemon/cookies/10981-11498
Event: delete .git/fsmonitor--daemon/cookies/10981-11499
Event: delete .git/fsmonitor--daemon/cookies/10981-11500
Event: delete .git/fsmonitor--daemon/cookies/10981-11501
Event: delete .git/fsmonitor--daemon/cookies/10981-11502
Event: delete .git/fsmonitor--daemon/cookies/10981-11503
Event: delete .git/fsmonitor--daemon/cookies/10981-11504
Event: delete .git/fsmonitor--daemon/cookies/10981-11505
Event: delete .git/fsmonitor--daemon/cookies/10981-11506
Event: delete .git/fsmonitor--daemon/cookies/10981-11507
Event: delete .git/fsmonitor--daemon/cookies/10981-11508
Event: delete .git/fsmonitor--daemon/cookies/10981-11509
Event: delete .git/fsmonitor--daemon/cookies/10981-11510
Event: delete .git/fsmonitor--daemon/cookies/10981-11511
Event: delete .git/fsmonitor--daemon/cookies/10981-11512
Event: delete .git/fsmonitor--daemon/cookies/10981-11513
Event: update .git/FETCH_HEAD
Event: update .git/objects/17
Event: create .git/objects/17/b027984b5675c977e502204f156ff0bb8ad89c
Event: delete .git/objects/17/tmp_obj_47c2Xs
Event: update .git/objects/41
Event: create .git/objects/41/6e34e876d8c27c6d5597adff2f830213d452c9
Event: delete .git/objects/41/tmp_obj_ePlsyd
Event: delete .git/objects/6f/tmp_obj_Zkj9LY
Event: update .git/objects/df
Event: create .git/objects/df/67e8719095b138c7c584d1c10b8940d0693325
Event: delete .git/objects/df/tmp_obj_5PjCpn
Event: update .git/FETCH_HEAD
Event: delete .git/fsmonitor--daemon/cookies/10981-11514
Event: update .git/logs/refs/remotes/origin/fix-cache
Event: update .git/objects/6f
Event: create .git/objects/6f/86575e6a9fb5460e618ca82ebe08124416340e
Event: delete .git/objects/6f/tmp_obj_Zkj9LY
Event: update .git/objects/d7
Event: create .git/objects/d7/86b7c0accfe7e0e8a8ca36858fca446a935b09
Event: delete .git/objects/d7/tmp_obj_DdglUd
Event: update .git/objects/e3
Event: create .git/objects/e3/46d325670975e662f06ac0812ada4c54ac311c
Event: delete .git/objects/e3/tmp_obj_zffAjF
Event: update .git/objects/f2
Event: create .git/objects/f2/4b6538dfc0d6584f0da666e1916fd97f5a3f82
Event: delete .git/objects/f2/tmp_obj_GaE2HA
Event: delete .git/objects/maintenance.lock
Event: create .git/refs/remotes/origin/fix-cache
Event: delete .git/refs/remotes/origin/fix-cache.lock
Event: delete .git/fsmonitor--daemon/cookies/10981-11515
Event: delete .git/fsmonitor--daemon/cookies/10981-11516
Event: delete .git/fsmonitor--daemon/cookies/10981-11517
Event: delete .git/fsmonitor--daemon/cookies/10981-11518
Event: delete .git/fsmonitor--daemon/cookies/10981-11519
Event: delete .git/fsmonitor--daemon/cookies/10981-11520
Event: delete .git/fsmonitor--daemon/cookies/10981-11521
Event: delete .git/fsmonitor--daemon/cookies/10981-11522
Event: delete .git/fsmonitor--daemon/cookies/10981-11523
Event: delete .git/fsmonitor--daemon/cookies/10981-11524
Event: delete .git/fsmonitor--daemon/cookies/10981-11525
Event: delete .git/fsmonitor--daemon/cookies/10981-11526
Event: delete .git/fsmonitor--daemon/cookies/10981-11527
Event: delete .git/fsmonitor--daemon/cookies/10981-11528
Event: delete .git/fsmonitor--daemon/cookies/10981-11529
Event: delete .git/fsmonitor--daemon/cookies/10981-11530
Event: delete .git/fsmonitor--daemon/cookies/10981-11531

@changeset-bot
Copy link

changeset-bot bot commented Jul 17, 2023

🦋 Changeset detected

Latest commit: 67ab4f2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@saihaj saihaj merged commit 23d8796 into dotansimha:master Sep 25, 2023
19 checks passed
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.

5 participants