Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/config-export-binding-schemas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/config": minor
---

Export various sub-schemas like `BrowserBindingSchema`, `DurableObjectCreatedExportSchema` that need to be extended in Miniflare
7 changes: 7 additions & 0 deletions .changeset/drop-service-worker-sourcemaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"miniflare": major
---

Drop source map resolution for service-worker scripts

Stack traces from service-worker scripts (provided via `legacy.serviceWorkerScript`) are no longer source-mapped. Service-worker scripts have no associated module path, so their `//# sourceMappingURL=` comments can no longer be resolved to a source map. Module workers continue to be source-mapped via `sourcemap`-type manifest modules.
7 changes: 7 additions & 0 deletions .changeset/fresh-plums-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/vite-plugin": patch
---

Fix local dev and preview compatibility with the latest Miniflare

Projects using `@cloudflare/vite-plugin` now start local dev and preview Workers correctly with the current Miniflare Worker configuration format.
35 changes: 35 additions & 0 deletions .changeset/miniflare-new-config-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
"miniflare": major
---

Adopt the `@cloudflare/config` worker configuration format

Workers are now configured with a `workers` array of `{ config, legacy, dev }` entries, where `config` follows the shared `@cloudflare/config` output schema (including inline module `manifest`s) rather than the previous flat per-worker options. Service bindings, tail consumers, assets, and source maps are all driven from this format:

- Service bindings support the `external`, `network`, and `disk` designators alongside worker/fetcher/node-handler bindings.
- Tail consumers accept `entrypoint` and `props`.
- Assets expose a `hasUserWorker` flag to control router behaviour.
- Source maps are provided inline as `sourcemap`-type manifest modules.

```js
new Miniflare({
workers: [
{
config: {
type: "worker",
name: "my-worker",
compatibilityDate: "2025-05-01",
manifest: {
mainModule: "index.mjs",
modules: {
"index.mjs": {
type: "esm",
contents: "export default { fetch() {} }",
},
},
},
},
},
],
});
```
7 changes: 7 additions & 0 deletions .changeset/remove-source-options-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"miniflare": major
---

Remove `SourceOptions`, `NameSourceOptions`, `ModuleDefinition`, and `ModuleDefinitionSchema` from Miniflare's public API

Worker source is now provided inline through the config manifest, so stack traces are source-mapped directly against it. The `SourceOptions` intermediate representation and its associated exports are no longer needed and have been removed.
7 changes: 7 additions & 0 deletions .changeset/remove-unused-module-rule-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"miniflare": major
---

Remove the module-rule API from Miniflare: `compileModuleRules`, `ModuleRuleTypeSchema`, `ModuleRule`, and `ModuleRuleType`

Modules must now be provided inline via the config manifest, so module rules are no longer used.
7 changes: 7 additions & 0 deletions .changeset/tall-guests-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"miniflare": minor
---

Remove support for legacy alpha D1 (`__D1_BETA__`) bindings

This removes miniflare support for deprecated beta D1 instances created before wrangler@3.3.0.
2 changes: 2 additions & 0 deletions packages/config/src/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ export interface WorkerLoaderBinding {
}

interface WorkflowBindingOptions {
/** The user-chosen name of the Workflow. */
name: string;
/** The name of the Worker that defines the Workflow. */
workerName: string;
/** The exported class name of the Workflow. */
Expand Down
23 changes: 12 additions & 11 deletions packages/config/src/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,17 +561,18 @@ function convertBindingsAndAssets(
break;
}
// TODO: re-enable when workflow bindings return.
// case "workflow": {
// workflows.push(
// omitUndefined({
// binding: name,
// class_name: binding.exportName,
// script_name: binding.workerName,
// remote: binding.remote,
// })
// );
// break;
// }
case "workflow": {
workflows.push(
omitUndefined({
binding: name,
name: binding.name,
class_name: binding.exportName,
script_name: binding.workerName,
remote: binding.remote,
})
);
break;
}
}
}

Expand Down
19 changes: 19 additions & 0 deletions packages/config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
export * from "./public";
export {
AssetsSchema,
BindingSchema,
BrowserBindingSchema,
ConfigExportsSchema,
D1BindingSchema,
DurableObjectCreatedExportSchema,
DurableObjectDeletedExportSchema,
DurableObjectExpectingTransferExportSchema,
DurableObjectRenamedExportSchema,
DurableObjectTransferredExportSchema,
ExportSchema,
InputWorkerSchema,
KnownBindingSchema,
KVBindingSchema,
OutputWorkerSchema,
ModuleTypeSchema,
QueueBindingSchema,
R2BindingSchema,
FlagshipBindingSchema,
SettingsSchema,
UnsafeBindingSchema,
WorkerBindingSchema,
WorkerEntrypointExportSchema,
WorkflowExportSchema,
} from "./schema";
export { generateTypes } from "./generate";
export { convertToWranglerConfig } from "./convert";
Expand Down
Loading