Skip to content

new config miniflare attempt 3 - #14994

Draft
emily-shen wants to merge 16 commits into
mainfrom
emily/new-config-miniflare
Draft

new config miniflare attempt 3#14994
emily-shen wants to merge 16 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).


  • 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:

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: 1c14de0

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
wrangler Patch
miniflare Major
@cloudflare/vitest-pool-workers Patch
@cloudflare/build-output-utils Patch
@cloudflare/vite-plugin 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

⚠️ Issues found

.changeset/soft-birds-yell.md
Adding a new public API function (convertV4MiniflareOptions) is a new feature and should be minor, not patch.

Comment on lines +392 to +393
entrypoint: z.string().optional(),
props: z.record(z.string(), z.unknown()).optional(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

entrypoint and props were on this in the old miniflare config, and used, but i don't see any public mention of this and it isn't in any user facing config


const MiniflareWorkflowBindingSchema = z.strictObject({
type: z.literal("workflow"),
name: z.string(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TODO: remove name and compat flag from the binding config.
compat flag was due to old plugin config isolation, it needs the user workers compat flags

// The miniflare-extended schemas below replace these base `@cloudflare/config`
// binding schemas (which have optional `id`/`name`) with variants that require
// those fields.
const OVERRIDDEN_BASE_BINDING_SCHEMAS = [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

below is a bunch of horrible stuff just to make id required in miniflare. couldn't figure out a better way

@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: 1c14de0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants