-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(tasks-fs): bump up notify, fix empty file watch #7340
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
|
✅ This change can build |
46cd943
to
34b9959
Compare
Testing against next.js seems passing at least vercel/next.js#61879 |
.insert(PathBuf::from(&root)); | ||
batched_invalidate_path_and_children_dir | ||
.insert(PathBuf::from(&root)); | ||
Ok(Ok(events)) => { |
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.
would be nice to split this whole thing out into a new file like I had done in #2936
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.
yeah, would like to do a followup pr. moving whole makes diff bit unfriendly in gh for the review esp this contains some event type changes for the subscription.
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.
idk, you already have to manually compare as the diff doesn't line up at all
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.
yeah but it's still diff. for this change, unless it is explicitly required I'd like to make minimal.
crates/turbo-tasks-fs/src/lib.rs
Outdated
@@ -264,6 +270,26 @@ impl DiskFileSystem { | |||
self.start_watching_internal(true) | |||
} | |||
|
|||
/** |
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.
use a doc comment for this
debounced_watcher | ||
.watcher() | ||
.watch(&root_path, RecursiveMode::Recursive)?; |
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 think we also want the "cache" here and below?
debouncer.cache().add_root(&root_path, RecursiveMode::Recursive);
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.
full debouncer internally autosetup those
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.
but the version in this PR is too old
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What * vercel/turborepo#7340 <!-- OJ Kwon - feat(tasks-fs): bump up notify, fix empty file watch --> Bump up turbopack PR to fix hmr issues. Closes PACK-2466
…o#7340) ### Description This PR upgrades `notify` pkg to create a filesystem watcher. It is due to recent issue we found in PACK-2437, the edge cases like - start a watcher with file have any contents - open editor, clear all (make file empty), save doesn't create any file watcher event. This makes some cases turbopack does not trigger hmr even if it's desired. One thing to note is even with upgrade its event kind is somewhat unexpected; it's not `Modify` event but `Metadata` event. I can't say why it emits in that way, but add it as workaround for now. We had experiences of trying to upgrade & revert this pkg before, so the upgrade plan need some caution. Plan is - Once PR is approved, cut turbopack _before_ PR and bump next.js first - Land PR, create new turbopack release so release contains only 1 changes to notify - Ensure new turbopack update in next.js won't break (like upgrading front, etcs) and make it easy to revert Closes PACK-2437.
…o#7340) ### Description This PR upgrades `notify` pkg to create a filesystem watcher. It is due to recent issue we found in PACK-2437, the edge cases like - start a watcher with file have any contents - open editor, clear all (make file empty), save doesn't create any file watcher event. This makes some cases turbopack does not trigger hmr even if it's desired. One thing to note is even with upgrade its event kind is somewhat unexpected; it's not `Modify` event but `Metadata` event. I can't say why it emits in that way, but add it as workaround for now. We had experiences of trying to upgrade & revert this pkg before, so the upgrade plan need some caution. Plan is - Once PR is approved, cut turbopack _before_ PR and bump next.js first - Land PR, create new turbopack release so release contains only 1 changes to notify - Ensure new turbopack update in next.js won't break (like upgrading front, etcs) and make it easy to revert Closes PACK-2437.
…o#7340) ### Description This PR upgrades `notify` pkg to create a filesystem watcher. It is due to recent issue we found in PACK-2437, the edge cases like - start a watcher with file have any contents - open editor, clear all (make file empty), save doesn't create any file watcher event. This makes some cases turbopack does not trigger hmr even if it's desired. One thing to note is even with upgrade its event kind is somewhat unexpected; it's not `Modify` event but `Metadata` event. I can't say why it emits in that way, but add it as workaround for now. We had experiences of trying to upgrade & revert this pkg before, so the upgrade plan need some caution. Plan is - Once PR is approved, cut turbopack _before_ PR and bump next.js first - Land PR, create new turbopack release so release contains only 1 changes to notify - Ensure new turbopack update in next.js won't break (like upgrading front, etcs) and make it easy to revert Closes PACK-2437.
…o#7340) ### Description This PR upgrades `notify` pkg to create a filesystem watcher. It is due to recent issue we found in PACK-2437, the edge cases like - start a watcher with file have any contents - open editor, clear all (make file empty), save doesn't create any file watcher event. This makes some cases turbopack does not trigger hmr even if it's desired. One thing to note is even with upgrade its event kind is somewhat unexpected; it's not `Modify` event but `Metadata` event. I can't say why it emits in that way, but add it as workaround for now. We had experiences of trying to upgrade & revert this pkg before, so the upgrade plan need some caution. Plan is - Once PR is approved, cut turbopack _before_ PR and bump next.js first - Land PR, create new turbopack release so release contains only 1 changes to notify - Ensure new turbopack update in next.js won't break (like upgrading front, etcs) and make it easy to revert Closes PACK-2437.
Description
This PR upgrades
notify
pkg to create a filesystem watcher.It is due to recent issue we found in PACK-2437, the edge cases like
doesn't create any file watcher event. This makes some cases turbopack does not trigger hmr even if it's desired.
One thing to note is even with upgrade its event kind is somewhat unexpected; it's not
Modify
event butMetadata
event. I can't say why it emits in that way, but add it as workaround for now.We had experiences of trying to upgrade & revert this pkg before, so the upgrade plan need some caution.
Plan is
Closes PACK-2437.