Skip to content

Releases: cloudflare/workers-sdk

wrangler@0.0.8

14 Jan 19:28
f8a97de
Compare
Choose a tag to compare

Patch Changes

  • #231 18f8f65 Thanks @threepointone! - refactor: proxy/preview server

    This PR refactors how we setup the proxy server between the developer and the edge preview service during wrangler dev. Of note, we start the server immediately. We also buffer requests/streams and hold on to them, when starting/refreshing the token. This means a developer should never see ERR_CONNECTION_REFUSED error page, or have an older worker respond after making a change to the code. And when the token does get refreshed, we flush said streams/requests with the newer values, making the iteration process a lot smoother and predictable.

  • #239 0431093 Thanks @Warfields! - Added prompt for users to select an account.

  • #225 b901bf7 Thanks @GregBrimble! - Fix the --watch command for wrangler pages functions build.

  • #208 fe4b099 Thanks @petebacondarwin! - Remove explicit any types from the codebase

    This change removes all use of any from the code and updates the no-explicit-any eslint rule to be an error.

  • #223 a979d55 Thanks @GregBrimble! - Add ability to compile a directory other than functions for wrangler pages functions build.

  • #216 e1c615f Thanks @GregBrimble! - Ignore non-JS files when compiling Pages Functions

  • #217 777f4d5 Thanks @GregBrimble! - Reverse execution order of Pages Functions middlewares

  • #221 8ff5537 Thanks @mrbbot! - Upgrade miniflare to 2.0.0

  • #196 fc112d7 Thanks @jgentes! - allow specifying only "index" without extension or nothing at all for "wrangler dev" and "wrangler publish"

  • #211 3bbfd4f Thanks @GregBrimble! - Silently fail to auto-open the browser in wrangler pages dev command when that errors out.

  • #189 2f7e1b2 Thanks @petebacondarwin! - Refactor raw value extraction from Cloudflare APIs

    Most API responses are JSON of the form:

    { result, success, errors, messages, result_info }
    

    where the result contains the actual response value.

    But some API responses only contain the result value.

    This change refactors the client-side fetch API to allow callers to specify what kind of response they expect.

  • #202 e26781f Thanks @threepointone! - Disable @typescript-lint/no-explicit-any eslint rule in pages code

  • #214 79d0f2d Thanks @threepointone! - rename --public as --experimental-public

  • #215 41d4c3e Thanks @threepointone! - Add --compatibility-date, --compatibility-flags, --latest cli arguments to dev and publish.

    • A cli arg for adding a compatibility data, e.g --compatibility_date 2022-01-05
    • A shorthand --latest that sets compatibility_date to today's date. Usage of this flag logs a warning.
    • latest is NOT a config field in wrangler.toml.
    • In dev, when a compatibility date is not available in either wrangler.toml or as a cli arg, then we default to --latest.
    • In publish we error if a compatibility date is not available in either wrangler.toml or as a cli arg. Usage of --latest logs a warning.
    • We also accept compatibility flags via the cli, e.g: --compatibility-flags formdata_parser_supports_files
  • #210 d381fed Thanks @GregBrimble! - Expose wrangler pages functions build command, which takes the functions folder and compiles it into a single Worker.

    This was already done in wrangler pages dev, so this change just exposes this build command for use in our build image, or for people who want to do it themselves.

  • #213 5e1222a Thanks @GregBrimble! - Adds support for building a Worker from a folder of functions which isn't tied to the Pages platform.

    This lets developers use the same file-based routing system an simplified syntax when developing their own Workers!

  • #199 d9ecb70 Thanks @threepointone! - Refactor inspection/debugging code -

    • I've installed devtools-protocol, a convenient package that has the static types for the devtools protocol (duh) autogenerated from chrome's devtools codebase.
    • We now log messages and exceptions into the terminal directly, so you don't have to open devtools to see those messages.
    • Messages are now buffered until a devtools instance connects, so you won't lose any messages while devtools isn't connected.
    • We don't lose the connection on making changes to the worker, removing the need for the kludgy hack on the devtools side (where we refresh the whole page when there's a change)
  • #189 2f7e1b2 Thanks @petebacondarwin! - Fix pagination handling of list requests to the Cloudflare API

    When doing a list request to the API, the server may respond with only a single page of results.
    In this case, it will also provide a cursor value in the result_info part of the response, which can be used to request the next page.
    This change implements this on the client-side so that we get all the results by requesting further pages when there is a cursor.

  • #220 6fc2276 Thanks @GregBrimble! - Add --live-reload option to wrangler pages dev which automatically reloads HTML pages when a change is detected

  • #223 a979d55 Thanks @GregBrimble! - Add --output-config-path option to wrangler pages functions build which writes a config file describing the functions folder.

