Skip to content

new config miniflare attempt 3 - #14994

Merged
emily-shen merged 28 commits into
mainfrom
emily/new-config-miniflare
Aug 10, 2026
Merged

emily-shen merged 28 commits into
mainfrom
emily/new-config-miniflare

Conversation

@emily-shen

@emily-shen emily-shen commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Config:

  • cobbled together from the cloudflare config format defined in the @cloudflare/config package.
  • have had to modify the imported config to add miniflare specific options and also make id's required
  • have added a reconstructed (used to be assembled from each plugin options) schema of v4 miniflare options for the v4 to v5 conversion helper.

All plugins now get the full config, and are responsible for filtering down the relevant config themselves - previously miniflare plugins each declared a schema of what config it needed, and then each plugin would only receive that.

There is probably a lot of tidying up we can do in miniflare to strip out more unused bits, but trying to avoid too much in this PR.

A large chunk of the diff is in tests, where we call new Miniflare a lot. Inside miniflare this is migrated to the new config directly, outside miniflare we use the conversion helper.

As discussed the v4 to v5 conversion happens right before passing options to miniflare, meaning the new config format is not exposed in any public APIs (well other than miniflare's obviously).

TODO later:

there are a couple of exports from miniflare that are only used by vitest-pool-workers and not miniflare itself. for example, the config merging helper and compileModuleRules. In a follow up i will probably just move that directly into VPW.


  • 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: miniflare v5 is wip

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

@changeset-bot

changeset-bot Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73ec8a5

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

This PR includes changesets to release 10 packages
Name Type
@cloudflare/config Minor
miniflare Major
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Minor
wrangler Patch
@cloudflare/build-output-utils Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types 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

@ask-bonk

ask-bonk Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

UnknownError: ProviderInitError

github run

@ask-bonk

ask-bonk Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@emily-shen Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@github-actions

github-actions Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ All changesets look good

Comment thread packages/miniflare/src/config/schema.ts Resolved
@emily-shen
emily-shen force-pushed the emily/new-config-miniflare branch from 17612e4 to 1c14de0 Compare August 3, 2026 22:51
@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

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

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@14994

@cloudflare/config

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

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@14994

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 73ec8a5

Comment thread packages/miniflare/src/config/schema.ts Resolved
@emily-shen
emily-shen force-pushed the emily/new-config-miniflare branch 3 times, most recently from 8612a3c to e4c796b Compare August 4, 2026 21:44
@emily-shen
emily-shen marked this pull request as ready for review August 4, 2026 21:44
@workers-devprod
workers-devprod requested review from a team and petebacondarwin and removed request for a team August 4, 2026 21:45
@workers-devprod

workers-devprod commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/d1
  • @cloudflare/workers-kv
  • ✅ @cloudflare/wrangler
Show detailed file reviewers
  • packages/miniflare/test/plugins/kv/index.spec.ts: [@cloudflare/workers-kv]
  • packages/miniflare/test/plugins/kv/sites.spec.ts: [@cloudflare/workers-kv]
  • packages/wrangler/src/d1/execute.ts: [@cloudflare/d1]
  • packages/wrangler/src/d1/export.ts: [@cloudflare/d1]
  • packages/wrangler/src/kv/helpers.ts: [@cloudflare/workers-kv]

devin-ai-integration[bot]

This comment was marked as resolved.

@emily-shen
emily-shen force-pushed the emily/new-config-miniflare branch from e4c796b to e8514a8 Compare August 5, 2026 13:56
devin-ai-integration[bot]

This comment was marked as resolved.

@emily-shen
emily-shen requested review from edmundhung, jamesopstad and penalosa and removed request for petebacondarwin August 5, 2026 14:26
@emily-shen
emily-shen force-pushed the emily/new-config-miniflare branch from 45dbce5 to 9a7db84 Compare August 6, 2026 09:40
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 15, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 19, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 21, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 25, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 25, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 26, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Aug 28, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Sep 2, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Sep 4, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Sep 18, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Oct 6, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
mack-erel added a commit to henryj-dev/contribute_cloudflare_workers-sdk that referenced this pull request Oct 6, 2026
Two leftovers from rebasing onto the new miniflare config structure (cloudflare#14994):

- `HyperdriveBindingSchema` is a `strictObject`, so `remote: true` was
  rejected at parse time even though the TypeScript interface allowed it.
- The bridge and seed-endpoint tests still built Miniflare with the v4
  top-level worker shape (`name`/`modules`/`hyperdrives`) instead of the
  `workers: [{ config: ... }]` form.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:c3-e2e Run C3 E2E tests on a pull request ci:e2e Run wrangler + vite-plugin E2E tests on a pull request ci:run-remote-tests Run remote/E2E tests that require Cloudflare API credentials ci:test-all-node-versions Run the tests on all Node versions for this PR run-c3-frameworks-tests Run all the C3 frameworks tests on this PR

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants