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

outdatedDart 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:

  • 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 #

library hop_runner;

import 'dart:async';
import 'dart:io';
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";
  
  // Copy out static linked assets such as packages/browser/dart.js
  Task co = createCopyOutTask(entryPointPath);
  addTask("co", co);
  
  // Fix Urls in entrypoint to point to static assets and appropriate main Javascript file.
  Task fixjs = createFixUrlTask("output/simple.html", outputType:WebuiTargetType.JS);
  addTask("fixjs",fixjs);
  
  // Call DWC and dart2js compilers.
  ChainedTask w2d2js = createWebui2JsTask(entryPointPath);
  addTask("w2d2js", w2d2js);
  
  // Run all three tasks at once to deploy Javascript from webui.
  addChainedTask('deployjs', ['w2d2js','co','fixjs']);
  
  // Fix Urls in entrypoint to point to static assets and appropriate minified main Dart script file.
  Task fixmd = createFixUrlTask("output/simple.html", outputType:WebuiTargetType.MINIDART);
  addTask("fixmd", fixmd);
  
  ChainedTask w2d2d = createWebui2MiniDartTask(entryPointPath);
  addTask("w2d2d", w2d2d);
  
  // Run all three tasks at once to deploy Minidart from webui.
  addChainedTask('deploymd', ['w2d2d','co','fixmd']);
  
  runHop();
}

Deploy project as Javascript #

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

Deploy project as mini dart #

  1. Run in webui project root as dart tool/hop_runner.dart deploymd
  2. Open output/simple.html in Chromium.

From example in sample webui project

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, web_ui

More

Packages that depend on webui_tasks