wrangler@0.0.7

06 Jan 17:41
19d3833
Compare
Choose a tag to compare

Patch Changes

  • 1fdcfe3: Subfolder Relative Pathing Fix issue #147
    The filename from args didn't handle relative paths passed in from users with scripts in subfolders.
    To handle the subfolder pathing a path.relative using cwd() to user input filepath to the filepath variable passed into Dev

  • 0330ecf: Adds the Content-Type header when serving assets with wrangler pages dev. It guesses the mime-type based on the asset's file extension.

  • eaf40e8: Improve the error message for bad kv:namespace delete commands

  • 562d3ad: chore: enable eslint's no-shadow rule

  • 9cef492: Adds the logic of @cloudflare/pages-functions-compiler directly into wrangler. This generates a Worker from a folder of functions.

    Also adds support for sourcemaps and automatically watching dependents to trigger a re-build.

  • 3426c13: fix: prevent useWorker's inifinite restarts during dev

  • e9a1820: Upgrade miniflare to 2.0.0-rc.5

  • 7156e39: Pass bindings correctly to miniflare/child_process.spawn in dev, to prevent miniflare from erroring out on startup

  • ce2d7d1: Add experimental support for worker-to-worker service bindings. This introduces a new field in configuration experimental_services, and serialises it when creating and uploading a worker definition. This is highly experimental, and doesn't work with wrangler dev yet.

  • 072566f: Fixed KV getNamespaceId preview flag bug

  • 5856807: Improve validation message for kv:namespace create

    Previously, if the user passed multiple positional arguments (which is invalid)
    the error message would suggest that these should be grouped in quotes.
    But this is also wrong, since a namespace binding name must not contain spaces.

  • 34ad323: Refactor the way we convert configurations for bindings all the way through to the API where we upload a worker definition. This commit preserves the configuration structure (mostly) until the point we serialise it for the API. This prevents the way we use duck typing to detect a binding type when uploading, makes the types a bit simpler, and makes it easier to add other types of bindings in the future (notably, the upcoming service bindings.)

wrangler@0.0.6

21 Dec 19:50
2696329
Compare
Choose a tag to compare

Patch Changes

  • 421f2e4: Update base version to 0.0.5, copy the README to packages/wrangler

wrangler@0.0.5

21 Dec 22:49
096197d
Compare
Choose a tag to compare

0.0.5

Patch Changes

  • cea27fe: don't log file contents when writing via kv:key put <key> --path <path>

  • b53cbc8: CI/CD

    • Release flow triggered on PR's closed
  • 43e7a82: When using wrangler pages dev, enable source maps and log unhandled rejections

  • c716abc: Error and exit if the --type option is used for the init command.

    The --type option is no longer needed, nor supported.

    The type of a project is implicitly javascript, even if it includes a wasm (e.g. built from rust).

    Projects that would have had the webpack type need to be configured separately to have a custom build.

  • 3752acf: Add support for websockets in dev, i.e. when developing workers. This replaces the proxy layer that we use to connect to the 'edge' during preview mode, using the faye-wesocket library.

  • c7bee70: Patches typing mismatches between us, undici and miniflare when proxying requests in pages dev, and also adds fallback 404 behavior which was missed

  • 8b6c2d1: Add more fields to the tsconfig.json generated by wrangler init

  • 78cd080: Custom builds for dev and publish

  • cd05d20: import text file types into workers

  • 1216fc9: Export regular functions from dialog.ts, pass tests (followup from #124)

  • 6fc4c50: Display error message when unknown command is provided to the wrangler CLI.

  • 23543fe: Allow the developer to exit init if there is already a toml file

  • 1df6b0c: enable @typescript-eslint/no-floating-promises, pass lint+type check

  • 3c5725f: CI/CD Cleanup

    • Removed the build step from tests, which should speed up the "Tests" Workflow.
    • Added a branch specific trigger for "Release", now the Workflow for "Release" should only work on PRs closed to main
    • Removed the "Changeset PR" Workflow. Now the "Release" Workflow will handle everything needed for Changesets.
  • fb0eae7: support importing .wasm files / workers-rs support

  • e928f94: Improve support for package exports conditionals, including "worker" condition

  • 43e7a82: Upgrade miniflare to 2.0.0-rc.4

  • f473942: Replaces the static asset server with a more faithful simulation of what happens with a production Pages project.

    Also improves error handling and automatically opens the browser when running wrangler pages dev.