2.0.5
This commit is contained in:
parent
37a14c3bee
commit
5156ab826b
5 changed files with 23 additions and 9 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# 2.0.5
|
||||||
|
* Use `dart:developer` to find the Observatory URI.
|
||||||
|
|
||||||
# 2.0.4
|
# 2.0.4
|
||||||
* Forcibly close app loggers on shutdown.
|
* Forcibly close app loggers on shutdown.
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'server.dart';
|
||||||
|
|
||||||
main() async {
|
main() async {
|
||||||
var hot = new HotReloader(createServer, [
|
var hot = new HotReloader(createServer, [
|
||||||
new Directory('src'),
|
|
||||||
new Directory('src'),
|
new Directory('src'),
|
||||||
'server.dart',
|
'server.dart',
|
||||||
// Also allowed: Platform.script,
|
// Also allowed: Platform.script,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:angel_framework/angel_framework.dart';
|
import 'package:angel_framework/angel_framework.dart';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer' as dev;
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
import 'package:angel_framework/angel_framework.dart';
|
import 'package:angel_framework/angel_framework.dart';
|
||||||
|
@ -11,6 +12,7 @@ import 'package:glob/glob.dart';
|
||||||
import 'package:html_builder/elements.dart';
|
import 'package:html_builder/elements.dart';
|
||||||
import 'package:html_builder/html_builder.dart';
|
import 'package:html_builder/html_builder.dart';
|
||||||
import 'package:io/ansi.dart';
|
import 'package:io/ansi.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:vm_service_lib/vm_service_lib.dart' as vm;
|
import 'package:vm_service_lib/vm_service_lib.dart' as vm;
|
||||||
import 'package:vm_service_lib/vm_service_lib_io.dart' as vm;
|
import 'package:vm_service_lib/vm_service_lib_io.dart' as vm;
|
||||||
import 'package:watcher/watcher.dart';
|
import 'package:watcher/watcher.dart';
|
||||||
|
@ -149,11 +151,21 @@ class HotReloader {
|
||||||
'WARNING: You have instantiated a HotReloader without passing `--enable-vm-service` or `--observe` to the Dart VM. Hot reloading will be disabled.'));
|
'WARNING: You have instantiated a HotReloader without passing `--enable-vm-service` or `--observe` to the Dart VM. Hot reloading will be disabled.'));
|
||||||
isHot = false;
|
isHot = false;
|
||||||
} else {
|
} else {
|
||||||
_client = await vm.vmServiceConnect(
|
var info = await dev.Service.getInfo();
|
||||||
vmServiceHost ?? 'localhost', vmServicePort ?? 8181);
|
var uri = info.serverUri;
|
||||||
|
uri = uri.replace(path: p.join(uri.path, 'ws'));
|
||||||
|
if (uri.scheme == 'https')
|
||||||
|
uri = uri.replace(scheme: 'wss');
|
||||||
|
else
|
||||||
|
uri = uri.replace(scheme: 'ws');
|
||||||
|
_client = await vm.vmServiceConnectUri(uri.toString());
|
||||||
_vmachine ??= await _client.getVM();
|
_vmachine ??= await _client.getVM();
|
||||||
_mainIsolate ??= _vmachine.isolates.first;
|
_mainIsolate ??= _vmachine.isolates.first;
|
||||||
await _client.setExceptionPauseMode(_mainIsolate.id, 'None');
|
|
||||||
|
for (var isolate in _vmachine.isolates) {
|
||||||
|
await _client.setExceptionPauseMode(isolate.id, 'None');
|
||||||
|
}
|
||||||
|
|
||||||
await _listenToFilesystem();
|
await _listenToFilesystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,9 +181,7 @@ class HotReloader {
|
||||||
if (enableHotkeys) {
|
if (enableHotkeys) {
|
||||||
var serverUri = new Uri(
|
var serverUri = new Uri(
|
||||||
scheme: 'http', host: server.address.address, port: server.port);
|
scheme: 'http', host: server.address.address, port: server.port);
|
||||||
var host = vmServiceHost == 'localhost' ? '127.0.0.1' : vmServiceHost;
|
var observatoryUri = await dev.Service.getInfo().then((i) => i.serverUri);
|
||||||
var observatoryUri =
|
|
||||||
new Uri(scheme: 'http', host: host, port: vmServicePort);
|
|
||||||
|
|
||||||
print(styleBold.wrap(
|
print(styleBold.wrap(
|
||||||
'\n🔥 To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".'));
|
'\n🔥 To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".'));
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
name: angel_hot
|
name: angel_hot
|
||||||
description: Supports hot reloading/hot code push of Angel servers on file changes.
|
description: Supports hot reloading/hot code push of Angel servers on file changes.
|
||||||
version: 2.0.4
|
version: 2.0.5
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/hot
|
homepage: https://github.com/angel-dart/hot
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.0.0-dev <3.0.0"
|
sdk: ">=2.0.0 <3.0.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
angel_framework: ^2.0.0-alpha
|
angel_framework: ^2.0.0-alpha
|
||||||
angel_websocket: ^2.0.0-alpha
|
angel_websocket: ^2.0.0-alpha
|
||||||
|
@ -12,6 +12,7 @@ dependencies:
|
||||||
glob: ^1.0.0
|
glob: ^1.0.0
|
||||||
html_builder: ^1.0.0
|
html_builder: ^1.0.0
|
||||||
io: ^0.3.2
|
io: ^0.3.2
|
||||||
|
path: ^1.0.0
|
||||||
vm_service_lib: ^0.3.5
|
vm_service_lib: ^0.3.5
|
||||||
watcher: ^0.9.0
|
watcher: ^0.9.0
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
Loading…
Reference in a new issue