-
Notifications
You must be signed in to change notification settings - Fork 688
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
🚀 Feature Request: Pages functions with _worker.js does not hot reload for any changes other than the _worker.js file #4824
Comments
Agree. As a stop-gap fix, it'd also suffice to have a shortcut to reload everything in the terminal by pressing Otherwise, the DX is incredibly poor if you edit anything but the handler files, as you either have to make random changes to the handler file to get it to reload or have to restart the dev server altogether, which takes quite some time. |
@lrapoport-cf any reason you removed this from the workers-sdk project? |
@treeder the workers-sdk project is for untriaged issues and bugs. Liz move this to our roadmap project since it is something we intend to address in the future. All feature requests go there in order for us to prioritize them. |
@lauri865 did you figure out some workaround for this? You're right, the dev experience is really bad due to this. If wrangler started up faster or something, it may be less of a pain, but everything is just too slow. |
triaging this as part of https://github.com/cloudflare/workers-sdk/milestone/10 to discuss with the team if this is something we want to take on as part of that body of work. |
hi @treeder, just want to confirm...are you referring to changes in the _worker.js dependencies only, or are you referring to changes in the static assets as well? |
Anything. It doesn't hot reload for anything except |
This seems like a really simple fix since you already have it for some directories, but a HUGE developer QoL win. Can it be fast tracked? |
Hi folks Picking this up as part of https://github.com/cloudflare/workers-sdk/milestone/10. Apologies for the wait 🙏 . I will circle back here with more details, as I first have to look more thoroughly into why this is happening. Until then though, a few quick notes on my side:
Moving forward, I think it makes sense to split this work up into two main threads:
As I mentioned before, I will follow up here with more details as I am looking into this issue, but please feel free to drop any thoughts on anything I have mentioned so far. I abs empathise with the general feeling here that improving the <3 |
For what it's worth, I think it should just watch for any change in my directory and subdirectories, minus probably node_modules and things like that. It seems to currently only watch I don't think watching external dependencies is necessary if that's what you're saying 2 is about, those changes are rare and would most likely require you to stop and run some npm commands anyways. I'm sure there's some kind of performance hit for watching some huge directory like node_modules too. |
by "directory" do you mean your project's root, from where you are running the And indeed, I wasn't thinking about watching things like |
By directory, I suppose just the And yes, sounds like the same thing. |
The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the `_worker.js` file, but not for changes in any of its imported dependencies. This means that given the following `_worker.js` file ``` import { graham } from "./graham-the-dog"; export default { fetch(request, env) { return new Response(graham) } } ``` `pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit addresses all the aforementioned issues. Fixes #4824
The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the `_worker.js` file, but not for changes in any of its imported dependencies. This means that given the following `_worker.js` file ``` import { graham } from "./graham-the-dog"; export default { fetch(request, env) { return new Response(graham) } } ``` `pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit addresses all the aforementioned issues. Fixes #4824
The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the `_worker.js` file, but not for changes in any of its imported dependencies. This means that given the following `_worker.js` file ``` import { graham } from "./graham-the-dog"; export default { fetch(request, env) { return new Response(graham) } } ``` `pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit addresses all the aforementioned issues. Fixes #4824
The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the `_worker.js` file, but not for changes in any of its imported dependencies. This means that given the following `_worker.js` file ``` import { graham } from "./graham-the-dog"; export default { fetch(request, env) { return new Response(graham) } } ``` `pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit addresses all the aforementioned issues. Fixes #4824
The watch mode in `pages dev` for Advanced Mode projects is currently partially broken, as it only watches for changes in the `_worker.js` file, but not for changes in any of its imported dependencies. This means that given the following `_worker.js` file ``` import { graham } from "./graham-the-dog"; export default { fetch(request, env) { return new Response(graham) } } ``` `pages dev` will reload for any changes in the `_worker.js` file itself, but not for any changes in `graham-the-dog.js`, which is its dependency. Similarly, `pages dev` will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports. This commit addresses all the aforementioned issues. Fixes #4824
@treeder we merged a fix for this yesterday. Please give it a spin and let us know if you have any feedback <3 |
Awesome, thanks, we'll to try it out. |
Seems to work! Thank you. |
really happy to hear! thank you for reporting the issue to us <3 |
Describe the solution
It would be nice for wrangler to reload on any changes in the directory and subdirectories. Currently it will only reload if _worker.js is changed. It won't reload if any of its dependencies are modified including files imported from the same directory.
Using:
The text was updated successfully, but these errors were encountered: