Skip to content

Commit 2c3d8dd

Browse files
workers-devprodemily-shenedmundhung
authored
V3 Backport [#9234]: add no-op to getPlatformProxy to fix types mismatch (#9262)
* add props * eslint disable * make sure the props is initialzied with an empty object --------- Co-authored-by: emily-shen <[email protected]> Co-authored-by: Edmund Hung <[email protected]>
1 parent 8b4f24a commit 2c3d8dd

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.changeset/clear-beans-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
fix: add no-op `props` to `ctx` in `getPlatformProxy` to fix type mismatch

fixtures/get-platform-proxy/tests/get-platform-proxy.ctx.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe("getPlatformProxy - ctx", () => {
3333
expect(ctx.constructor.name).toBe("ExecutionContext");
3434
expect(typeof ctx.waitUntil).toBe("function");
3535
expect(typeof ctx.passThroughOnException).toBe("function");
36+
expect(ctx.props).toEqual({});
3637

3738
ctx.waitUntil = ((str: string) => `- ${str} -`) as any;
3839
expect(ctx.waitUntil("waitUntil can be overridden" as any)).toBe(

packages/wrangler/src/api/integrations/platform/executionContext.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ export class ExecutionContext {
1010
throw new Error("Illegal invocation");
1111
}
1212
}
13+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
14+
props: any = {};
1315
}

0 commit comments

Comments
 (0)