🚧 Changelog

0.10.0#

Date: 2021-11-25

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

0.9.5#

Date: 2021-11-25

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

0.9.4#

Date: 2021-11-17

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

0.9.3#

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.

0.9.2#

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.

0.9.1#

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.

0.9.0#

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!

0.8.0#

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!).

0.7.2#

Date: 2021-05-24

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

0.7.1#

Date: 2021-02-14

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

0.7.0#

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.