github lukeed/worktop v0.8.0-next.10

latest releases: v0.8.0-next.18, v0.8.0-next.16, v0.8.0-next.17...
pre-release2 years ago

Breaking

IMPORTANT
There are several breaking changes in this release.
Going forward, worktop is a platform agnostic framework, offering a core set of modules that will work anywhere that supports the core set of Web APIs that are necessary. At time of this release, this includes Cloudflare Workers, Service Workers (web), and Deno. Adding Node.js support is planned for a near-future release.

As part of this, worktop needed to rearrange — aka separate — the Cloudflare-specific methods & TypeScript interfaces away from the core modules and move them into namespaced submodules specific to Cloudflare. This pattern will be followed for other platforms with their own platform-specific types and/or behaviors, too.

For example, as shown below, the worktop/kv module has been renamed to worktop/cfw.kv because it belongs to (and only works with) Cloudflare. Similarly, there's a worktop/ws core module, which includes shared WebSocket utility, but there are also the woktop/deno.ws and worktop/cfw.ws modules, which include implementations specific to Deno and Cloudflare, respectively.

It is highly recommended you follow along #125, #132, #134, and #139 for more information and explanations.

  • (worktop/cache): Generalize worktop/cache module (#139): 985150b
    Add a cache argument to the lookup, save, and sync methods.
    Note: Existing users can use worktop/cfw.cache for a drop-in replacement.

  • (worktop/ws): Move the listen method & CF-specific types to the new worktop/cfw.ws module (#134): 504328d
    Previously, the worktop/ws module had Cloudflare-specific information within it.
    It's now general-purpose and all Cloudflare-specific contents have been moved to the (new) worktop/cfw.ws module. See #133 for more info

  • Rename worktop/kv to worktop/cfw.kv: abf3d8a

  • Rename worktop/kv.assets to worktop/cfw.kv.assets: 78ab152

  • Rename worktop/durable to worktop/cfw.durable: 92339d3

  • (worktop/sw): Removed reply and listen; use start instead.

  • (worktop/cache): Removed reply and listen; use start instead.

  • (worktop/module): Deleted. See worktop/cfw instead.

  • (worktop/ws): Move WebSocketPair global type to worktop/cfw module: 9572f22

  • (worktop): Move CronEvent to worktop/cfw module: e3af56c

  • (worktop): Move Bindings to worktop/cfw module: 88f7d93

Features

  • Adds Deno support via the new worktop/deno module: 5bae9a5
    Offers a start export which can run a worktop Router in Deno Deploy or a standard Deno runtime.

  • Add worktop/deno.ws module: 91d8e73
    A WebSocket module specifically for the Deno environment; see #133

  • Add worktop/cfw.cache module (#139): 3f516de
    A module for the Cache API specifically for the Cloudflare environment.

Patches

  • (worktop/sw): Ensure ctx.waitUntil is forwarded: 61a558f
    In Cloudflare environment, the previous ...ctx destructure hid the waitUntil & passThrough methods.

Full Changelog: v0.8.0-next.9...v0.8.0-next.10

Don't miss a new worktop release

NewReleases is sending notifications on new releases.