Wrangler Changelog
2024-07-03
3.63.0
#6167
e048958
Thanks @threepointone! - feature: alias modules in the workerSometimes, users want to replace modules with other modules. This commonly happens inside a third party dependency itself. As an example, a user might have imported
node-fetch
, which will probably never work in workerd. You can use the alias config to replace any of these imports with a module of your choice.Let’s say you make a
fetch-nolyfill.js
export default fetch; // all this does is export the standard fetch function`You can then configure
wrangler.toml
like so:# ...[alias]"node-fetch": "./fetch-nolyfill"So any calls to
import fetch from 'node-fetch';
will simply use our nolyfilled version.You can also pass aliases in the cli (for both
dev
anddeploy
). Like:npx wrangler dev --alias node-fetch:./fetch-nolyfill#6073
7ed675e
Thanks @geelen! - Added D1 export support for local databases#6149
35689ea
Thanks @RamIdeas! - refactor: React-free hotkeys implementation, behind the--x-dev-env
flag#6022
7951815
Thanks @CarmenPopoviciu! - fix: Fixpages dev
watch mode [Functions]The watch mode in
pages dev
for Pages Functions projects is currently partially broken, as it only watches for file system changes in the “/functions” directory, but not for changes in any of the Functions’ dependencies. This means that given a Pages Functionmath-is-fun.ts
, defined as follows:import { ADD } from "../math/add"; export async function onRequest() { return new Response(`${ADD} is fun!`); }
pages dev
will reload for any changes inmath-is-fun.ts
itself, but not for any changes inmath/add.ts
, which is its dependency.Similarly,
pages dev
will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports.This commit fixes all these things, plus adds some extra polish to the
pages dev
watch mode experience.#6164
4cdad9b
Thanks @threepointone! - fix: use account id for listing zonesFixes https://github.com/cloudflare/workers-sdk/issues/4944
Trying to fetch
/zones
fails when it spans more than 500 zones. The fix to use an account id when doing so. This patch passes the account id to the zones call, threading it through all the functions that require it.#6180
b994604
Thanks @Skye-31! - Fix: pass env to getBindings to support reading.dev.vars.{environment}
https://github.com/cloudflare/workers-sdk/pull/5612 added support for selecting the environment of config used, but it missed passing it to the code that reads
.dev.vars.{environment}
Closes #5641
#6124
d03b102
Thanks @RamIdeas! - feat:url
andinspectorUrl
properties have been exposed on the worker object returned bynew unstable_DevEnv().startWorker(options)
#6147
02dda3d
Thanks @penalosa! - refactor: React free dev registry#6127
1568c25
Thanks @DaniFoldi! - fix: Bump ws dependency#6140
4072114
Thanks @petebacondarwin! - fix: add extra error logging to auth response errors#6160
9466531
Thanks @sm-bean! - fix: removes unnecessary wrangler tail warning against resetting durable object#6142
9272ef5
Thanks @dario-piotrowicz! - fix: improve thegetPlatformProxy
configPath
option ts-doc comment to clarify its behavior
2024-06-25
3.62.0
#5950
0075621
Thanks @WalshyDev! - feat: addwrangler versions secret put
,wrangler versions secret bulk
andwrangler versions secret list
wrangler versions secret put
allows for you to add/update a secret even if the latest version is not fully deployed. A new version with this secret will be created, the existing secrets and config are copied from the latest version.wrangler versions secret bulk
allows you to bulk add/update multiple secrets at once, this behaves the same assecret put
and will only make one new version.wrangler versions secret list
lists the secrets available to the currently deployed versions.wrangler versions secret list --latest-version
orwrangler secret list
will list for the latest version.Additionally, we will now prompt for extra confirmation if attempting to rollback to a version with different secrets than the currently deployed.
#6118
1621992
Thanks @WalshyDev! - fix: rollback in the case of a secret change, the prompt meant to show was not showing due to the spinner in an interactive env. It will now properly show.chore: improve the view of
wrangler versions view
and change up copy a little forversions secret
commands.#6105
26855f3
Thanks @helloimalastair! - feat: Add help messages to all invalidr2
commands#3735
9c7df38
Thanks @lrapoport-cf! - chore: Cleanupwrangler --help
outputThis commit cleans up and standardizes the look and feel of all
wrangler
commands as displayed bywrangler --help
andwrangler <cmd> --help
.#6080
e2972cf
Thanks @threepointone! - chore: run eslint (with react config) on workers-playground/wranglerThis enables eslint (with our react config) for the workers-playground project. Additionally, this enables the react-jsx condition in relevant tsconfig/eslint config, letting us write jsx without having React in scope.
#6001
d39d595
Thanks @penalosa! - chore: changes to howwrangler dev
launches your worker, behind the experimental--x-dev-env
flag#5214
05c5607
Thanks @penalosa! - feat: Experimental file based service discovery when running multiple Wrangler instances locally. To try it out, make sure all your local Wrangler instances are running with the--x-registry
flag.Updated dependencies [
7d02856
,d4e1e9f
]:- miniflare@3.20240620.0
- @cloudflare/kv-asset-handler@0.3.4
2024-06-18
3.61.0
#5995
374bc44
Thanks @petebacondarwin! - feat: allow Durable Object migrations to be overridable in environmentsBy making the
migrations
key inheritable, users can provide different migrations for each wrangler.toml environment.Resolves #729
#6039
dc597a3
Thanks @petebacondarwin! - fix: hybrid nodejs compat now supports requiring the default export of a CJS moduleFixes #6028
#6051
15aff8f
Thanks @threepointone! - fix: Don’t check expiry dates on custom certsFixes https://github.com/cloudflare/workers-sdk/issues/5964
For
wrangler dev
, we don’t have to check whether certificates have expired when they’re provided by the user.#6052
b4c0233
Thanks @threepointone! - chore: Add.wrangler
and.DS_Store
to.gitignore
generated bywrangler init
This commit adds a small QOL improvement to
init
(to be deprecated in the future), for those who still use this wrangler command.#6050
a0c3327
Thanks @threepointone! - chore: Normalize more depsThis is the last of the patches that normalize dependencies across the codebase. In this batch:
ws
,vitest
,zod
,rimraf
,@types/rimraf
,ava
,source-map
,glob
,cookie
,@types/cookie
,@microsoft/api-extractor
,@types/mime
,@types/yargs
,devtools-protocol
,@vitest/ui
,execa
,strip-ansi
This patch also sorts dependencies in every
package.json
#6029
f5ad1d3
Thanks @threepointone! - chore: Normalize some dependencies in workers-sdkThis is the first of a few expected patches that normalize dependency versions, This normalizes
undici
,concurrently
,@types/node
,react
,react-dom
,@types/react
,@types/react-dom
,eslint
,typescript
. There are no functional code changes (but there are a couple of typecheck fixes).#6046
c643a81
Thanks @threepointone! - chore: Normalize more dependencies.Follow up to https://github.com/cloudflare/workers-sdk/pull/6029, this normalizes some more dependencies :
get-port
,chalk
,yargs
,toucan-js
,@typescript-eslint/parser
,@typescript-eslint/eslint-plugin
,esbuild-register
,hono
,glob-to-regexp
,@cloudflare/workers-types
#6058
31cd51f
Thanks @threepointone! - chore: Quieter buildsThis patch cleans up warnings we were seeing when doing a full build. Specifically:
- fixtures/remix-pages-app had a bunch of warnings about impending features that it should be upgraded to, so I did that. (tbh this one needs a full upgrade of packages, but we’ll get to that later when we’re upgrading across the codebase)
- updated
@microsoft/api-extractor
so it didn’t complain that it didn’t match thetypescript
version (that we’d recently upgraded) - it also silenced a bunch of warnings when exporting types from
wrangler
. We’ll need to fix those, but we’ll do that when we work on unstable_dev etc. - workers-playground was complaining about the size of the bundle being generated, so I increased the limit on it
#6043
db66101
Thanks @threepointone! - fix: avoid esbuild warning when running dev/bundleI’ve been experimenting with esbuild 0.21.4 with wrangler. It’s mostly been fine. But I get this warning every time
▲ [WARNING] Import "__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__" will always be undefined because there is no matching export in "src/index.ts" [import-is-undefined] .wrangler/tmp/bundle-Z3YXTd/middleware-insertion-facade.js:8:23: 8 │ .....(OTHER_EXPORTS.__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__ ?? []), ╵
This is because esbuild@0.18.5 enabled a warning by default whenever an undefined import is accessed on an imports object. However we abuse imports to inject stuff in
middleware.test.ts
. A simple fix is to only inject that code in tests.#6062
267761b
Thanks @WalshyDev! - fix: typo inwrangler d1 execute
saying “Databas” instead of “Database”#6064
84e6aeb
Thanks @helloimalastair! - fix: Wrangler is now able to upload files to local R2 buckets above the 300 MiB limitUpdated dependencies [
a0c3327
,f5ad1d3
,31cd51f
]:- miniflare@3.20240610.1
- @cloudflare/kv-asset-handler@0.3.3
2024-06-14
3.60.3
#6025
122ef06
Thanks @IgorMinar! - fix: avoid path collisions between performance and Performance Node.js polyfillsIt turns out that ESBuild paths are case insensitive, which can result in path collisions between polyfills for
globalThis.performance
andglobalThis.Performance
, etc.This change ensures that we encode all global names to lowercase and decode them appropriately.
#6009
169a9fa
Thanks @RamIdeas! - fix: reduce the number of parallel file reads on Windows to avoid EMFILE type errorsFixes #1586
53acdbc
Thanks @petebacondarwin! - fix: warn if user tries normal deploy when in the middle of a gradual version rolloutUpdated dependencies [
c4146fc
]:
2024-06-11
3.60.2
#5307
e6a3d24
Thanks @achanda! - fix: add more timePeriods towrangler d1 insights
This PR updates
wrangler d1 insights
to accept arbitrary timePeriod values up to 31 days.
2024-06-10
3.60.1
- #6002
f1f1834
Thanks @GregBrimble! - Revert a change in 3.60.0 which incorrectly batched assets for Pages uploads ( https://github.com/cloudflare/workers-sdk/pull/5632).