webui_tasks 0.1.2 webui_tasks: ^0.1.2 copied to clipboard
A webui task library based on Hop.
A Webui task library based on Hop. #
What is Webui? #
Webui allows you to create web applications like you would legos, piecing the framework from reusable components. See article for an introduction.
What is Hop? #
Hop is a framework that simplifies and automates console tasks in Dart. See Hop Pub package for more information. Also see article for a quick tutorial.
How will this library help me? #
This library will allow you to:
- Compile webui components to Javascript in one console step as well as minidart compilation (dart to dart).
- Fix the relative Urls in the output Webui entry point Html file.
- Copy static assets such as Javascript linked from the entry point Html file into the target output directory.
Dart Documentation coming soon.
How do I get started? #
Add the following dependency:
dependencies:
webui_tasks: any
Example #
Setup app.json
to tell tasks how to deploy application. From example in sample webui project:
{"link":
{"style/simple.css":"."},
"script":
{
"packages/browser/dart.js":"lib/dart.js",
"lib/testme.js":"."
},
"app":
{
"simple.html_bootstrap.dart":"simple.html_bootstrap.dart.js"
}
}
From example in sample webui project:
library hop_runner;
import 'dart:async';
import 'dart:io';
import 'dart:json';
import 'package:hop/hop.dart';
import 'package:hop/hop_tasks.dart';
import 'package:webui_tasks/webui_tasks.dart';
void main() {
String entryPointPath = "web/simple.html";
// Call DWC and dart2js compilers.
ChainedTask w2d2js = createWebui2JsTask(entryPointPath);
addTask("w2d2js", w2d2js);
ChainedTask w2d2d = createWebui2MiniDartTask(entryPointPath);
addTask("w2d2d", w2d2d);
Task deploy = createDeployTask("output/simple.html","web/app.json");
addTask("deploy", deploy);
runHop();
}
Deploy project as Javascript #
- Run in webui project root as:
dart tool/hop_runner.dart w2d2js
thendart tool/hop_runner.dart deploy
. - Open
output/simple.html
in any modern browser. See hosted example.
Deploy project as mini dart #
- Change
app.json
so thatapp
points to the_bootstrap.compiled.dart
file. - Run in webui project root as
dart tool/hop_runner.dart w2d2d
thendart tool/hop_runner.dart deploy
. - Open
output/simple.html
in Chromium.
Authors #
- Damon Douglas (+Damon Douglas)
- You? File bugs. Fork and Fix bugs. Let's build this community.
Acknowledgements #
- Kevin Moore for his work on the Hop and Webui Widget libraries, from which much of this code and methodology derives.
- Seth Ladd for his original idea that inspired the project.