yjbanov / butterfly

A web framework for Dart based on Flutter's widget model
Apache License 2.0
156 stars 13 forks source link

Run Butterfly out of process #10

Closed yjbanov closed 7 years ago

yjbanov commented 7 years ago

This series of commits introduces a dev-server mode that runs the framework and application code outside of the main process in a dev server, which is a plain command-line Dart VM. The browser-side code is a small static JS script that communicates with the dev server via a synchronous XHR. Much of the work was about completely removing the dependency of dart:html and replacing it with lib/src/protocol.dart, lib/dev_server.dart, and web/dev_server_client.js. The latter is adaptation of code from https://github.com/yjbanov/barista2/ (mostly sync.js, sync.cpp and api.cpp).

This change probably breaks a great many things, but the tests are passing and TodoMVC app seems to run fine. I think now is a logical step to get it in and iterate from here. Now that we can run in the plain VM we can start working on hot code reloading.

jonahwilliams commented 7 years ago

Awesome! I will take a look later tonight.