new config miniflare attempt 3 - #14994
Conversation
🦋 Changeset detectedLatest commit: 73ec8a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
|
UnknownError: ProviderInitError |
|
@emily-shen Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
|
✅ All changesets look good |
17612e4 to
1c14de0
Compare
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
8612a3c to
e4c796b
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
e4c796b to
e8514a8
Compare
45dbce5 to
9a7db84
Compare
The dropped fields are now resolved once in miniflare instead of separately by consumers.
the workflow compat flags are the user compat flags, just previously the plugin didn't have access to those options so they were copied over.
devin had the same comment, i still don't really understand what the problem is here. what is the expected user facing breakage due to this change? fixing the rest |
Example project: new Miniflare({
rootPath: "/project",
modulesRoot: "src",
modules: [{ type: "ESModule", path: "src/index.mjs" }],
});Previously:
Now:
|
edmundhung
left a comment
There was a problem hiding this comment.
Some findings from AI review 😅
edmundhung
left a comment
There was a problem hiding this comment.
We are getting there! Thanks for the hard work. 🙌🏼
c60a2f5 to
73ec8a5
Compare
penalosa
left a comment
There was a problem hiding this comment.
A second pass over the non-test changes found these configuration and runtime gaps. I have omitted the expected module-discovery change and the issues already covered in my earlier review.
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
Config:
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 Miniflarea 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.
A picture of a cute animal (not mandatory, but encouraged)