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

Add --noWatch option to serve command #523

Merged
merged 3 commits into from
Oct 17, 2023
Merged

Add --noWatch option to serve command #523

merged 3 commits into from
Oct 17, 2023

Conversation

chasestarr
Copy link
Collaborator

@chasestarr chasestarr commented Oct 10, 2023

When running in a multi tenant environment, we're seeing instances where chokidar exceeds the available max_user_watches, with the error message System limit for number of file watchers reached, watch 'src'. While we could increase that limit, there is no reason to watch the file system in this scenario. Making this change within ladle, rather than customizing through vite.config.js is important because ladle starts its own chokidar watch outside of vite.

This PR adds a --noWatch option to the serve command to disable chokidar file system watching. It currently does this by adding all files to the ignored watcher options. A recent PR to vite added null as an acceptable value to achieve the same result, but it has not been included in a release yet. I added a TODO comment in the code to update once available.

@changeset-bot
Copy link

changeset-bot bot commented Oct 10, 2023

🦋 Changeset detected

Latest commit: ecddd05

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

This PR includes changesets to release 13 packages
Name Type
@ladle/react Patch
example Patch
test-addons Patch
test-babel Patch
test-config Patch
test-config-ts Patch
test-css Patch
test-decorators Patch
test-playwright Patch
test-programmatic Patch
test-provider Patch
test-baseweb Patch
test-msw 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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 10, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: ecddd05
Status: ✅  Deploy successful!
Preview URL: https://d42dec7e.ladle.pages.dev
Branch Preview URL: https://serve-no-watch.ladle.pages.dev

View logs

@tajo
Copy link
Owner

tajo commented Oct 16, 2023

Lgtm. Just a type nitpick and the following documentation should be updated

@tajo tajo merged commit 6138c7f into main Oct 17, 2023
5 checks passed
@tajo tajo deleted the serve-no-watch branch October 17, 2023 17:36
@tajo tajo mentioned this pull request Oct 17, 2023
@chrisdothtml
Copy link

TODO: pass null instead once this diff is included in release

@chasestarr Looks like this was included in the v5 release

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.

3 participants