Skip to content

Commit 57932a6

Browse files
committed
Update APIs
1 parent 9733d64 commit 57932a6

File tree

1 file changed

+13
-12
lines changed
  • src/content/docs/workers/development-testing

1 file changed

+13
-12
lines changed

src/content/docs/workers/development-testing/index.mdx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ Wrangler provides programmatic utilities to help tooling authors support remote
303303

304304
**Key APIs include:**
305305

306-
- [`experimental_startRemoteProxySession`](#experimental_startRemoteProxySession): Starts a proxy session that allows interaction with remote bindings.
306+
- [`startRemoteProxySession`](#startRemoteProxySession): Starts a proxy session that allows interaction with remote bindings.
307307
- [`unstable_convertConfigBindingsToStartWorkerBindings`](#unstable_convertconfigbindingstostartworkerbindings): Utility for converting binding definitions.
308308
- [`experimental_maybeStartOrUpdateProxySession`](#experimental_maybestartorupdatemixedmodesession): Convenience function to easily start or update a proxy session.
309309

310-
#### `experimental_startRemoteProxySession`
310+
#### `startRemoteProxySession`
311311

312312
This function starts a proxy session for a given set of bindings. It accepts options to control session behavior, including an `auth` option with your Cloudflare account ID and API token for remote binding access.
313313

@@ -321,15 +321,15 @@ It returns an object with:
321321
#### `unstable_convertConfigBindingsToStartWorkerBindings`
322322

323323
The `unstable_readConfig` utility returns an `Unstable_Config` object which includes the definition of the bindings included in the configuration file. These bindings definitions
324-
are however not directly compatible with `experimental_startRemoteProxySession`. It can be quite convenient to however read the binding declarations with `unstable_readConfig` and then
325-
pass them to `experimental_startRemoteProxySession`, so for this wrangler exposes `unstable_convertConfigBindingsToStartWorkerBindings` which is a simple utility to convert
326-
the bindings in an `Unstable_Config` object into a structure that can be passed to `experimental_startRemoteProxySession`.
324+
are however not directly compatible with `startRemoteProxySession`. It can be quite convenient to however read the binding declarations with `unstable_readConfig` and then
325+
pass them to `startRemoteProxySession`, so for this wrangler exposes `unstable_convertConfigBindingsToStartWorkerBindings` which is a simple utility to convert
326+
the bindings in an `Unstable_Config` object into a structure that can be passed to `startRemoteProxySession`.
327327

328328
:::note
329-
This type conversion is temporary. In the future, the types will be unified so you can pass the config object directly to `experimental_startRemoteProxySession`.
329+
This type conversion is temporary. In the future, the types will be unified so you can pass the config object directly to `startRemoteProxySession`.
330330
:::
331331

332-
#### `experimental_maybeStartOrUpdateRemoteProxySession`
332+
#### `maybeStartOrUpdateRemoteProxySession`
333333

334334
This wrapper simplifies proxy session management. It takes:
335335

@@ -347,23 +347,23 @@ The function:
347347
- If there are no remote bindings to be used (nor a pre-existing proxy session) it returns null, signaling that no proxy session is needed.
348348
- If the details of an existing proxy session have been provided it updates the proxy session accordingly.
349349
- Otherwise if starts a new proxy session.
350-
- Returns the proxy session details (that can later be passed as the second argument to `experimental_maybeStartOrUpdateRemoteProxySession`).
350+
- Returns the proxy session details (that can later be passed as the second argument to `maybeStartOrUpdateRemoteProxySession`).
351351

352352
#### Example
353353

354-
Here's a basic example of using Miniflare with `experimental_maybeStartOrUpdateRemoteProxySession` to provide a local dev session with remote bindings. This example uses a single hardcoded KV binding.
354+
Here's a basic example of using Miniflare with `maybeStartOrUpdateRemoteProxySession` to provide a local dev session with remote bindings. This example uses a single hardcoded KV binding.
355355

356356
<TypeScriptExample>
357357
```ts
358358
import { Miniflare, MiniflareOptions } from "miniflare";
359-
import { experimental_maybeStartOrUpdateRemoteProxySession } from "wrangler";
359+
import { maybeStartOrUpdateRemoteProxySession } from "wrangler";
360360

361361
let mf: Miniflare | null;
362362

363-
let remoteProxySessionDetails: Awaited<ReturnType<typeof experimental_maybeStartOrUpdateRemoteProxySession>> | null = null;
363+
let remoteProxySessionDetails: Awaited<ReturnType<typeof maybeStartOrUpdateRemoteProxySession>> | null = null;
364364

365365
async function startOrUpdateDevSession() {
366-
remoteProxySessionDetails = await experimental_maybeStartOrUpdateRemoteProxySession({
366+
remoteProxySessionDetails = await maybeStartOrUpdateRemoteProxySession({
367367
bindings: {
368368
MY_KV: {
369369
type: 'kv_namespace',
@@ -426,3 +426,4 @@ When using remote development, all bindings automatically connect to their remot
426426

427427
- When you run a remote development session using the `--remote` flag, a limit of 50 [routes](/workers/configuration/routing/routes/) per zone is enforced. Learn more in[ Workers platform limits](/workers/platform/limits/#number-of-routes-per-zone-when-using-wrangler-dev---remote).
428428

429+
```

0 commit comments

Comments
 (0)