Skip to content

Commit 824f50f

Browse files
dario-piotrowiczpenalosacaley-b
authored
generally recommend using remote bindings over --remote (#25256)
* generally recommend using remote bindings over `--remote` * Apply suggestions from code review Co-authored-by: Somhairle MacLeòid <[email protected]> * Apply suggestions from code review Co-authored-by: Somhairle MacLeòid <[email protected]> * Apply suggestions from code review Co-authored-by: Somhairle MacLeòid <[email protected]> * Apply suggestions from code review Co-authored-by: Somhairle MacLeòid <[email protected]> * Apply suggestions from code review Co-authored-by: Somhairle MacLeòid <[email protected]> * Apply suggestions from code review Co-authored-by: Somhairle MacLeòid <[email protected]> * remove preview_id * Update src/content/docs/d1/best-practices/local-development.mdx --------- Co-authored-by: Somhairle MacLeòid <[email protected]> Co-authored-by: Caley Burton <[email protected]>
1 parent 88c2218 commit 824f50f

File tree

19 files changed

+35
-32
lines changed

19 files changed

+35
-32
lines changed

src/content/docs/browser-rendering/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you cannot find the answer you are looking for, join us on [Discord](https://
2525
Not yet. Local development currently has the following limitation(s):
2626
- Requests larger than 1 MB are not supported.
2727

28-
For full feature access, use `npx wrangler dev --remote`.
28+
For full feature access, set the browser rendering as a [remote binding](/workers/development-testing/#remote-bindings).
2929

3030
### Will Browser Rendering bypass Cloudflare's Bot Protection?
3131

src/content/docs/browser-rendering/how-to/ai.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ async function getLLMResult(env, prompt: string, schema?: any) {
259259
}
260260
```
261261

262-
You can run this script to test it using Wrangler's `--remote` flag:
262+
You can run this script to test it using [remote bindings](/workers/development-testing/#remote-bindings):
263263

264264
```sh
265-
npx wrangler dev --remote
265+
npx wrangler dev
266266
```
267267

268268
With your script now running, you can go to `http://localhost:8787/` and should see something like the following:

src/content/docs/browser-rendering/how-to/pdf-generation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ export default {
257257
};
258258
```
259259

260-
You can run this script to test it using Wrangler’s `--remote` flag:
260+
You can run this script to test it using [remote bindings](/workers/development-testing/#remote-bindings):
261261

262-
<PackageManagers type="exec" pkg="wrangler" args="dev --remote" />
262+
<PackageManagers type="exec" pkg="wrangler" args="dev" />
263263

264264
With your script now running, you can pass in a `?name` parameter to the local URL (such as `http://localhost:8787/?name=Harley`) and should see the following:
265265

src/content/docs/browser-rendering/platform/wrangler.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ After the binding is declared, access the DevTools endpoint using `env.MYBROWSER
4444
const browser = await puppeteer.launch(env.MYBROWSER);
4545
```
4646

47-
Run `npx wrangler dev` to test your Worker locally or run [`npx wrangler dev --remote`](/workers/wrangler/commands/#dev) to test your Worker remotely before deploying to Cloudflare's global network.
47+
Run `npx wrangler dev` to test your Worker locally. You can also set the browser binding as a [remote binding](/workers/development-testing/#remote-bindings) to test against a remote browser.

src/content/docs/browser-rendering/workers-bindings/browser-rendering-with-DO.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class Browser {
210210

211211
## 6. Test
212212

213-
Run `npx wrangler dev` to test your Worker locally or run [`npx wrangler dev --remote`](/workers/wrangler/commands/#dev) to test your Worker remotely before deploying to Cloudflare's global network.
213+
Run `npx wrangler dev` to test your Worker locally. You can also set the browser binding as a [remote binding](/workers/development-testing/#remote-bindings) to test against a remote browser.
214214

215215
## 7. Deploy
216216

src/content/docs/browser-rendering/workers-bindings/reuse-sessions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Besides `puppeteer.sessions()`, we have added other methods to facilitate [Sessi
144144

145145
## 5. Test
146146

147-
Run `npx wrangler dev` to test your Worker locally or run [`npx wrangler dev --remote`](/workers/wrangler/commands/#dev) to test your Worker remotely before deploying to Cloudflare's global network.
147+
Run `npx wrangler dev` to test your Worker locally. You can also set the browser binding as a [remote binding](/workers/development-testing/#remote-bindings) to test against a remote browser.
148148

149149
To test go to the following URL:
150150

src/content/docs/browser-rendering/workers-bindings/screenshots.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ If the same `"url"` is requested again, it will use the cached version in KV ins
171171

172172
## 6. Test
173173

174-
Run `npx wrangler dev` to test your Worker locally or run [`npx wrangler dev --remote`](/workers/wrangler/commands/#dev) to test your Worker remotely before deploying to Cloudflare's global network.
174+
Run `npx wrangler dev` to test your Worker locally. You can also use [remote bindings](/workers/development-testing/#remote-bindings) to test against a remote browser.
175175

176176
To test taking your first screenshot, go to the following URL:
177177

src/content/docs/d1/best-practices/local-development.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ database_id = "c020574a-5623-407b-be0c-cd192bab9545"
6767

6868
</WranglerConfig>
6969

70-
Note that `wrangler dev` separates local and production (remote) data. A local session does not have access to your production data by default. To access your production (remote) database, pass the `--remote` flag when calling `wrangler dev`. Any changes you make when running in `--remote` mode cannot be undone.
70+
Note that `wrangler dev` separates local and production (remote) data. A local session does not have access to your production data by default. To access your production (remote) database, set your D1 as a [remote binding](/workers/development-testing/#remote-bindings). Any changes you make when running against a remote database cannot be undone.
7171

7272
Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to learn more about how to configure a local development session.
7373

src/content/docs/d1/tutorials/build-an-api-to-access-d1/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ To create a table in your newly created database:
279279
Upon successful execution, a new table will be added to your database.
280280

281281
:::note
282-
The table will be created in the local instance of the database. If you want to add this table to your production database, append the above command by adding the `--remote` flag.
282+
283+
The table will be created in the local instance of the database. If you want to add this table to your production database, set your database as a [remote binding](/workers/development-testing/#remote-bindings).
284+
283285
:::
284286

285287
## 9. Query the database

src/content/docs/d1/tutorials/using-read-replication-for-e-com/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,9 @@ curl -X POST http://localhost:8787/api/product \
856856
```
857857

858858
:::note
859-
Read replication is only used when the application has been [deployed](/d1/tutorials/using-read-replication-for-e-com/#step-9-deploy-the-application). D1 does not create read replicas when you develop locally. To test it locally, you can start the development server with the `--remote` flag.
859+
860+
Read replication is only used when the application has been [deployed](/d1/tutorials/using-read-replication-for-e-com/#step-9-deploy-the-application). D1 does not create read replicas when you develop locally. To test it locally, you can set your database as a [remote binding](/workers/development-testing/#remote-bindings).
861+
860862
:::
861863

862864
## Step 9: Deploy the application

0 commit comments

Comments
 (0)