Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 25cb716

Browse files
committed
Add warnings to experimental features (mounts & service bindings)
1 parent 9287cac commit 25cb716

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

packages/core/src/plugins/bindings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ export class BindingsPlugin
218218
(typeof options === "object" && options.environment) || "production";
219219
return { name, service, environment };
220220
});
221+
if (this.#processedServiceBindings.length) {
222+
ctx.log.warn(
223+
"Service bindings are experimental and primarily meant for internal " +
224+
"testing at the moment. There may be breaking changes in the future."
225+
);
226+
}
221227
}
222228

223229
#getServiceFetch = async (service: string): Promise<FetcherFetch> => {

packages/core/src/plugins/core.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ export class CorePlugin extends Plugin<CoreOptions> implements CoreOptions {
347347
constructor(ctx: PluginContext, options?: CoreOptions) {
348348
super(ctx);
349349
this.assignOptions(options);
350+
if (this.mounts && Object.keys(this.mounts).length) {
351+
ctx.log.warn(
352+
"Mounts are experimental. There may be breaking changes in the future."
353+
);
354+
}
350355

351356
// Make sure the kFormDataFiles flag is set correctly when constructing
352357
let CompatRequest = Request;

packages/core/test/index.mounts.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ test("MiniflareCore: dispose: disposes of mounts too", async (t) => {
383383
[LogLevel.DEBUG, "Options:"],
384384
[LogLevel.DEBUG, "- Mounts: test"],
385385
[LogLevel.DEBUG, "Enabled Compatibility Flags: <none>"],
386+
[
387+
LogLevel.WARN,
388+
"Mounts are experimental. There may be breaking changes in the future.",
389+
],
386390
[LogLevel.VERBOSE, "- setup(CorePlugin)"],
387391
[LogLevel.DEBUG, 'Mounting "test"...'],
388392
[LogLevel.DEBUG, "Initialising worker..."],

0 commit comments

Comments
 (0)