Skip to content

Commit d0c976c

Browse files
dependabot[bot]Wrangler automated PR updaterdario-piotrowiczpetebacondarwin
authored
Bump the workerd-and-workers-types group across 1 directory with 2 updates (#15123)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wrangler automated PR updater <wrangler@cloudflare.com> Co-authored-by: Dario Piotrowicz <dario@cloudflare.com> Co-authored-by: Pete Bacon Darwin <pbacondarwin@cloudflare.com>
1 parent 90dd5e5 commit d0c976c

47 files changed

Lines changed: 1728 additions & 652 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"miniflare": minor
3+
---
4+
5+
Add local support for `WorkflowInstance.delete()` and `Workflow.deleteBatch()`
6+
7+
The updated `@cloudflare/workers-types` now requires `delete()` on workflow instances and `deleteBatch()` on the workflow binding. These methods are now implemented in the local workflows simulator so that local dev and tests match the production API.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"miniflare": patch
3+
"wrangler": patch
4+
---
5+
6+
Update dependencies of "miniflare", "wrangler"
7+
8+
The following dependency versions have been updated:
9+
10+
| Dependency | From | To |
11+
| ------------------------- | ------------- | ------------- |
12+
| @cloudflare/workers-types | ^5.20260804.1 | ^5.20260811.1 |
13+
| workerd | 1.20260804.1 | 1.20260811.1 |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@cloudflare/vitest-pool-workers": patch
3+
---
4+
5+
Widen `WorkerPoolOptionsContext.inject` type to avoid `ProvidedContext` mismatch
6+
7+
Previously, calling `inject()` inside `cloudflareTest()` pool options could fail with a type error when your project's `ProvidedContext` augmentation wasn't visible to the pool plugin. The `inject` parameter now accepts any string key and is generic (`inject<T>(key)`), defaulting to `unknown` when no type argument is provided. This lets you opt in to concrete types (e.g. `inject<number>("port")`) while avoiding the cross-copy `ProvidedContext` mismatch that occurred when pnpm resolved separate virtual-store instances of vitest.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@cloudflare/autoconfig": patch
3+
"create-cloudflare": patch
4+
"wrangler": patch
5+
---
6+
7+
Stop adding a redundant `nodejs_compat` flag to generated Wrangler configurations
8+
9+
`create-cloudflare` and `wrangler setup` write today's date as the `compatibility_date`, and from `2026-08-04` that already enables `nodejs_compat`. Adding the flag as well made the generated project fail to start with "The compatibility flag nodejs_compat became the default as of 2026-08-04 so does not need to be specified anymore", so the flag is now only added for earlier compatibility dates.
10+
11+
`create-cloudflare` also removes the flag when a template, or a framework's own scaffolder, already wrote it into a configuration that ends up using such a compatibility date, and still installs `@types/node` for these projects even though there is no longer a flag to detect them by.
12+
13+
`wrangler setup` does the same for a `wrangler.json(c)` that is already in the project: it writes today's date over whatever date that configuration was written for, so a `nodejs_compat` it finds there is removed as part of writing the file.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"@cloudflare/vitest-pool-workers": patch
3+
"@cloudflare/vite-plugin": minor
4+
"miniflare": minor
5+
"wrangler": minor
6+
---
7+
8+
Detect Node.js compatibility from the compatibility date, now that `nodejs_compat` is enabled by default
9+
10+
As of compatibility date `2026-08-04`, workerd enables the `nodejs_compat` and `nodejs_compat_v2` compatibility flags by default. Previously these tools only treated Node.js compatibility as enabled when one of those flags was listed explicitly, so a Worker on a compatibility date of `2026-08-04` or later without the flag would get Node.js APIs from the runtime but no Node.js polyfills from the bundler, and `process.env` could be substituted with an empty object at build time. They now resolve these flags the same way workerd does, and honour `no_nodejs_compat` to opt out.
11+
12+
#### If you hit "does not need to be specified anymore"
13+
14+
workerd rejects a compatibility flag that its compatibility date already enables, so a Worker that sets both a compatibility date of `2026-08-04` or later **and** `nodejs_compat` now fails to start or deploy with:
15+
16+
```
17+
The compatibility flag nodejs_compat became the default as of 2026-08-04 so does not need to be specified anymore.
18+
```
19+
20+
This is expected: bumping a compatibility date is how you opt in to behaviour changes. To fix it, remove the flag — Node.js compatibility remains enabled via the compatibility date:
21+
22+
```jsonc
23+
// wrangler.json
24+
{
25+
"compatibility_date": "2026-08-04",
26+
// "compatibility_flags": ["nodejs_compat"] <-- remove this
27+
}
28+
```
29+
30+
Note that if you do not set a `compatibility_date` at all, Wrangler, the Vite plugin and the Vitest pool infer today's date on your behalf, so you can hit this without having changed your own configuration. Either remove the flag as above, or set an explicit `compatibility_date` earlier than `2026-08-04`.
31+
32+
To keep Node.js compatibility switched off on a newer compatibility date, specify both `no_nodejs_compat` and `no_nodejs_compat_v2`, since each flag has its own default.
33+
34+
`@cloudflare/vitest-pool-workers` needs `nodejs_compat_v2` for its own test runner, so it continues to override a project that opts out of it. On a compatibility date that enables the flag anyway, it now drops the opt-out rather than adding the flag back, which workerd would reject — previously this stopped such a project from running any tests at all.
35+
36+
`wrangler types` also no longer attributes its `@types/node` suggestion to "the `nodejs_compat` flag", which it can now make for Workers that do not set the flag at all.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@cloudflare/workers-utils": minor
3+
---
4+
5+
Add `NODEJS_COMPAT_DEFAULT_ON_DATE`, `NODEJS_COMPAT_V2_SWITCH_OVER_DATE`, `isNodejsCompatDefaultOn()` and `resolveNodejsCompat()`
6+
7+
These expose the compatibility dates on which workerd started enabling `nodejs_compat` by default and on which `nodejs_compat` started implying `nodejs_compat_v2`, along with the resolution of both flags from a compatibility date and a set of compatibility flags, so that the tools which generate or interpret Wrangler configurations do not each reimplement it.

‎fixtures/pages-nodejs-v2-compat/apps/workerjs-directory/_worker.js/index.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
process.env.foo = "bar";
22

33
// Check that we don't get a build time error when assigning to globalThis.process.
4+
// @ts-expect-error `@cloudflare/workers-types` declares `process` as a `const`, so
5+
// TypeScript does not treat it as a property of `globalThis`, but this is valid at runtime.
46
globalThis.process = process;
57

68
export default {

‎fixtures/pages-nodejs-v2-compat/apps/workerjs-file/_worker.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
process.env.foo = "bar";
22

33
// Check that we don't get a build time error when assigning to globalThis.process.
4+
// @ts-expect-error `@cloudflare/workers-types` declares `process` as a `const`, so
5+
// TypeScript does not treat it as a property of `globalThis`, but this is valid at runtime.
46
globalThis.process = process;
57

68
export default {

‎fixtures/pages-nodejs-v2-compat/functions/[[path]].ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
process.env.foo = "bar";
22

33
// Check that we don't get a build time error when assigning to globalThis.process.
4+
// @ts-expect-error `@cloudflare/workers-types` declares `process` as a `const`, so
5+
// TypeScript does not treat it as a property of `globalThis`, but this is valid at runtime.
46
globalThis.process = process;
57

68
export const onRequest = () => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import "vitest";
2+
13
declare module "vitest" {
24
interface ProvidedContext {
35
echoServerPort: number;
46
}
57
}
6-
7-
export {};

0 commit comments

Comments
 (0)