Migration Guide
The v7 docs assume a different center of gravity than older Spry guides. The framework is now documented around file routing, generated output, and runtime targets selected in config.
The headline shift
Old docs were centered on:
createSpry()- imperative route registration such as
app.get(...) - group-based route composition
- standalone server examples written by hand
The v7 docs are centered on:
routes/as the source of truthspry buildandspry servedefineSpryConfig(...)- a generated
Spry(...)app and target-specific runtime entrypoint
What to replace
Imperative route registration
If you previously wrote app.get('/users/:id', handler);, move that logic into routes/users/[id].dart.
Route groups
If you relied on app.group(...), stop modeling route structure in code. Use folders plus _middleware.dart for scope-level behavior.
Manual server adapters
If your mental model was “I write the server wrapper myself”, move that concern into spry.config.dart and target selection.
Request helpers
Prefer the request-scoped Event object:
event.requestevent.headersevent.paramsevent.localsevent.context
The migration path that usually works
- Move route logic into
routes/. - Add
spry.config.dart. - Replace shared wrappers with
middleware/and scoped_middleware.dart. - Replace ad-hoc error translation with scoped
_error.dart. - Run
dart run spry serveand inspect the generated output.