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 toworktop/cfw.kv
because it belongs to (and only works with) Cloudflare. Similarly, there's aworktop/ws
core module, which includes shared WebSocket utility, but there are also thewoktop/deno.ws
andworktop/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
): Generalizeworktop/cache
module (#139): 985150b
Add acache
argument to thelookup
,save
, andsync
methods.
Note: Existing users can useworktop/cfw.cache
for a drop-in replacement. -
(
worktop/ws
): Move thelisten
method & CF-specific types to the newworktop/cfw.ws
module (#134): 504328d
Previously, theworktop/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
toworktop/cfw.kv
: abf3d8a -
Rename
worktop/kv.assets
toworktop/cfw.kv.assets
: 78ab152 -
Rename
worktop/durable
toworktop/cfw.durable
: 92339d3 -
(
worktop/sw
): Removedreply
andlisten
; usestart
instead. -
(
worktop/cache
): Removedreply
andlisten
; usestart
instead. -
(
worktop/module
): Deleted. Seeworktop/cfw
instead. -
(
worktop/ws
): MoveWebSocketPair
global type toworktop/cfw
module: 9572f22 -
(
worktop
): MoveCronEvent
toworktop/cfw
module: e3af56c -
(
worktop
): MoveBindings
toworktop/cfw
module: 88f7d93
Features
-
Adds Deno support via the new
worktop/deno
module: 5bae9a5
Offers astart
export which can run a worktopRouter
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
): Ensurectx.waitUntil
is forwarded: 61a558f
In Cloudflare environment, the previous...ctx
destructure hid thewaitUntil
&passThrough
methods.
Full Changelog: v0.8.0-next.9...v0.8.0-next.10