-
Notifications
You must be signed in to change notification settings - Fork 696
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
[wrangler] debounce restarts when changes are made to the assets directory #6866
[wrangler] debounce restarts when changes are made to the assets directory #6866
Conversation
🦋 Changeset detectedLatest commit: 3053aca The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
I actually haven't been table to test this locally. This is my first time doing local wrangler dev, and I can't get my local copy to run... I keep getting this error about workerd:
I will keep digging and trying to figure it out. |
656d40b
to
3053aca
Compare
OK, I got this running locally and it does fix the problem. I also think we shouldn't show every file that changes, but that can be a separate PR. |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-wrangler-6866 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6866/npm-package-wrangler-6866 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-wrangler-6866 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-create-cloudflare-6866 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-cloudflare-kv-asset-handler-6866 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-miniflare-6866 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-cloudflare-pages-shared-6866 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-cloudflare-vitest-pool-workers-6866 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-cloudflare-workers-editor-shared-6866 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11116530193/npm-package-cloudflare-workers-shared-6866 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
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.
This needs to also be handled in the –x-dev-env flow
@RamIdeas can you point me to where? I'll update the PR. |
It looks like the multiple restarts don't even happen with |
Ah ok cool I think the existing cancellation might already handle this by short-circuiting the reload when another begins |
Congratulations @zwily, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cm1qgpbst21620cleqcp3pamb This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
Thank you! |
What this PR solves / how to test
When files change in the assets directory, wrangler was reloading the app for every file. When the assets are the result of a build (like with the remix compiler, for example), that results in a lot of unnecessary restarting. This debounces them similar to how Pages dev debounces.
Fixes #6865
Author has addressed the following