worktop

The next generation web framework for Cloudflare Workers

MIT License

Downloads
324K
Stars
1.7K
Committers
6
worktop - v0.8.0-next.18 Latest Release

Published by lukeed 9 months ago

Breaking

  • 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

worktop - v0.8.0-next.16

Published by lukeed 9 months ago

Patches


Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.15...v0.8.0-next.16

worktop - v0.8.0-next.15

Published by lukeed over 1 year ago

Patches

  • Add types conditions for "exports" map (#175): bdc0695
  • fix(cfw): fix structuredClone typo (#163): 406f5e3
    Thank you @leader22
  • fix(cfw): add structuredClone and queueMicrotask types: 4f251a4
  • fix(cfw): add HTMLRewriter types: 1bb1e7e
  • fix(cfw): declare Headers.getAll method signature: 3f8c224

Chores

  • Bump tsm version: e3df8cc
  • Bump uvu version: baaf2fe
  • Bump bundt version: b377001

Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.14...v0.8.0-next.15

worktop - v0.8.0-next.14

Published by lukeed over 2 years ago

Breaking

  • (worktop/cfw.kv): Only allow JSON data for Entity (#161): d8b0d1b
    See linked PR for explainer

Patches

  • (worktop/cfw.kv): Ensure internal Cache entity keys are URL-friendly: d1f9d5c
  • (worktop/cfw.kv): Accept type-argument in Entity definition: 6f47542

Chores

  • Update broken *.d.ts links within README (#160): 74e84c0
    Thank you @dotysan~!

Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.13...v0.8.0-next.14

worktop - v0.8.0-next.13

Published by lukeed over 2 years ago

Features

  • (worktop/cfw.kv) Add Entity class (#159): 9b3b10a, b85e39b

Patches

  • (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

Chores

  • Use bundt@next for building monorepo packages (#152): 42b8dc5, e7d537a
  • (WIP/DEFERRED) Contribute Database class from worktop/cfw.durable (#148, #149): f402194, f9f6f10, 867322f
    Thank you @eidam!

Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.12...v0.8.0-next.13

worktop -

Published by lukeed over 2 years ago

Patches

  • (worktop/cfw): Do not pass ctx parameter thru to run directly: 235d800
worktop -

Published by lukeed over 2 years ago

Features

  • (worktop/cfw): Add Module.Service type interface: 2f5dd4d
    Definition provided for the Workers Services beta
worktop - v0.8.0-next.10

Published by lukeed almost 3 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): 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

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: https://github.com/lukeed/worktop/compare/v0.8.0-next.9...v0.8.0-next.10

worktop - v0.8.0-next.9

Published by lukeed almost 3 years ago

Patches

  • (durable): Correct state.blockConcurrencyWhile types & usage (#116, #120 ): 1f9e34f
    Thank you @ConProgramming~!
  • (cache): Do not cache a Response with a 101 status code (#121): 9457785
  • (router): Mark the context parameter within Initializer as optional (#120): ce6872b
  • (cors) Remove origin scope hoisting (#118): 88f0433

Chores

  • Update the README and "kv-todos" examples (#111): 4d9f210
    Thank you @itsmatteomanf~!
  • Bump typescript version: 428a2d4

Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.8...v0.8.0-next.9

worktop - v0.8.0-next.8

Published by lukeed almost 3 years ago

Features

  • 🆕 Add worktop/kv.assets module (#85): 5de5a54, 684766b

Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.6...v0.8.0-next.8

worktop - v0.8.0-next.6

Published by lukeed almost 3 years ago

Patches

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

Chores

  • Bump devDependency versions: 223990c

Full Changelog: https://github.com/lukeed/worktop/compare/v0.8.0-next.5...v0.8.0-next.6

worktop -

Published by lukeed about 3 years ago

Patches

  • Copy each worktop module's type definitions file into correct output location (#98): 9cd866d
    Was an issue with the build command monorepo setup, only affecting 0.8.0-next.4.
    Thank you @tylerbrostrom~!
worktop -

Published by lukeed about 3 years ago

NOTE: Experimental release!

Features

  • Add support for child Routers (#96, #29): 29d0badf104fb481deeb4db920f68872cd399fb5
  • Add worktop.build CLI utility (#94, #82): 9e689da41be6993856ed7832e20706e4ec28fb37

Chores

  • Move to monorepo/multi-packages setup: 5a3aeba96f8da4277d6b7ce3328d9300c09d7b9c..ebb19769841d58b482fa5f7395576438992e61cb
worktop -

Published by lukeed about 3 years ago

NOTE: Experimental release!

Patches

  • (buffer) Do not eagerly instantiate utf-16le TextDecoder instance: d75d5cf
    This allows the buffer.from method to work. Cloudflare Workers does not (currently) support this encoding.
worktop -

Published by lukeed about 3 years ago

NOTE: Experimental release!

Breaking

  • 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

    • move ModuleContext from root to Module.Context
    • rename ModuleWorker -> Module.Worker

Features

  • Add new worktop/jwt module (#87): 6446958
  • Add new worktop/buffer module (#89): c31d938
  • (crypto) Add MD5, HMAC and named HMAC* exports (#84): ad7ac05

Chores

  • Use paths pattern for tsconfig resolution: 2f94d38
worktop -

Published by lukeed about 3 years ago

NOTE: Experimental release!

Breaking

  • Rework Handler signature (#83): bc8ab8e
    See #83 for extended notes and explanations. Breaking changes include:

    • Move STATUS_CODES from worktop to worktop/response module
    • Remove worktop/request module entirely
    • Rework worktop/cors return values for new Handler signatures
    • Remove method from ServerResponse constructor

Features

  • Add worktop/durable module (#80): 2877802
  • Add worktop/modules submodule (#75): 129c39d
worktop -

Published by lukeed about 3 years ago

Patches

  • (ws): Add stricter WebSocket event listeners: a167925
  • (ws): Improve listen and connect type signatures: 7d42b7b
  • (types): Add passThroughOnException to FetchEvent interface: a5dbbbd

Chores

  • Include copy of MIT license: 1f57a73
  • Adjust tsconfig.json configuration: 961f817
worktop -

Published by lukeed about 3 years ago

Patches

  • (ws): Correct connect TypeScript definition (#68): ed509df
  • (utils): Replace custom uuid function with crypto.randomUUID native: 3fb1e21

Chores

  • Run CI suite on Node 16 only: c09214f
  • Run tests with require('crypto').webcrypto native polyfill: d02bc9f
  • Bump typescript version: f046253
worktop -

Published by lukeed over 3 years ago

Patches

  • (request) Ensure req.extend has valid binding (#65, #66): d81ec10
    Prevents Illegal Invocation error

  • (cookie) Correct the stringify type definition so that its options param is optional (#63): e17a330
    Thank you @maraisr

worktop -

Published by lukeed over 3 years ago

Breaking

  • (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.

Features

  • Allow the reply utilities to accept custom request parameter: ca7ae9a
    See #53 for a possible use case.

Chores

  • bump regexparam version: c065a2b
Package Rankings
Top 1.57% on Npmjs.org
Related Projects