routed_hotwire 0.1.4 copy "routed_hotwire: ^0.1.4" to clipboard
routed_hotwire: ^0.1.4 copied to clipboard

Turbo and Stimulus helpers for the routed backend framework.

routed_hotwire #

Pub Version CI License Sponsor

Turbo/Stimulus helpers for the routed framework. The package wires Hotwire responses, server-rendered stream updates, and Stimulus command helpers into the Routed engine so you can build interactive hybrids without leaving Dart.

Features #

  • Response helpers for Turbo Streams, frames, redirects, and flash messages.
  • Stimulus controller scaffolds and middleware to register assets.
  • Testing utilities layered on top of routed_testing / server_testing.
  • Example apps showing Hotwire navigation, optimistic updates, and logging.

Install #

dependencies:
  routed: ^0.4.0
  routed_hotwire: ^0.1.3

Turbo-first apps typically include routed, routed_testing, and server_testing dev dependencies as well.

Usage #

import 'package:routed/routed.dart';
import 'package:routed_hotwire/routed_hotwire.dart';

Future<void> main() async {
  registerRoutedProviders();
  final engine = await Engine.create();

  engine.post('/notes', (ctx) async {
    final content = ctx.query('content')?.toString() ?? '';
    return ctx.turboStream(turboStreamAppend(
      target: 'notes',
      html: '<li>$content</li>',
    ));
  });

  await engine.serve(port: 8080);
}

routed_hotwire does not register a service provider. The routed facade initializes the official Routed providers; the Hotwire package adds response and stream helpers to the engine context.

See the example/ directory for a runnable Todo app with Turbo navigation and Stimulus controllers.

Funding #

If this adapter saves you time, consider supporting the work on Buy Me a Coffee.

0
likes
0
points
305
downloads

Publisher

unverified uploader

Weekly Downloads

Turbo and Stimulus helpers for the routed backend framework.

Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

www.buymeacoffee.com

License

unknown (license)

Dependencies

crypto, intl, routed_core, routed_logging, routed_views

More

Packages that depend on routed_hotwire