Skip to content

[vitest-pool-workers] Preserve deprecated Miniflare cache option - #14913

Open
edmundhung wants to merge 6 commits into
miniflare-v5from
edmundhung/miniflare-v5-vitest-cache-compat
Open

[vitest-pool-workers] Preserve deprecated Miniflare cache option#14913
edmundhung wants to merge 6 commits into
miniflare-v5from
edmundhung/miniflare-v5-vitest-cache-compat

Conversation

@edmundhung

@edmundhung edmundhung commented Jul 29, 2026

Copy link
Copy Markdown
Member

Preserves the deprecated Miniflare cache worker option in @cloudflare/vitest-pool-workers while Miniflare v5 renames it to cacheAPI.

The pool normalizes worker options before Miniflare schema parsing, for both the test runner and auxiliary workers. cacheAPI takes precedence when both names are provided. The legacy cache field remains typed with a deprecation annotation so existing configurations continue to compile.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This preserves an existing option during an internal dependency upgrade and marks the replacement in the public type.

A picture of a cute animal (not mandatory, but encouraged)


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b231e27

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@ask-bonk

ask-bonk Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

No other references. The implementation is coherent and correct.

Let me summarize my findings:

The core logic is correct:

  • cacheAPI ?? cache precedence is properly implemented (cacheAPI wins).
  • Both runner and auxiliary workers pass through parseWorkerOptionsnormalizeMiniflareWorkerOptions.
  • Type annotations are sound.
  • Semantics match Miniflare v5's cacheAPI ?? true.

Minor observations (not bugs, not actionable):

  • No runtime deprecation warning when cache is used (only JSDoc @deprecated).
  • Tests don't cover the auxiliary-workers path even though the PR claims it, but the code path is shared.
  • cacheWarnUsage (removed in v5) isn't handled, but that's out of scope for this PR.

None of these rise to the level of a logic bug, security issue, backward-compat violation, or incorrect API behavior. The one behavioral edge — cache: undefined with no cacheAPIcacheAPI: undefined → defaults to enabled — is correct and matches prior behavior.

There are no actionable issues.

LGTM

github run

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14913

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14913

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14913

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14913

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14913

miniflare

npm i https://pkg.pr.new/miniflare@14913

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14913

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14913

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14913

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14913

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14913

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14913

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14913

wrangler

npm i https://pkg.pr.new/wrangler@14913

commit: b231e27

@emily-shen
emily-shen force-pushed the miniflare-v5 branch 2 times, most recently from c91813f to 1f75897 Compare July 29, 2026 16:25
@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

3 participants