webui_tasks 0.1.3 copy "webui_tasks: ^0.1.3" to clipboard
webui_tasks: ^0.1.3 copied to clipboard

Dart 1 only

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:

  1. Compile webui components to Javascript in one console step as well as minidart compilation (dart to dart).
  2. Fix the relative Urls in the output Webui entry point Html file.
  3. 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 #

  1. Run in webui project root as: dart tool/hop_runner.dart w2d2js then dart tool/hop_runner.dart deploy.
  2. Open output/simple.html in any modern browser. See hosted example.

Deploy project as mini dart #

  1. Change app.json so that app points to the _bootstrap.compiled.dart file.
  2. Run in webui project root as dart tool/hop_runner.dart w2d2d then dart tool/hop_runner.dart deploy.
  3. Open output/simple.html in Chromium.

Authors #

Acknowledgements #

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A webui task library based on Hop.

Repository (GitHub)
View/report issues

Dependencies

bot, hop, html5lib, json_object, web_ui

More

Packages that depend on webui_tasks