-
Notifications
You must be signed in to change notification settings - Fork 212
Restore --live-reload option #1778
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
..addFlag(hotReloadOption, | ||
defaultsTo: false, | ||
negatable: false, | ||
help: 'Enables automatic page reloading on rebuilds.'); | ||
help: 'Enables automatic reloading of changed modules.'); |
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.
nit: ... on rebuilds.
@@ -0,0 +1,6 @@ | |||
var _buildUpdatesProtocol = '$buildUpdates'; |
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.
nit, wrap this all in an anonymous function
(function() {
...
})()
@@ -131,12 +132,14 @@ class SharedOptions { | |||
/// Options specific to the `serve` command. | |||
class ServeOptions extends SharedOptions { | |||
final String hostName; | |||
final bool liveReload; | |||
final bool hotReload; | |||
final bool logRequests; | |||
final List<ServeTarget> serveTargets; | |||
|
|||
ServeOptions._({ |
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.
We should add some validation here that both hotReload
and liveReload
are not true.
@@ -99,8 +99,9 @@ Some commands also have additional options: | |||
##### serve | |||
|
|||
- `--hostname`: The host to run the server on. | |||
- `--hot-reload`: Enables automatic module reloading on rebuilds. | |||
See [hot-module-reloading](../docs/hot_module_reloading.md) for more info. | |||
- `--live-reload`: Enables automatic page reloading on rebuilds. |
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.
If you provide both which one takes precedence? Could potentially model this as an enum to prevent that issue.
* Add assets digests handler (#1709) This entry point will be used for hot reloading, in order to initially retrieve digests of all assets, as build_runner might not know list of all of them, unlike client. * Emit useful information about build results (#1710) Instead of just 'update' emit json with updated build results and its digests * Move live reload client code to new hot_reload_client.dart file (#1732) It is expected that client code will become complicated, so in separate dart file it would be easier to test and maintain. * Implement basic hot reload (#1741) Reload any changed modules without any specific order, then reload main module and call main func to hopefully apply changes. Still need to get module dependency graph to reload in topological order and find correct ancessor chain where reloaded modules can be saved in closures. * Basic graph handling for hot reload (#1759) We still lack handling situations when graph is dynamically updated between reloads. * Add rough graph changes handling by full page reload (#1763) * Simplify module interface (#1764) * Change HMR API to work with several libraries bundled in one module (#1765) Fixes #1762 * Close Hot Reload listeners on exit (#1775) Closes #1774 * Refactor and improve HMR code (#1770) - Get rid of `roughLibraryKeyDecode` - use library path exposed from dart runtime now. - Get load modules from cache directly and throw if it isn't loaded instead of using require.js and hoping that module already loaded and no network request would be done. - Don't mess with `.ddc` extension in `build_runner` code - encapsulate all of it on build_web_compilers side. Fixes #1760 Fixes #1762 * Finalize hot-reloading feature (#1773) - Rename live-reload to hot-reload - Add debug logging about reloading - Add documentation - Version bump and changelog Fixes #1766 * Restore --live-reload option (#1778)
No description provided.