Skip to content

Releases: cloudflare/workers-sdk

@cloudflare/pages-shared@0.11.2

30 Nov 19:01
97727de
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [1b348782]:
    • miniflare@3.20231030.2

wrangler@3.17.1

22 Nov 19:16
7438e5c
Compare
Choose a tag to compare

Patch Changes

  • #4474 382ef8f5 Thanks @mrbbot! - fix: open browser to correct url pressing b in --remote mode

    This change ensures Wrangler doesn't try to open http://* when * is used as the dev server's hostname. Instead, Wrangler will now open http://127.0.0.1.

  • #4488 3bd57238 Thanks @RamIdeas! - Changes the default directory for log files to workaround frameworks that are watching the entire .wrangler directory in the project root for changes

    Also includes a fix for commands with --json where the log file location message would cause stdout to not be valid JSON. That message now goes to stderr.

wrangler@3.17.0

21 Nov 21:14
f728503
Compare
Choose a tag to compare

Minor Changes

  • #4341 d9908743 Thanks @RamIdeas! - Wrangler now writes all logs to a .log file in the .wrangler directory. Set a directory or specific .log filepath to write logs to with WRANGLER_LOG_PATH=../Desktop/my-logs/ or WRANGLER_LOG_PATH=../Desktop/my-logs/my-log-file.log. When specifying a directory or using the default location, a filename with a timestamp is used.

    Wrangler now filters workerd stdout/stderr and marks unactionable messages as debug logs. These debug logs are still observable in the debug log file but will no longer show in the terminal by default without the user setting the env var WRANGLER_LOG=debug.

Patch Changes

  • #4469 d5e1966b Thanks @mrbbot! - fix: report correct line and column numbers when source mapping errors with wrangler dev --remote

  • #4455 1747d215 Thanks @rozenmd! - fix: make it possible to ignore hyperdrive warnings

  • #4456 805d5241 Thanks @dario-piotrowicz! - add warnings about ai and verctorize bindings not being supported locally

  • #4478 7b54350b Thanks @penalosa! - Don't log sensitive data to the Wrangler debug log file by default. This includes API request headers and responses.

  • Updated dependencies [be2b9cf5, d9908743]:

    • miniflare@3.20231030.1

miniflare@3.20231030.1

21 Nov 21:14
f728503
Compare
Choose a tag to compare

Minor Changes

  • #4348 be2b9cf5 Thanks @mrbbot! - feat: add support for wrapped bindings

    This change adds a new wrappedBindings worker option for configuring
    workerd's wrapped bindings.
    These allow custom bindings to be written as JavaScript functions accepting an
    env parameter of "inner bindings" and returning the value to bind. For more
    details, refer to the API docs.

  • #4341 d9908743 Thanks @RamIdeas! - Added a handleRuntimeStdio which enables wrangler (or any other direct use of Miniflare) to handle the stdout and stderr streams from the workerd child process. By default, if this option is not provided, the previous behaviour is retained which splits the streams into lines and calls console.log/console.error.

create-cloudflare@2.7.1

21 Nov 21:14
f728503
Compare
Choose a tag to compare

