Wrangler Changelog
2024-03-12
3.33.0
#4930
2680462Thanks @rozenmd! - refactor: defaultwrangler d1 executeandwrangler d1 migrationscommands to local mode first, to matchwrangler devThis PR defaults
wrangler d1 executeandwrangler d1 migrationscommands to use the local development environment provided by wrangler to match the default behaviour inwrangler dev.BREAKING CHANGE (for a beta feature):
wrangler d1 executeandwrangler d1 migrationscommands now default--localtotrue. When runningwrangler d1 executeagainst a remote D1 database, you will need to provide the--remoteflag.#5184
046930eThanks @nora-soderlund! - fix: change d1 migrations create to use the highest migration number rather than the first non-existing migration number to allow for gaps in the migration files.
2024-03-07
3.32.0
#5148
11951f3Thanks @dom96! - chore: bumpworkerdto1.20240304.0#5148
11951f3Thanks @dom96! - fix: use python_workers compat flag for Python#5089
5b85dc9Thanks @DaniFoldi! - fix: include all currently existing bindings inwrangler typesAdd support for Email Send, Vectorize, Hyperdrive, mTLS, Browser Rendering and Workers AI bindings in
wrangler typesFor example, from the following
wrangler.tomlsetup:[browser]binding = "BROWSER"[ai]binding = "AI"[[send_email]]name = "SEND_EMAIL"[[vectorize]]binding = "VECTORIZE"index_name = "VECTORIZE_NAME"[[hyperdrive]]binding = "HYPERDRIVE"id = "HYPERDRIVE_ID"[[mtls_certificates]]binding = "MTLS"certificate_id = "MTLS_CERTIFICATE_ID"Previously, nothing would have been included in the generated Environment. Now, the following will be generated:
interface Env {SEND_EMAIL: SendEmail;VECTORIZE: VectorizeIndex;HYPERDRIVE: Hyperdrive;MTLS: Fetcher;BROWSER: Fetcher;AI: Fetcher;}
2024-03-05
3.31.0
#5119
b0bd413Thanks @garrettgu10! - feature: Python support for remote dev#5118
30694a3Thanks @garrettgu10! - fix: Including version identifiers in Python requirements.txt will now throw an error#5132
82a3f94Thanks @mrbbot! - fix: switch default logging level ofunstable_dev()towarnWhen running
unstable_dev()in its default “test mode”, the logging level was set tonone. This meant any Worker startup errors or helpful warnings wouldn’t be shown. This change switches the default towarn. To restore the previous behaviour, includelogLevel: "none"in your options object:const worker = await unstable_dev("path/to/script.js", {logLevel: "none",});#5128
d27e2a7Thanks @taylorlee! - fix: Add legacy_env support to experimental versions upload command.#5087
a5231deThanks @dario-piotrowicz! - fix: makewrangler typesalways generate ad.tsfile for module workersCurrently if a config file doesn’t define any binding nor module, running
wrangler typesagainst such file would not produce ad.tsfile.Producing a
d.tsfile can however still be beneficial as it would define a correct env interface (even if empty) that can be expanded/referenced by user code (this can be particularly convenient for scaffolding tools that may want to always generate an env interface).Example: Before
wrangler types --env-interface MyEnvrun with an emptywrangler.tomlfile would not generate any file, after these change it would instead generate a file with the following content:interface MyEnv { }#5138
3dd9089Thanks @G4brym! - fix: ensure Workers-AI local mode fetcher returns headers to client worker
2024-02-29
3.30.1
#5106
2ed7f32Thanks @RamIdeas! - fix: automatically drain incoming request bodiesPreviously, requests sent to
wrangler devwith unconsumed bodies could result inNetwork connection losterrors. This change attempts to work around the issue by ensuring incoming request bodies are drained if they’re not used. This is a temporary fix whilst we try to address the underlying issue. Whilst we don’t think this change will introduce any other issues, it can be disabled by setting theWRANGLER_DISABLE_REQUEST_BODY_DRAINING=trueenvironment variable. Note this fix is only applied if you’ve enabled Wrangler’s bundling—--no-bundlemode continues to have the previous behaviour.#5107
65d0399Thanks @penalosa! - fix: Ensures that switching to remote mode during a dev session (from local mode) will correctly use the right zone. Previously, zone detection happened before the dev session was mounted, and so dev sessions started with local mode would have no zone inferred, and would have failed to start, with an ugly error.#5107
65d0399Thanks @penalosa! - fix: Ensure that preview sessions created without a zone don’t switch the host on which to start the preview from the one returned by the API.#4833
54f6bfcThanks @admah! - fix: remove extra arguments from wrangler init deprecation message and update recommended c3 versionc3 can now infer the pre-existing type from the presence of the
--existing-scriptflag so we can remove the extratypeargument. C3 2.5.0 introduces an auto-update feature that will make sure users get the latest minor version of c3 and prevent problems where older 2.x.x versions get cached by previous runs ofwrangler init.
2024-02-27
3.30.0
#4742
c2f3f1eThanks @benycodes! - feat: allow preserving file names when defining rules for non-js modulesThe developer is now able to specify the `preserve_file_names property in wrangler.toml which specifies whether Wrangler will preserve the file names additional modules that are added to the deployment bundle of a Worker.
If not set to true, files will be named using the pattern ${fileHash}-${basename}. For example,
34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico.Resolves #4741
Updated dependencies [
0c0949d]:
2024-02-22
3.29.0
#5042
5693d076Thanks @dario-piotrowicz! - feat: add new--env-interfacetowrangler typesAllow users to specify the name of the interface that they want
wrangler typesto generate for theenvparameter, via the new CLI flag--env-interfaceExample:
wrangler types --env-interface CloudflareEnvgenerates
interface CloudflareEnv {}instead of
interface Env {}#5042
5693d076Thanks @dario-piotrowicz! - feat: add newpathpositional argument towrangler typesAllow users to specify the path to the typings (.d.ts) file they want
wrangler typesto generateExample:
wrangler types ./my-env.d.tsgenerates a
my-env.d.tsfile in the current directory instead of creating aworker-configuration.d.tsfile#5042
5693d076Thanks @dario-piotrowicz! - feat: include command run in thewrangler typescommentIn the comment added to the
.d.tsfile generated bywrangler typesinclude the command run to generated the file#4303
1c460287Thanks @richardscarrott! - fix: allow Pages Functions to import built-in node:* modules, even when not bundling with wrangler#4957
50f93bd2Thanks @garrettgu10! - fix: don’t strip.pyextensions from Python modules#5042
5693d076Thanks @dario-piotrowicz! - fix: makewrangler typeshonor top level config argumentThe
wrangler typescommand currently ignores the-c|--configargument (although it is still getting shown in the command’s help message). Make sure that the command honors the flag. Also, if no config file is detected present a warning to the user#5042
5693d076Thanks @dario-piotrowicz! - fix: make thewrangler typescommand pick up local secret keys from.dev.varsMake sure that the
wrangler typescommand correctly picks up secret keys defined in.dev.varsand includes them in the generated file (marking them as genericstringtypes of course)Updated dependencies [
b03db864]:
2024-02-20
3.28.4
#5050
88be4b84Thanks @nora-soderlund! - fix: allow kv:namespace create to accept a namespace name that contains characters not allowed in a binding nameThis command tries to use the namespace name as the binding. Previously, we would unnecessarily error if this namespace name did not fit the binding name constraints. Now we accept such names and then remove invalid characters when generating the binding name.
2024-02-16
3.28.3
#5026
04584722Thanks @dario-piotrowicz! - fix: make suregetPlatformProxyproduces a production-likecachesobjectmake sure that the
cachesobject returned togetPlatformProxybehaves in the same manner as the one present in production (where calling unsupported methods throws a helpful error message)note: make sure that the unsupported methods are however not included in the
CacheStoragetype definition#5030
55ea0721Thanks @mrbbot! - fix: don’t suggest reporting user errors to GitHubWrangler has two different types of errors: internal errors caused by something going wrong, and user errors caused by an invalid configuration. Previously, we would encourage users to submit bug reports for user errors, even though there’s nothing we can do to fix them. This change ensures we only suggest this for internal errors.
#4900
3389f2e9Thanks @OilyLime! - feature: allow hyperdrive users to set local connection string as environment variableWrangler dev now supports the HYPERDRIVE_LOCAL_CONNECTION_STRING environmental variable for connecting to a local database instance when testing Hyperdrive in local development. This environmental variable takes precedence over the localConnectionString set in wrangler.toml.
#5033
b1ace91bThanks @mrbbot! - fix: wait for actual port before opening browser with--port=0Previously, running
wrangler dev --remote --port=0and then immediately pressingbwould openlocalhost:0in your default browser. This change queues up opening the browser until Wrangler knows the port the dev server was started on.#5026
04584722Thanks @dario-piotrowicz! - fix: relax thegetPlatformProxy’s’ cache request/response typesprior to these changes the caches obtained from
getPlatformProxywould useunknowns as their types, this proved too restrictive and incompatible with the equivalent@cloudflare/workers-typestypes, we decided to useanys instead to allow for more flexibility whilst also making the type compatible with workers-typesUpdated dependencies [
7723ac17,027f9719,027f9719,027f9719,027f9719,027f9719,027f9719]: