You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support Images binding in getPlatformProxy() (#9954)
* Support Images binding in getPlatformProxy()
* fix snapshot
* fix snapshot
* Update fixtures/get-platform-proxy/tests/get-platform-proxy.env.test.ts
Co-authored-by: Pete Bacon Darwin <[email protected]>
---------
Co-authored-by: Pete Bacon Darwin <[email protected]>
@@ -282,11 +290,68 @@ class ProxyStubHandler<T extends object>
282
290
});
283
291
returnthis.#parseAsyncResponse(resPromise);
284
292
}else{
293
+
// See #createMediaProxy() for why this is special
294
+
if(name==="ImagesBindingImpl"){
295
+
returnthis.#createMediaProxy(target);
296
+
}
285
297
// Otherwise, return a `Proxy` for this target
286
298
returnthis.bridge.getProxy(target);
287
299
}
288
300
},
289
301
};
302
+
/**
303
+
* Images bindings are some of the most complex bindings from an API perspective, other than RPC. In particular, they expose a _synchronous_ API that accepts ReadableStream arguments.
304
+
* Multiple synchronous APIs are chained together in a builder pattern (e.g. `await env.IMAGES.input(stream).transform(...).output(...)`) before the final `.output()` call is awaited.
305
+
* This breaks our assumptions around functions that accept ReadableStream arguments always being async, and so doesn't work without some special casing.
0 commit comments