From fb8de5d54e3f7dee5e45f61f277410a8cfa850f1 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Mon, 15 Apr 2024 00:09:55 +0900 Subject: [PATCH] chore: no no magical proxy --- packages/workerd/src/plugin.ts | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/packages/workerd/src/plugin.ts b/packages/workerd/src/plugin.ts index 4ec6aeb5..b87c4094 100644 --- a/packages/workerd/src/plugin.ts +++ b/packages/workerd/src/plugin.ts @@ -203,37 +203,6 @@ export async function createWorkerdDevEnvironment( tinyassert(res.ok); return (await res.json()) as any; }, - - // not-so-magical proxy - // - proxy only shallow exports using above `eval` - // - all async call - async importProxy(entry: string): Promise { - return new Proxy( - {}, - { - get(_target, exportName, _receiver) { - return new Proxy(() => {}, { - get(_target, prop, _receiver) { - return api.eval( - entry, - (ctx) => ctx.exports[ctx.args[0]][ctx.args[1]], - exportName, - prop, - ); - }, - apply(_target, _thisArg, argArray) { - return api.eval( - entry, - (ctx) => ctx.exports[ctx.args[0]](...ctx.args[1]), - exportName, - argArray, - ); - }, - }); - }, - }, - ); - }, }; // workaround for tsup dts?