Patch Changes

  • #4441 01d34f21 Thanks @dependabot! - C3: Bumped create-svelte from 5.1.1 to 5.2.0

  • #4461 fe1e6d8a Thanks @dependabot! - C3: Bumped @angular/create from 17.0.0-rc.4 to 17.0.1

  • #4462 144a431a Thanks @dependabot! - C3: Bumped create-next-app from 13.4.19 to 14.0.3

  • #4292 75c3d4a7 Thanks @dario-piotrowicz! - Only commit the changes if the repository was generated (directly or not) by C3

    (This follows what CLI tools seems to generally do, avoids weird corner case
    behaviors users might have for example when running C3 inside monorepos and avoids commits
    when people don't want or expect them)

@cloudflare/pages-shared@0.11.1

21 Nov 21:14
f728503
Compare
Choose a tag to compare

Patch Changes

create-cloudflare@2.7.0

17 Nov 14:10
1747d21
Compare
Choose a tag to compare

Minor Changes

Patch Changes

  • #4311 35be4594 Thanks @jculvey! - Changes c3 to use npx for running framework creation tools when it is invoked with yarn. This is
    needed since yarn can't yarn create some-package@some-particular-version.
  • #4226 5810f815 Thanks @jculvey! - Relax empty directory check. Directories containing certain common config files and/or files created by an ide will be exempt from the pre-flight check
  • #4249 b18a2c0f Thanks @dario-piotrowicz! - improve help message by adding more detailed descriptions about the various CLI options
    also let the user know that more information is available in the Cloudflare docs
  • #4279 2526794f Thanks @dnasdw! - fix: use a valid compatibility date for the scheduled worker ts template

@cloudflare/pages-shared@0.11.0

17 Nov 14:11
1747d21
Compare
Choose a tag to compare

Minor Changes

  • #4051 4578d647 Thanks @taoky! - fix: remove extension name check when generating response

    Current regex logic to check whether a pathname is a file (has file extension) is causing trouble for some websites, and now ${pathname}/index.html is always checked before returning notFound().

Patch Changes

wrangler@3.16.0

17 Nov 14:08
08615aa
Compare
Choose a tag to compare

Minor Changes

  • #4347 102e15f9 Thanks @Skye-31! - Feat(unstable_dev): Provide an option for unstable_dev to perform the check that prompts users to update wrangler, defaulting to false. This will prevent unstable_dev from sending a request to NPM on startup to determine whether it needs to be updated.
  • #4179 dd270d00 Thanks @matthewdavidrodgers! - Simplify secret:bulk api via script settings

    Firing PUTs to the secret api in parallel has never been a great solution - each request independently needs to lock the script, so running in parallel is at best just as bad as running serially.

    Luckily, we have the script settings PATCH api now, which can update the settings for a script (including secret bindings) at once, which means we don't need any parallelization. However this api doesn't work with a partial list of bindings, so we have to fetch the current bindings and merge in with the new secrets before PATCHing. We can however just omit the value of the binding (i.e. only provide the name and type) which instructs the config service to inherit the existing value, which simplifies this as well. Note that we don't use the bindings in your current wrangler.toml, as you could be in a draft state, and it makes sense as a user that a bulk secrets update won't update anything else. Instead, we use script settings api again to fetch the current state of your bindings.

    This simplified implementation means the operation can only fail or succeed, rather than succeeding in updating some secrets but failing for others. In order to not introduce breaking changes for logging output, the language around "${x} secrets were updated" or "${x} secrets failed" is kept, even if it doesn't make much sense anymore.

Patch Changes

  • #4402 baa76e77 Thanks @rozenmd! - This PR adds a fetch handler that uses page, assuming result_info provided by the endpoint contains page, per_page, and total

    This is needed as the existing fetchListResult handler for fetching potentially paginated results doesn't work for endpoints that don't implement cursor.

    Fixes #4349

  • #4337 6c8f41f8 Thanks @Skye-31! - Improve the error message when a script isn't exported a Durable Object class

    Previously, wrangler would error with a message like Uncaught TypeError: Class extends value undefined is not a constructor or null. This improves that messaging to be more understandable to users.

  • #4307 7fbe1937 Thanks @jspspike! - Change local dev server default ip to * instead of 0.0.0.0. This will cause the dev server to listen on both ipv4 and ipv6 interfaces

miniflare@3.20231030.0

16 Nov 21:50
08615aa
Compare
Choose a tag to compare

Minor Changes

  • #4324 16cc2e92 Thanks @penalosa! - Update to latest workerd@1.20231030.0

  • #4322 8a25b7fb Thanks @dario-piotrowicz! - add unsafeEvalBinding option

    Add option to leverage the newly introduced UnsafeEval workerd binding API,
    such API is used to evaluate javascript code at runtime via the provided eval and newFunction methods.

    The API, for security reasons (as per the workers docs), is not to be use in production but it is intended for local purposes only such as local testing.

    To use the binding you need to specify a string value for the unsafeEvalBinding, such will be the name of the UnsafeEval bindings that will be made available in the workerd runtime.

    For example the following code shows how to set the binding with the UNSAFE_EVAL name and evaluate the 1+1 string:

    const mf = new Miniflare({
    	log,
    	modules: true,
    	script: `
          export default {
              fetch(req, env, ctx) {
                  const two = env.UNSAFE_EVAL.eval('1+1');
                  return new Response('two = ' + two); // returns 'two = 2'
              }
          }
      `,
    	unsafeEvalBinding: "UNSAFE_EVAL",
    });

Patch Changes

  • #4397 4f8b3420 Thanks @mrbbot! - fix: reject Miniflare#ready promise if Miniflare#dispose() called while waiting

  • #4428 3637d97a Thanks @mrbbot! - fix: add miniflare bin entry

    Miniflare 3 doesn't include a CLI anymore, but should log a useful error stating this when running npx miniflare. We had a script for this, but it wasn't correctly hooked up. 🤦 This change makes sure the required bin entry exists.

  • #4321 29a59d4e Thanks @mrbbot! - fix: ensure Mutex doesn't report itself as drained if locked

    Previously, Miniflare's Mutex implementation would report itself as drained
    if there were no waiters, regardless of the locked state. This bug meant that
    if you called but didn't await Miniflare#setOptions(), future calls to
    Miniflare#dispatchFetch() (or any other asynchronous Miniflare method)
    wouldn't wait for the options update to apply and the runtime to restart before
    sending requests. This change ensures we wait until the mutex is unlocked before
    reporting it as drained.

  • #4307 7fbe1937 Thanks @jspspike! - Only output ipv4 addresses when starting

  • #4400 76787861 Thanks @mrbbot! - fix: cleanup temporary directory after shutting down workerd

    Previously on exit, Miniflare would attempt to remove its temporary directory
    before shutting down workerd. This could lead to EBUSY errors on Windows.
    This change ensures we shutdown workerd before removing the directory.
    Since we can only clean up on a best effort basis when exiting, it also catches
    any errors thrown when removing the directory, in case the runtime doesn't
    shutdown fast enough.