Skip to content

Commit a931c37

Browse files
committed
Finalize hot-reloading feature
- Rename live-reload to hot-reload - Add debug logging about reloading - Add documentation - Version bump and changelog
1 parent 06a4d42 commit a931c37

File tree

13 files changed

+1741
-1500
lines changed

13 files changed

+1741
-1500
lines changed

build_runner/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.10.2
2+
3+
- `--live-reload` cli option is replaced with `--hot-reload` one with appropriate
4+
functionality. See [hot-module-reloading](../docs/hot_module_reloading.md) for more
5+
info.
6+
17
## 0.10.1+1
28

39
- Added better error handling when a socket is already in use in `serve` mode.

build_runner/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ Some commands also have additional options:
9999
##### serve
100100

101101
- `--hostname`: The host to run the server on.
102-
- `--live-reload`: Enables automatic page reloading on rebuilds.
102+
- `--hot-reload`: Enables automatic module reloading on rebuilds.
103+
See [hot-module-reloading](../docs/hot_module_reloading.md) for more info.
103104

104105
Trailing args of the form `<directory>:<port>` are supported to customize what
105106
directories are served, and on what ports.

build_runner/lib/src/entrypoint/options.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'package:path/path.dart' as p;
1414
const assumeTtyOption = 'assume-tty';
1515
const defineOption = 'define';
1616
const deleteFilesByDefaultOption = 'delete-conflicting-outputs';
17-
const liveReloadOption = 'live-reload';
17+
const hotReloadOption = 'hot-reload';
1818
const logPerformanceOption = 'log-performance';
1919
const logRequestsOption = 'log-requests';
2020
const lowResourcesModeOption = 'low-resources-mode';
@@ -131,13 +131,13 @@ class SharedOptions {
131131
/// Options specific to the `serve` command.
132132
class ServeOptions extends SharedOptions {
133133
final String hostName;
134-
final bool liveReload;
134+
final bool hotReload;
135135
final bool logRequests;
136136
final List<ServeTarget> serveTargets;
137137

138138
ServeOptions._({
139139
@required this.hostName,
140-
@required this.liveReload,
140+
@required this.hotReload,
141141
@required this.logRequests,
142142
@required this.serveTargets,
143143
@required bool assumeTty,
@@ -203,7 +203,7 @@ class ServeOptions extends SharedOptions {
203203

204204
return ServeOptions._(
205205
hostName: argResults[hostnameOption] as String,
206-
liveReload: argResults[liveReloadOption] as bool,
206+
hotReload: argResults[hotReloadOption] as bool,
207207
logRequests: argResults[logRequestsOption] as bool,
208208
serveTargets: serveTargets,
209209
assumeTty: argResults[assumeTtyOption] as bool,

build_runner/lib/src/entrypoint/serve.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ServeCommand extends WatchCommand {
2626
defaultsTo: false,
2727
negatable: false,
2828
help: 'Enables logging for each request to the server.')
29-
..addFlag(liveReloadOption,
29+
..addFlag(hotReloadOption,
3030
defaultsTo: false,
3131
negatable: false,
3232
help: 'Enables automatic page reloading on rebuilds.');
@@ -91,7 +91,7 @@ class ServeCommand extends WatchCommand {
9191
server,
9292
handler.handlerFor(target.dir,
9393
logRequests: options.logRequests,
94-
liveReload: options.liveReload));
94+
hotReload: options.hotReload));
9595
});
9696

9797
_ensureBuildWebCompilersDependency(packageGraph, logger);

build_runner/lib/src/server/hot_reload_client/client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'reload_handler.dart';
1717
import 'reloading_manager.dart';
1818

1919
final _assetsDigestPath = r'$assetDigests';
20-
final _buildUpdatesProtocol = r'$livereload';
20+
final _buildUpdatesProtocol = r'$hotreload';
2121

2222
@anonymous
2323
@JS()

0 commit comments

Comments
 (0)