Releases: cloudflare/workers-sdk
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Patch Changes
-
#2172
47a142af
Thanks @KianNH! - Validate object size for wrangler r2 put -
#2161
dff756f3
Thanks @jbw1991! - Check for the correct API error code when attempting to detect missing Queues. -
#2165
a26f74ba
Thanks @JacobMGEvans! - Fix Var string type:
The type was not being coerced to a string, so TypeScript considered it a unresolved type.
[email protected]
Patch Changes
-
#2067
758419ed
Thanks @Skye-31! - fix: Accurately determine when using imports in _worker.js for Advanced Mode Pages Functions -
#2159
c5a7557f
Thanks @rozenmd! - fix: silence the 10023 error that throws when deployments isn't fully rolled out -
#2067
758419ed
Thanks @Skye-31! - fix: D1 support for Pages Functions -
#2067
758419ed
Thanks @Skye-31! - chore: Refactor Pages Functions bundling
[email protected]
Minor Changes
-
#2107
511943e9
Thanks @celso! - fix: D1 execute and backup commands improvements- Better and faster handling when importing big SQL files using execute --file
- Increased visibility during imports, sends output with each batch API call
- Backups are now downloaded to the directory where wrangler was initiated from
-
#2130
68f4fa6f
Thanks @matthewdavidrodgers! - feature: Add warnings around bundle sizes for large scriptsPrints a warning for scripts > 1MB compressed, encouraging smaller
script sizes. This warning can be silenced by setting the
NO_SCRIPT_SIZE_WARNING env variableIf a publish fails with either a script size error or a validator error
on script startup (CPU or memory), we print out the largest 5
dependencies in your bundle. This is accomplished by using the esbuild
generated metafile. -
#2064
49b6a484
Thanks @jbw1991! - Adds support for Cloudflare Queues. Adds new CLI commands to configure Queues. Queue producers and consumers can be defined in wrangler.toml. -
#1982
5640fe88
Thanks @penalosa! - Enable support forwrangler dev
on Workers behind Cloudflare Access, utilisingcloudflared
. If you don't havecloudflared
installed, Wrangler will prompt you to install it. If you do, then the first time you start developing usingwrangler dev
your default browser will open with a Cloudflare Access prompt.
Patch Changes
-
#2134
b164e2d6
Thanks @jspspike! - Added current version to publish output -
#2127
0e561e83
Thanks @JacobMGEvans! - Fix: Missing Worker name using--from-dash
Added the--from-dash
name as a fallback when no name is provided in thewrangler init
command.
Additionally added a checks to thestd.out
to ensure that the name is provided.resolves #1853
-
#2073
1987a79d
Thanks @mrbbot! - If--env <env>
is specified, we'll now check.env.<env>
/.dev.vars.<env>
first.
If they don't exist, we'll fallback to.env
/.dev.vars
. -
#2072
06aa6121
Thanks @mrbbot! - Fixed importing installed npm packages with the same name as Node built-in
modules ifnode_compat
is disabled. -
#2124
02ca556c
Thanks @JacobMGEvans! - Computing the name from binding response
Now thevars
will be computed, example:
[var.binding.name]: var.binding.text
this will resolve the issue that was occurring with
generating a TOML with incorrect fields for thevars
key/value pair.resolves #2048
@cloudflare/[email protected]
Patch Changes
- #2146
c987fceb
Thanks @GregBrimble! - feat: Add afailOpen
prop to the deployment metadata.
[email protected]
Patch Changes
-
#2103
f1fd62a1
Thanks @GregBrimble! - fix: Don't uploadfunctions/
directory as part ofwrangler pages publish
If the root directory of a project was the same as the build output directory, we were previously uploading the
functions/
directory as static assets. This PR now ensures that thefunctions/
files are only used to create Pages Functions and are no longer uploaded as static assets.Additionally, we also now do upload
_worker.js
,_headers
,_redirects
and_routes.json
if they aren't immediate children of the build output directory. Previously, we'd ignore all files with this name regardless of location. For example, if you have apublic/blog/how-to-use-pages/_headers
file (wherepublic
is your build output directory), we will now upload the_headers
file as a static asset. -
#2111
ab52f771
Thanks @GregBrimble! - feat: Add apassThroughOnException()
handler in Pages FunctionsThis
passThroughOnException()
handler is not as good as the built-in for Workers. We're just adding it now as a stop-gap until we can do the behind-the-scenes plumbing required to make the built-in function work properly.We wrap your Pages Functions code in a
try/catch
and on failure, if you callpassThroughOnException()
we defer to the static assets of your project.For example:
export const onRequest = ({ passThroughOnException }) => { passThroughOnException(); x; // Would ordinarily throw an error, but instead, static assets are served. };
-
#2117
aa08ff7c
Thanks @nprogers! - Added error logging for pages upload
[email protected]
Patch Changes
-
#2074
b08ab1e5
Thanks @JacobMGEvans! - The type command aggregates bindings and custom module rules from config, then generates a DTS file for both service workers'declare global { ... }
or module workers'interface Env { ... }
Custom module rules generate
declare module
s based on the module type (Text
,Data
orCompiledWasm
).
Module Example Outputs:CompiledWasm
declare module "**/*.wasm" { const value: WebAssembly.Module; export default value; }
Data
declare module "**/*.webp" { const value: ArrayBuffer; export default value; }
Text
declare module "**/*.text" { const value: string; export default value; }
-
#2065
14c44588
Thanks @CarmenPopoviciu! - fix(pages):wrangler pages dev
matches routing rules in_routes.json
too looselyCurrently, the logic by which we transform routing rules in
_routes.json
to
regular expressions, so we can performpathname
matching & routing when we
runwrangler pages dev
, is too permissive, and leads to serving incorrect
assets for certain url paths.For example, a routing rule such as
/foo
will incorrectly match pathname
/bar/foo
. Similarly, pathname/foo
will be incorrectly matched by the
/
routing rule.
This commit fixes our routing rule to pathname matching logic and brings
wrangler pages dev
on par with routing in deployed Pages projects. -
#2098
2a81caee
Thanks @threepointone! - feat: delete site/assets namespace when a worker is deletedThis patch deletes any site/asset kv namespaces associated with a worker when
wrangler delete
is used. It finds the namespace associated with a worker by using the names it would have otherwise used, and deletes it. It also does the same for the preview namespace that's used withwrangler dev
. -
#2091
9491d86f
Thanks @JacobMGEvans! - Wrangler deployments command
Added support for the deployments command, which allows you to list the last ten deployments for a given script.The information will include:
- Version ID
- Version number
- Author email
- Latest deploy
- Created on
resolves #2089
-
#2068
2c1fd9d2
Thanks @mrbbot! - Fixed issue where information and warning messages from Miniflare were being
discarded when usingwrangler dev --local
. Logs from Miniflare will now be
coloured too, if the terminal supports this.