Bump to 1.1.0, remove git dep

This commit is contained in:
Tobe O 2017-12-07 01:40:05 -05:00
parent 1623e92e94
commit 4639efd67f
2 changed files with 23 additions and 19 deletions

View file

@ -8,12 +8,13 @@ import 'package:angel_websocket/server.dart';
import 'package:glob/glob.dart'; 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:vm_service_client/vm_service_client.dart'; 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:watcher/watcher.dart'; import 'package:watcher/watcher.dart';
/// A utility class that watches the filesystem for changes, and starts new instances of an Angel server. /// A utility class that watches the filesystem for changes, and starts new instances of an Angel server.
class HotReloader { class HotReloader {
VMServiceClient _client; vm.VmService _client;
final StreamController<WatchEvent> _onChange = final StreamController<WatchEvent> _onChange =
new StreamController<WatchEvent>.broadcast(); new StreamController<WatchEvent>.broadcast();
final List _paths = []; final List _paths = [];
@ -35,17 +36,24 @@ class HotReloader {
/// Default: `5s` /// Default: `5s`
Duration get timeout => _timeout; Duration get timeout => _timeout;
/// A URL pointing to the Dart VM service. /// The Dart VM service host.
/// ///
/// Default: `ws://localhost:8181/ws`. /// Default: `localhost`.
final String vmServiceUrl; final String vmServiceHost;
/// The port to connect to the Dart VM service.
///
/// Default: `8181`.
final int vmServicePort;
/// Initializes a hot reloader that proxies the server created by [generator]. /// Initializes a hot reloader that proxies the server created by [generator].
/// ///
/// [paths] can contain [FileSystemEntity], [Uri], [String] and [Glob] only. /// [paths] can contain [FileSystemEntity], [Uri], [String] and [Glob] only.
/// URI's can be `package:` URI's as well. /// URI's can be `package:` URI's as well.
HotReloader(this.generator, Iterable paths, HotReloader(this.generator, Iterable paths,
{Duration timeout, this.vmServiceUrl: 'ws://localhost:8181/ws'}) { {Duration timeout,
this.vmServiceHost: 'localhost',
this.vmServicePort: 8181}) {
_timeout = timeout ?? new Duration(seconds: 5); _timeout = timeout ?? new Duration(seconds: 5);
_paths.addAll(paths ?? []); _paths.addAll(paths ?? []);
} }
@ -224,16 +232,15 @@ class HotReloader {
} }
_server = null; _server = null;
_client ??= _client ??= await vm.vmServiceConnect(
new VMServiceClient.connect(vmServiceUrl ?? 'ws://localhost:8181/ws'); vmServiceHost ?? 'localhost', vmServicePort ?? 8181);
var vm = await _client.getVM(); var vmachine = await _client.getVM();
var mainIsolate = vm.isolates.first; var mainIsolate = vmachine.isolates.first;
var runnable = await mainIsolate.loadRunnable(); var report = await _client.reloadSources(mainIsolate.id);
var report = await runnable.reloadSources();
if (!report.status) { if (!report.success) {
stderr.writeln('Hot reload failed!!!'); stderr.writeln('Hot reload failed!!!');
stderr.writeln(report.message); stderr.writeln(report.toString());
exit(1); exit(1);
} }

View file

@ -1,6 +1,6 @@
name: angel_hot name: angel_hot
description: Supports hot reloading of Angel servers on file changes. description: Supports hot reloading of Angel servers on file changes.
version: 1.1.0-alpha version: 1.1.0
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:
@ -9,10 +9,7 @@ dependencies:
angel_framework: ^1.1.0-alpha angel_framework: ^1.1.0-alpha
angel_websocket: ^1.1.0-alpha angel_websocket: ^1.1.0-alpha
html_builder: ^1.0.0 html_builder: ^1.0.0
vm_service_client: vm_service_lib: 0.3.5
git:
url: git://github.com/BlackHC/vm_service_client.git
ref: reload_sources_poc
dev_dependencies: dev_dependencies:
angel_test: ^1.0.0 angel_test: ^1.0.0
http: ^0.11.3 http: ^0.11.3