Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[dev] watch code and re-build/upload on changes #876

Closed
EverlastingBugstopper opened this issue Nov 14, 2019 · 6 comments
Closed

[dev] watch code and re-build/upload on changes #876

EverlastingBugstopper opened this issue Nov 14, 2019 · 6 comments
Labels
feature Feature requests and suggestions
Milestone

Comments

@EverlastingBugstopper
Copy link
Contributor

Provide --watch flag and make its default "true"

@EverlastingBugstopper EverlastingBugstopper added the feature Feature requests and suggestions label Nov 14, 2019
@EverlastingBugstopper EverlastingBugstopper added this to the Preview Proxy milestone Nov 14, 2019
@EverlastingBugstopper EverlastingBugstopper self-assigned this Nov 14, 2019
@EverlastingBugstopper EverlastingBugstopper changed the title [proxy] watch code and re-build/upload on changes [dev] watch code and re-build/upload on changes Nov 20, 2019
@EverlastingBugstopper EverlastingBugstopper removed their assignment Nov 22, 2019
@dihmeetree
Copy link

+1 for this. Testing out the dev feature today and definitely need a re-build/watch feature :)

@EverlastingBugstopper
Copy link
Contributor Author

EverlastingBugstopper commented Jan 6, 2020

The usage I proposed for this might be a bit problematic given our existing choice for wrangler preview. Preview's watch flag does not accept any value, instead it checks for its presence. This means that wrangler preview --watch=false is not valid/equivalent to wrangler preview.

With wrangler dev I think we should default to watching changes, which would mean we would need wrangler dev --watch=false to work properly.

I think the way forward is to change preview's watch flag to optionally accept a value and default to false, meaning wrangler preview --watch=false and wrangler dev --watch=false would both work as expected. The only difference would be that wrangler preview does not watch by default and wrangler dev does. This may also be confusing and we might want to have both of them behave the same way.

Would love some input on this.

@exvuma
Copy link
Contributor

exvuma commented Jan 6, 2020

Ideally, I think we would make the same changes to preview and have wrangler preview's default behavior to watch for changes. And add the same option - as we add to dev - to turn watch off.

If changing preview is out of scope and I think it's perfectly fine to have preview and dev have different default behaviors and not restrict the design of dev to that of the preview.

Not sure I see the rationale behind --watch-false and --watch=false. Why did you choose to include both?

@EverlastingBugstopper
Copy link
Contributor Author

That makes sense - as for the --watch-false that's just a typo, good catch :)

@ashleymichal
Copy link
Contributor

fwiw i think more folks will use dev, and that they will expect it to always watch regardless of the design of preview.

i would put out the challenge to try and articulate the distinct use cases for preview vs dev, i.e. when would i prefer one over the other?

@EverlastingBugstopper
Copy link
Contributor Author

@ashleymichal ideally you shouldn't have to use preview, but it can be helpful for things like the network tab that haven't been implemented in the dev server. my goal is to fix this shortcoming with #946 and then strongly encourage people to only ever use wrangler dev.

I definitely want to default watch to true for wrangler dev, this question is mostly about consistency with preview

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions
Projects
None yet
Development

No branches or pull requests

5 participants
@ashleymichal @exvuma @EverlastingBugstopper @dihmeetree and others