Skip to content
pubscout

shelf_hotreload

1.6.0, released a year ago by felix-blaschke.de

Wrapper to easily enable hot-reload for shelf applications.

$ flutter pub add shelf_hotreload
Source repository

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.