luce 0.0.13

Tiny web framework inspired by hyperapp and Flutter.

Work in progress.

0.0.13 #

  • Simplified approach to attributes and class names.

0.0.12 #

  • Separate state-handling utilities in their own library that does not depend on dart:html.
  • Fixed bugs with invalidated vnodes being used during update operations.

0.0.11 #

  • Break up code in core and std libraries.

0.0.10 #

  • Begun mouse and keyboard event support.
  • On-the-fly wrapping of Text nodes in Span elements as needed.

0.0.9 #

  • Introduce more linter rules.

0.0.8 #

  • Extensive code reorganization.
  • Remove fake DOM.
  • Experiments with Widgets for dynamic attributes.

0.0.7 #

  • Bumped Dart SDK version to 2.1.0.
  • Formatting cleanup.

0.0.6 #

  • Hide private class Xn.

0.0.5 #

  • Support fake DOM for testing.
  • Various refactoring and renaming.

0.0.4 #

  • Localized tree rebuild with less rework.
  • Support arbitrary changes to Element child lists.

0.0.3 #

  • Support localized tree rebuild.

0.0.2 #

  • Reimplementation begun. Supporting only the simplest DOM scenarios.

0.0.1 #

  • Initial import, a modified Dart port of hyperapp.

example/luce_example.dart

import 'package:luce/std.dart';

void main() {
  final Counter counter = Counter();
  final Widget widget = CounterComponent(counter);

  mount(widget, querySelector('#output'));

  window.onKeyPress.listen((event) {
    counter.up();
  });
}

class Counter with ChangeNotification {
  int _value = 0;

  void up() {
    _value += 1;
    notify();
  }

  int get value => _value;
}

class CounterComponent extends Component {
  CounterComponent(this.counter);

  final Counter counter;

  @override
  Widget build(BuildContext context) {
    context.rebuildOn(counter.changes);
    return MouseEvents(
      onClick: (e) => counter.up(),
      child: Div(children: [
        const Txt('Your Luce app is running.'),
        const Br(),
        Div(
          classes: (counter.value > 7) ? const ['high'] : const [],
          children: [Txt('Counter value is ${counter.value}')],
        ),
      ]),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  luce: ^0.0.13

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:luce/state.dart';
import 'package:luce/std.dart';
import 'package:luce/vdom.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Aug 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: web

Platform components identified in package: html.

Health issues and suggestions

Document public APIs. (-1 points)

184 out of 184 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
meta ^1.1.6 1.1.7
Dev dependencies
luce_test
test any