shelf_hotreload
1.6.0, released a year ago by felix-blaschke.de
Wrapper to easily enable hot-reload for shelf applications.
What it does
Provides a wrapper function to enable hot-reload for Dart shelf web applications. It hooks into the VM service to automatically restart the server when code changes occur.
AI-written summary of version 1.6.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are developing a shelf backend application in Dart
- You want to speed up your backend development workflow with hot-reload
Skip it when
- You are building a Flutter frontend application
- You are running in a production environment where VM service is disabled
Strengths
- Easy to set up with a single function call
- Supports custom logging and lifecycle callbacks
Weaknesses
- Requires running the Dart application with the --enable-vm-service flag
- Limited to shelf-based Dart backend applications
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Run the application with the --enable-vm-service flag or use debug run in your IDE.
void main() async {
withHotreload(() => createServer());
}
Future<HttpServer> createServer() {
handler(shelf.Request request) => shelf.Response.ok('hot!');
return io.serve(handler, 'localhost', 8080);
}Works with
Packages commonly used together with shelf_hotreload: ones it builds on, ones built on it, and its own family.
- loggingshelf_hotreload depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- hotreloadershelf_hotreload depends on itAutomatic hot code reloader for Dart projects that applies file changes to the running process.
- dart_frogBuilt on shelf_hotreloadA minimalistic Dart backend framework with a built‑in dev server and Docker support.
- shelf_plusBuilt on shelf_hotreloadQuality of life addon for server-side development within the Shelf platform.