routed_hotwire 0.1.1
routed_hotwire: ^0.1.1 copied to clipboard
Turbo and Stimulus helpers for the routed backend framework.
routed_hotwire #
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_hotwire: ^0.1.0
Turbo-first apps typically include routed, routed_testing, and
server_testing dev dependencies as well.
Usage #
import 'package:routed_hotwire/routed_hotwire.dart';
router.post('/notes', (ctx) async {
final note = await notes.create(ctx.input('content'));
return turboStream((streams) {
streams.append('#notes', renderNote(note));
});
});
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.