🚧 Changelog


Date: 2021-11-25

  • Upgrade http-errors package to major version 2.0.0 which also upgrades a transitive dependency which used eval.


Date: 2021-11-25

  • Undo the workaround introduced in 0.9.3 for Miniflare support - it is no longer needed.


Date: 2021-11-17

  • Added "type": "module" to the package.json


Date: 2021-11-16

  • Updated to new Cloudflare workers types package, allowing for stricter typing of response.webSocket field.
  • Added workaround to support Miniflare (and the underlying undici library) out of the box.


Date: 2021-10-04

  • Added Context.response.overwrite which allows you to overwrite the Response built up so far. This is very useful in the context of Durable Objects, in which you may want to forward the response.


Date: 2021-10-03

  • Add webSocket field to Response to match Cloudflare's (non-standard) API.
  • You can now pass null to construct a body.


Date: 2021-10-02

  • Breaking Change: Context.state has been renamed to Context.data to prevent confusion when using Durable Objects.
  • The Sunder app constructor now takes a state argument for injecting Durable Object state.
  • Context.state now contains a Durable Worker state (if any), this means that Sunder now has first class Durable Objects support!


Date: 2021-09-27

  • Breaking Change: All Sunder types now take an additional EnvironmentType generic type argument, it is the first such argument (before ParamsType and StateType).
    The tl;dr fix is to replace Context<{id: string}> with Context<{}, {id: string}>.
  • Performance improvement for get, set and has shorthands on ctx.request an anonymous function was created on every invocation before this change.
  • Support for modules build-mode in Cloudflare Workers.
    • A new fetch method was added to Sunder applications that has the same signature as the
    • The handle method on Sunder now takes a second argument where you can provide your own env in case you are not using modules.
    • The Sunder Context now has a env field, which is type-checked by the Typescript compiler (and supports auto-completion!).


Date: 2021-05-24

  • Changed self.Blob to globalThis.Blob to support different environments more easily.


Date: 2021-02-14

  • Added missing Router#options function to the router to handle OPTIONS requests.


Date:: 2021-01-31

  • Potentially breaking change: Rename createError to createHttpError (not exposed from top level Sunder package, but you may have imported it anyway).
  • Handlers and Middleware now have a second generic argument, their StateType, which allows you to type what context.state your handler/middleware expects.
  • The Router class now has a generic type argument, which allows you to define the type of context.state when it enters your Router.