-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(core): add daemon watcher filters #13229
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…emap, then handle created files
@@ -71,14 +73,24 @@ export function addUpdatedAndDeletedFiles( | |||
collectedDeletedFiles.add(f); | |||
} | |||
|
|||
notifyFileWatcherSockets(null, updatedFiles, deletedFiles); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only do it if you have updated or deleted files
cachedSerializedProjectGraphPromise = | ||
processFilesAndCreateAndSerializeProjectGraph(); | ||
await cachedSerializedProjectGraphPromise; | ||
|
||
notifyFileWatcherSockets(createdFiles, null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only do it if you have created files
return registeredFileWatcherSockets.length > 0; | ||
} | ||
|
||
export async function notifyFileWatcherSockets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove "async". We invoke this function in the fire and forget fashion without awaiting. IntelliJ will actually complain that you invoke a function returning promise and not awaiting
return; | ||
} | ||
|
||
await queue.sendToQueue(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same: no await
})), | ||
]; | ||
|
||
for (const changedFile of allChangedFiles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how slow this can be? Imagine if reformated 1000 files in a big workspace.
Currently it's O(Number of changes files * Number of files)
I think a better way might be to create a map from files to projects. You complexity will change to O(Number of files + number of changed files)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Expected Behavior
Related Issue(s)
Fixes #