Skip to content

v0.50.0 — parameterized providers

Choose a tag to compare

@tshafer tshafer released this 11 Jul 16:22
· 107 commits to main since this release

Service providers — Keel's plugin system — now take options at registration, closing the last gap against Fastify's plugin model.

  • app.register(RateLimitProvider, { max: 100 }) — options are handed to the provider constructor, typed via ServiceProvider<{ max: number }> and read as this.options.
  • The same provider class registers more than once with different options, so a provider is genuinely reusable.
  • Backward compatible — options default to {}.

On the two Fastify references checked:

  • Middleware — already fully covered (native Hono middleware at global / route / group / resource level, plus a named-middleware registry). Nothing to add.
  • Plugins — Service Providers are Keel's equivalent; this release adds the options they were missing. Encapsulation (Fastify's scoped plugins) stays out by design — Keel is a single global-container framework; per-request scoping is middleware.

322 tests; type-checked doc examples. See docs/providers.md.