The next generation web framework for Cloudflare Workers
MIT License
Changed matching behavior of optional wildcard routes (eg; /books/*?
): 0f4d4a6
See [email protected]
release notes for more info.
Changed the context.params
wildcard value key from "wild"
to "*"
: d770b39
See [email protected]
release notes for more info.
API.add('GET', '/foo/*', (req, context) => {
-- let value = context.params.wild;
++ let value = context.params['*'];
});
Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.16...v0.8.0-next.18
Published by lukeed 9 months ago
mrmime
version (#180): 8c5855c[email protected]
release notesFull Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.15...v0.8.0-next.16
Published by lukeed over 1 year ago
types
conditions for "exports"
map (#175): bdc0695structuredClone
typo (#163): 406f5e3structuredClone
and queueMicrotask
types: 4f251a4HTMLRewriter
types: 1bb1e7eHeaders.getAll
method signature: 3f8c224tsm
version: e3df8ccuvu
version: baaf2febundt
version: b377001Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.14...v0.8.0-next.15
Published by lukeed over 2 years ago
worktop/cfw.kv
): Only allow JSON data for Entity
(#161): d8b0d1bworktop/cfw.kv
): Ensure internal Cache
entity keys are URL-friendly: d1f9d5cworktop/cfw.kv
): Accept type-argument in Entity
definition: 6f47542*.d.ts
links within README (#160): 74e84c0Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.13...v0.8.0-next.14
Published by lukeed over 2 years ago
worktop/cfw.kv
) Add Entity
class (#159): 9b3b10a, b85e39b(worktop/cfw
) Update request.cf
type definitions (#157): 2c1589b, 24e758d
Thank you @eugene1g
(worktop/cache
) Only allow RFC7231 status codes to be cached (#143): a3fd957
bundt@next
for building monorepo packages (#152): 42b8dc5, e7d537aDatabase
class from worktop/cfw.durable
(#148, #149): f402194, f9f6f10, 867322fFull Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.12...v0.8.0-next.13
Published by lukeed almost 3 years ago
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
): 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): 504328d4abc73af449f5a2b12f0c13477fdf6174
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
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.
worktop/sw
): Ensure ctx.waitUntil
is forwarded: 61a558f...ctx
destructure hid the waitUntil
& passThrough
methods.
Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.9...v0.8.0-next.10
Published by lukeed almost 3 years ago
durable
): Correct state.blockConcurrencyWhile
types & usage (#116, #120 ): 1f9e34fcache
): Do not cache a Response
with a 101
status code (#121): 9457785router
): Mark the context
parameter within Initializer
as optional (#120): ce6872bcors
) Remove origin
scope hoisting (#118): 88f0433typescript
version: 428a2d4Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.8...v0.8.0-next.9
Published by lukeed almost 3 years ago
worktop/kv.assets
module (#85): 5de5a54, 684766bFull Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.6...v0.8.0-next.8
Published by lukeed almost 3 years ago
Ensure UTF8 encodings within worktop/crypto
and worktop/jwt
(#102): e8f8307
An unintended consequence of #89 (specifically https://github.com/lukeed/worktop/pull/89/commits/2b2943166443f0fe3527efac4251f45992713d2b) was that the worktop/crypto
utilities moved from utf8
-based to binary
-based encoding. This PR reverts that change, which is necessary because it's how/what all HMAC/Digest/etc functions expect to work with.
While investing this, I noticed that the workop/jwt
module wasn't properly enforcing the UTF8 encoding either (where necessary).
devDependency
versions: 223990cFull Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.5...v0.8.0-next.6
NOTE: Experimental release!
worktop.build
CLI utility (#94, #82): 9e689da41be6993856ed7832e20706e4ec28fb37packages
setup: 5a3aeba96f8da4277d6b7ce3328d9300c09d7b9c..ebb19769841d58b482fa5f7395576438992e61cbNOTE: Experimental release!
Added a new worktop/buffer
module (#89)! But in the process, moved some things out of the worktop/utils
module:
utils.encode
-> buffer.asUTF8
utils.decode
-> buffer.toUTF8
utils.Encoder
-> buffer.Encoder
(utf8)utils.Decoder
-> removed
utils.HEX
-> buffer.HEX
utils.toHEX
-> buffer.toHEX
utils.viaHEX
-> buffer.asHEX
Rename worktop/modules
-> worktop/module
: d390d69
(worktop/module) Export Module
namespace: 92c1aff
ModuleContext
from root to Module.Context
ModuleWorker
-> Module.Worker
worktop/jwt
module (#87): 6446958worktop/buffer
module (#89): c31d938MD5
, HMAC
and named HMAC*
exports (#84): ad7ac05paths
pattern for tsconfig
resolution: 2f94d38NOTE: Experimental release!
Rework Handler
signature (#83): bc8ab8e
See #83 for extended notes and explanations. Breaking changes include:
STATUS_CODES
from worktop
to worktop/response
moduleworktop/request
module entirelyworktop/cors
return values for new Handler
signaturesmethod
from ServerResponse
constructorworktop/durable
module (#80): 2877802worktop/modules
submodule (#75): 129c39dWebSocket
event listeners: a167925listen
and connect
type signatures: 7d42b7bpassThroughOnException
to FetchEvent
interface: a5dbbbdtsconfig.json
configuration: 961f817connect
TypeScript definition (#68): ed509dfuuid
function with crypto.randomUUID
native: 3fb1e21require('crypto').webcrypto
native polyfill: d02bc9ftypescript
version: f046253(utils) Move uid
to alphanum alphabet (#54, #57): ce3cd09
Before this version, the uid
export inside worktop/utils
was using a hexadecimal alphabet (abcdef1234567890
), which it shared with the uuid
export.
As of this version, the uid
utility is not using a full alphanumeric dictionary instead: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_
This change allows for more combinations given the same output length. For example, to produce a 6-character string:
// hexadecimal (before)
6 ** 16; // 2.8211099e+12 possibilities
// alphanumeric (after)
6 ** 64; // 6.3340287e+49 possibilities
Creating a 1280-length character string using the current hexadecimal format has 5.1922969e+49
combinations, which is still fewer than a 6-length alphanumeric (full) alphabet.
This is a breaking change because changing the dictionary changes the possible contents of the uid
output.
(router) Remove find
public method (#58): eacefc9
This method should never have been used in the first place. Removing it now to pave the way for a future feature release, which requires that find
does not exist.
reply
utilities to accept custom request
parameter: ca7ae9aregexparam
version: c065a2b