Repository navigation
test: move pds and spaces to @cloudflare/vitest-plugin - #259
Merged
Merged
Conversation
@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
Deploying with
|
| 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 |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
pdscheck | 6be7907 | Nov 21 2026, 11:26 AM |
commit: |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@cloudflare/vitest-pool-workersis deprecated (renamed to@cloudflare/vitest-plugin). Its worker wrapper (createProxyPrototypeClass) wraps the shared prototype in a newProxyon 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-plugininstalls the proxy once (proxyInstalledguard, 1.2.0+).Changes
@cloudflare/vitest-pool-workers@^0.16.9with@cloudflare/vitest-plugin@^1.8.5inpackages/pdsandpackages/spaces. Per the 1.0.0 changelog the rename only touches the dependency, thecloudflareTestimport specifier and thetypesentry intest/tsconfig.json; thecloudflare:testAPI is a superset of the old one. No config options were renamed, soisolate: false,maxWorkers: 1, thejosebrowser aliases andresolve.conditionsare unchanged.vitest@4.1.0-beta.1to^4.1.12(the plugin's peer range is^4.1.0 || ^5.0.0), keeping a single vitest in the lockfile.packages/spaces/test/fixtures/spaces-worker/worker-configuration.d.tswithwrangler types. The hand-written version declared bindings on the globalEnvonly, butcloudflare:testtypesenvasCloudflare.Env, so DO stubs came through untyped. The generated file is added to.prettierignoreso regenerating doesn't produce a format diff..dev.vars; pds sets them invitest.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 installsilently added it plus a beta miniflare tominimumReleaseAgeExclude. I reverted that rather than weaken the release-age guard. 1.9.0 drops itswranglerdependency; both packages already havewrangleras a devDependency, so a later bump should be painless.Testing
pnpm build,pnpm testandpnpm checkall pass.uncaught exceptionlines (expected DO RPC rejections and DNS failures for deliberately unresolvable hosts such asrelay.invalid). I diffed them against a run of main: identical apart from newer workerd omitting the hostname from DNS errors.runInDurableObjecttyping plus the generatedCloudflare.Env); the 8 left are unrelated test typing issues. pds is unchanged at 46, none of them env-binding related.Known leftovers
pnpm installwarns about an unmet optional peer: the plugin's pinnedwrangler@4.165.0wants@cloudflare/workers-typesv5; the repo is on v4. Nothing breaks.🤖 Generated with Claude Code
https://claude.ai/code/session_01LZ7qcQo2APakSi7cEZBgr3