-
Notifications
You must be signed in to change notification settings - Fork 5.6k
fix(serve): support serve hmr #26078
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
Conversation
cli/worker.rs
Outdated
@@ -415,7 +414,7 @@ impl CliMainWorker { | |||
|
|||
#[derive(Clone)] | |||
pub struct CliMainWorkerFactory { | |||
shared: Arc<SharedWorkerState>, | |||
pub shared: Arc<SharedWorkerState>, |
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.
Are these visibility changes needed?
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.
No not at all, I used that while inspecting, I'll remove it soon.
cli/tools/serve.rs
Outdated
.unwrap_or(WatchFlagsWithPaths { | ||
hmr: false, | ||
..Default::default() | ||
}) |
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.
.unwrap_or(WatchFlagsWithPaths { | |
hmr: false, | |
..Default::default() | |
}) | |
.map(|watch_flags| watch_flags.hmr).unwrap_or(false) |
cli/worker.rs
Outdated
@@ -121,7 +121,6 @@ pub struct CliMainWorkerOptions { | |||
pub serve_port: Option<u16>, | |||
pub serve_host: Option<String>, | |||
} | |||
|
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.
Can you please revert this line?
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.
Looks like this hasn't been reverted yet
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.
@nathanwhit please take a look. I'm not sure this actually helps much - looks like HMR runner is still not wired up properly
@nathanwhit |
Aside from that one whitespace change that should be reverted, LGTM |
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.
LGTM, thanks!
This PR addresses issue #25600 Changes: Updated `fn has_hmr` to check `serve` subcommand and return its hmr value if found, in order to run the worker in serve mode with hmr_runner. Thus the hmr event can be dispatched upon changes on the file served.
This PR addresses issue #25600
Changes:
Updated
fn has_hmr
to checkserve
subcommand and return its hmr value if found, in order to run the worker in serve mode with hmr_runner. Thus the hmr event can be dispatched upon changes on the file served.