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

chore(daemon): lazy load package changes watcher #9396

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

NicholasLYang
Copy link
Contributor

@NicholasLYang NicholasLYang commented Nov 6, 2024

Description

Before we'd initialize the package changes watcher when the daemon starts up. Now we do it only when watch mode needs it.

Testing Instructions

Tested manually:

cargo run -p turbo -- --cwd ../my-turborepo --skip-infer daemon restart 

In different terminal:

cargo run -p turbo -- --cwd ../my-turborepo --skip-infer daemon logs 

Change a file in the repository, note that no logs are emitted for this change.

Then run

turbo watch dev

Note that package changes start showing up.

Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 5:47pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-gatsby-web ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-native-web ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-svelte-web ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-tailwind-web ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm
examples-vite-web ⬜️ Ignored (Inspect) Nov 6, 2024 5:47pm

@NicholasLYang NicholasLYang marked this pull request as ready for review November 6, 2024 17:55
@NicholasLYang NicholasLYang requested a review from a team as a code owner November 6, 2024 17:55
Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:


pub fn get_or_init_package_changes_watcher(&self) -> Arc<PackageChangesWatcher> {
self.package_changes_watcher
.get_or_init(|| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So happy that OnceLock got stabilized

@NicholasLYang NicholasLYang merged commit 54efd40 into main Nov 6, 2024
40 checks passed
@NicholasLYang NicholasLYang deleted the nicholasyang/lazy-load-package-changes-watcher branch November 6, 2024 18:39
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.

2 participants