Skip to content

test: move pds and spaces to @cloudflare/vitest-plugin - #259

Merged
ascorbic merged 2 commits into
mainfrom
claude/relaxed-archimedes-vxoae3
Nov 21, 2026
Merged

ascorbic merged 2 commits into
mainfrom
claude/relaxed-archimedes-vxoae3

Conversation

@ascorbic

@ascorbic ascorbic commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

@cloudflare/vitest-pool-workers is deprecated (renamed to @cloudflare/vitest-plugin). Its worker wrapper (createProxyPrototypeClass) wraps the shared prototype in a new Proxy on every entrypoint request and every Durable Object construction, so method lookups get slower as a run goes on. #258 worked around the entrypoint half; DO instances still added a layer each. @cloudflare/vitest-plugin installs the proxy once (proxyInstalled guard, 1.2.0+).

Changes

  • Replace @cloudflare/vitest-pool-workers@^0.16.9 with @cloudflare/vitest-plugin@^1.8.5 in packages/pds and packages/spaces. Per the 1.0.0 changelog the rename only touches the dependency, the cloudflareTest import specifier and the types entry in test/tsconfig.json; the cloudflare:test API is a superset of the old one. No config options were renamed, so isolate: false, maxWorkers: 1, the jose browser aliases and resolve.conditions are unchanged.
  • Move every workspace package off vitest@4.1.0-beta.1 to ^4.1.12 (the plugin's peer range is ^4.1.0 || ^5.0.0), keeping a single vitest in the lockfile.
  • Regenerate packages/spaces/test/fixtures/spaces-worker/worker-configuration.d.ts with wrangler types. The hand-written version declared bindings on the global Env only, but cloudflare:test types env as Cloudflare.Env, so DO stubs came through untyped. The generated file is added to .prettierignore so regenerating doesn't produce a format diff.
  • Update the "Testing with Cloudflare Workers" section of CLAUDE.md (it pointed at the old PR build and said test bindings live in .dev.vars; pds sets them in vitest.config.ts) and the contributing docs.

No changeset: devDependency and test-only changes.

Why 1.8.5 rather than 1.9.0

1.9.0 was published less than a day ago, and pnpm install silently added it plus a beta miniflare to minimumReleaseAgeExclude. I reverted that rather than weaken the release-age guard. 1.9.0 drops its wrangler dependency; both packages already have wrangler as a devDependency, so a later bump should be painless.

Testing

  • pnpm build, pnpm test and pnpm check all pass.
  • pds: 355 unit + 128 CLI; spaces: 80; oauth-provider: 140; space-conformance: 47; space-conformance-matrix: 5; create-pds: 4. vitest reports no unhandled errors.
  • pds unit tests: ~95s on main → ~34s with this branch, run back to back in the same container.
  • workerd still logs uncaught exception lines (expected DO RPC rejections and DNS failures for deliberately unresolvable hosts such as relay.invalid). I diffed them against a run of main: identical apart from newer workerd omitting the hostname from DNS errors.
  • The test tsconfigs aren't type-checked by CI. Spaces goes from 49 errors on main to 8 (stricter runInDurableObject typing plus the generated Cloudflare.Env); the 8 left are unrelated test typing issues. pds is unchanged at 46, none of them env-binding related.

Known leftovers

  • pnpm install warns about an unmet optional peer: the plugin's pinned wrangler@4.165.0 wants @cloudflare/workers-types v5; the repo is on v4. Nothing breaks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LZ7qcQo2APakSi7cEZBgr3

@cloudflare/vitest-pool-workers is deprecated and its worker wrapper
stacks a new Proxy on the shared prototype for every entrypoint
request and Durable Object construction, so method lookups get slower
as a run goes on. @cloudflare/vitest-plugin installs the proxy once
(1.2.0+).

- Replace @cloudflare/vitest-pool-workers ^0.16.9 with
  @cloudflare/vitest-plugin ^1.8.5 in packages/pds and packages/spaces
  (import specifier and test tsconfig types entry renamed; no config
  option changes needed)
- Move every workspace package off vitest 4.1.0-beta.1 to ^4.1.12,
  matching the plugin's vitest ^4.1.0 peer range
- Update CLAUDE.md and the contributing docs

pds unit tests drop from ~95s to ~34s locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQo2APakSi7cEZBgr3
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cirrusdocs 6be7907 Commit Preview URL

Branch Preview URL
Nov 21 2026, 11:26 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
pdscheck 6be7907 Nov 21 2026, 11:26 AM

@pkg-pr-new

pkg-pr-new Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-pds@259
npm i https://pkg.pr.new/@getcirrus/oauth-provider@259
npm i https://pkg.pr.new/@getcirrus/pds@259
npm i https://pkg.pr.new/@getcirrus/spaces@259

commit: 6be7907

The hand-written fixture declared bindings on the global Env only, but
cloudflare:test types `env` as Cloudflare.Env, so DO stubs came through
untyped. Regenerate with `wrangler types`, which declares both. Spaces
test type errors drop from 34 to 8, including the one the plugin's
stricter runInDurableObject typing introduced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZ7qcQo2APakSi7cEZBgr3
@ascorbic
ascorbic merged commit 17a216a into main Nov 21, 2026
6 checks passed
@ascorbic
ascorbic deleted the claude/relaxed-archimedes-vxoae3 branch November 21, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants