From 5578951fe134795dc68dc2c5c16f4ab129c29598 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 13 Feb 2024 10:41:21 +0000 Subject: [PATCH 1/2] update `getBindingsProxy` documentation to `getPlatformProxy` `getBindingsProxy` is being deprecated and replaced with `getPlatformProxy`, so update the relevant documentation accordingly --- content/workers/wrangler/api.md | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/content/workers/wrangler/api.md b/content/workers/wrangler/api.md index 91b664c8a11aa3f..27f411c515cf70a 100644 --- a/content/workers/wrangler/api.md +++ b/content/workers/wrangler/api.md @@ -11,7 +11,7 @@ meta: Wrangler offers APIs to programmatically interact with your Cloudflare Workers. - [`unstable_dev`](#unstable_dev) - Start a server for running either end-to-end (e2e) or integration tests against your Worker. -- [`getBindingsProxy`](#getbindingsproxy) - Get [bindings](/workers/configuration/bindings/) via Wrangler and use them in your code. +- [`getPlatformProxy`](#getplatformproxy) - Get proxies and values for emulating the Cloudflare Workers platform in a Node.js process. ## `unstable_dev` @@ -233,11 +233,11 @@ describe("multi-worker testing", () => { {{}} {{}} -## `getBindingsProxy` +## `getPlatformProxy` -The `getBindingsProxy` function is used to get a proxy for **local** `workerd` bindings that can be then used in code running via Node.js processes for Workers and Pages projects. +The `getPlatformProxy` function provides a way to obtain an object containing proxies (to **local** `workerd` bindings) and emulations of Cloudflare Workers specific values, allowing the emulation of such in a Node.js process. -Getting a proxy is useful for emulating bindings in applications targeting Workers, but running outside the Workers runtime (for example, framework local development servers running in Node.js), or for testing purposes (for example, ensuring code properly interacts with a binding). +One general use case for getting a platform proxy is for emulating bindings in applications targeting Workers, but running outside the Workers runtime (for example, framework local development servers running in Node.js), or for testing purposes (for example, ensuring code properly interacts with a type of binding). {{