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
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/angular.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ import {
13
13
PackageManagers,
14
14
} from"~/components";
15
15
16
-
In this guide, you will create a new [Angular](https://angular.dev/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
16
+
In this guide, you will create a new [Angular](https://angular.dev/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
17
18
18
## 1. Set up a new project
19
19
20
20
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Angular's official setup tool, and provide the option to deploy instantly.
21
21
22
-
To use `create-cloudflare` to create a new Angular project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
22
+
To use `create-cloudflare` to create a new Angular project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/astro.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ import {
13
13
PackageManagers,
14
14
} from"~/components";
15
15
16
-
In this guide, you will create a new [Astro](https://astro.build/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
16
+
In this guide, you will create a new [Astro](https://astro.build/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
17
18
18
## 1. Set up a new project
19
19
20
20
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Astro's official setup tool, and provide the option to deploy instantly.
21
21
22
-
To use `create-cloudflare` to create a new Astro project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
22
+
To use `create-cloudflare` to create a new Astro project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/docusaurus.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ import {
13
13
PackageManagers,
14
14
} from"~/components";
15
15
16
-
In this guide, you will create a new [Docusaurus](https://docusaurus.io/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
16
+
In this guide, you will create a new [Docusaurus](https://docusaurus.io/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
17
18
18
## 1. Set up a new project
19
19
20
20
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Docusaurus' official setup tool, and provide the option to deploy instantly.
21
21
22
-
To use `create-cloudflare` to create a new Docusaurus project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
22
+
To use `create-cloudflare` to create a new Docusaurus project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/gatsby.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ import {
13
13
PackageManagers,
14
14
} from"~/components";
15
15
16
-
In this guide, you will create a new [Gatsby](https://www.gatsbyjs.com/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
16
+
In this guide, you will create a new [Gatsby](https://www.gatsbyjs.com/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
17
18
18
## 1. Set up a new project
19
19
20
20
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Gatsby's official setup tool, and provide the option to deploy instantly.
21
21
22
-
To use `create-cloudflare` to create a new Gatsby project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
22
+
To use `create-cloudflare` to create a new Gatsby project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/nextjs.mdx
+85-70Lines changed: 85 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ pcx_content_type: how-to
3
3
title: Next.js
4
4
head: []
5
5
description: Create an Next.js application and deploy it to Cloudflare Workers with Workers Assets.
6
+
sidebar:
7
+
badge: Beta
6
8
---
7
9
8
10
import {
@@ -11,9 +13,13 @@ import {
11
13
Render,
12
14
PackageManagers,
13
15
Steps,
14
-
WranglerConfig
16
+
WranglerConfig,
15
17
} from"~/components";
16
18
19
+
:::note
20
+
The OpenNext adapter is in currently in beta.
21
+
:::
22
+
17
23
**Start from CLI** - scaffold a Next.js project on Workers.
18
24
19
25
<PackageManagers
@@ -22,9 +28,7 @@ import {
22
28
args={"--framework=next --platform=workers"}
23
29
/>
24
30
25
-
:::note
26
31
This is a simple getting started guide. For detailed documentation on how the to use the Cloudflare OpenNext adapter, visit the [OpenNext website](https://opennext.js.org/cloudflare).
27
-
:::
28
32
29
33
## What is Next.js?
30
34
@@ -40,38 +44,45 @@ You can deploy your Next.js app to Cloudflare Workers using the OpenNext adaptor
40
44
41
45
1.**Create a new project with the create-cloudflare CLI (C3).**
42
46
43
-
<PackageManagers
44
-
type="create"
45
-
pkg="cloudflare@latest my-next-app"
46
-
args={"--framework=next --platform=workers"}
47
-
/>
48
-
49
-
<Detailsheader="What's happening behind the scenes?">
50
-
When you run this command, C3 creates a new project directory, initiates [Next.js's official setup tool](https://nextjs.org/docs/app/api-reference/cli/create-next-app), and configures the project for Cloudflare. It then offers the option to instantly deploy your application to Cloudflare.
51
-
</Details>
47
+
<PackageManagers
48
+
type="create"
49
+
pkg="cloudflare@latest my-next-app"
50
+
args={"--framework=next --platform=workers"}
51
+
/>
52
52
53
-
2.**Develop locally.**
53
+
<Detailsheader="What's happening behind the scenes?">
54
+
When you run this command, C3 creates a new project directory, initiates
55
+
[Next.js's official setup
56
+
tool](https://nextjs.org/docs/app/api-reference/cli/create-next-app), and
57
+
configures the project for Cloudflare. It then offers the option to
58
+
instantly deploy your application to Cloudflare.
59
+
</Details>
54
60
55
-
After creating your project, run the following command in your project directory to start a local development server.
56
-
The command uses the Next.js development server. It offers the best developer experience by quickly reloading your app every time the source code is updated.
61
+
2.**Develop locally.**
57
62
58
-
<PackageManagerstype="run"args="dev" />
63
+
After creating your project, run the following command in your project directory to start a local development server.
64
+
The command uses the Next.js development server. It offers the best developer experience by quickly reloading your app every time the source code is updated.
59
65
60
-
3.**Test and preview your site with the Cloudflare adapter.**
66
+
<PackageManagerstype="run"args="dev" />
61
67
62
-
<PackageManagerstype="run"args="preview" />
68
+
3.**Test and preview your site with the Cloudflare adapter.**
63
69
64
-
<Detailsheader="What's the difference between dev and preview?">
65
-
The command used in the previous step uses the Next.js development server, which runs in Node.js.
66
-
However, your deployed application will run on Cloudflare Workers, which uses the `workerd` runtime. Therefore when running integration tests and previewing your application, you should use the preview command, which is more accurate to production, as it executes your application in the `workerd` runtime using `wrangler dev`.
67
-
</Details>
70
+
<PackageManagerstype="run"args="preview" />
68
71
72
+
<Detailsheader="What's the difference between dev and preview?">
73
+
The command used in the previous step uses the Next.js development server,
74
+
which runs in Node.js. However, your deployed application will run on
75
+
Cloudflare Workers, which uses the `workerd` runtime. Therefore when
76
+
running integration tests and previewing your application, you should use
77
+
the preview command, which is more accurate to production, as it executes
78
+
your application in the `workerd` runtime using `wrangler dev`.
79
+
</Details>
69
80
70
-
4.**Deploy your project.**
81
+
4.**Deploy your project.**
71
82
72
-
You can deploy your project to a [`*.workers.dev` subdomain](/workers/configuration/routing/workers-dev/) or a [custom domain](/workers/configuration/routing/custom-domains/) from your local machine or any CI/CD system (including [Workers Builds](/workers/ci-cd/#workers-builds)). Use the following command to build and deploy. If you're using a CI service, be sure to update your "deploy command" accordingly.
83
+
You can deploy your project to a [`*.workers.dev` subdomain](/workers/configuration/routing/workers-dev/) or a [custom domain](/workers/configuration/routing/custom-domains/) from your local machine or any CI/CD system (including [Workers Builds](/workers/ci-cd/#workers-builds)). Use the following command to build and deploy. If you're using a CI service, be sure to update your "deploy command" accordingly.
73
84
74
-
<PackageManagerstype="run"args="deploy" />
85
+
<PackageManagerstype="run"args="deploy" />
75
86
76
87
</Steps>
77
88
@@ -81,76 +92,80 @@ You can convert an existing Next.js application to run on Cloudflare
As shown above, you must enable the [`nodejs_compat` compatibility flag](/workers/runtime-apis/nodejs/)_and_ set your [compatibility date](/workers/configuration/compatibility-dates/) to `2024-09-23` or later for your Next.js app to work with @opennextjs/cloudflare.
104
-
:::
115
+
:::note
116
+
As shown above, you must enable the [`nodejs_compat` compatibility flag](/workers/runtime-apis/nodejs/)_and_ set your [compatibility date](/workers/configuration/compatibility-dates/) to `2024-09-23` or later for your Next.js app to work with @opennextjs/cloudflare.
117
+
:::
105
118
106
-
3.**Add a configuration file for OpenNext**
119
+
3.**Add a configuration file for OpenNext**
107
120
108
-
In your project root, create an OpenNext configuration file named `open-next.config.ts` with the following content:
121
+
In your project root, create an OpenNext configuration file named `open-next.config.ts` with the following content:
`open-next.config.ts` is where you can configure the caching, see the [adapter documentation](https://opennext.js.org/cloudflare/caching) for more information
118
-
:::
129
+
:::note
130
+
`open-next.config.ts` is where you can configure the caching, see the [adapter documentation](https://opennext.js.org/cloudflare/caching) for more information
131
+
:::
119
132
120
-
4.**Update `package.json`**
133
+
4.**Update `package.json`**
121
134
122
-
You can add the following scripts to your `package.json`:
135
+
You can add the following scripts to your `package.json`:
-`preview`: Builds your app and serves it locally, allowing you to quickly preview your app running locally in the Workers runtime, via a single command.
132
-
-`deploy`: Builds your app, and then deploys it to Cloudflare
133
-
-`cf-typegen`: Generates a `cloudflare-env.d.ts` file at the root of your project containing the types for the env.
134
-
</Details>
143
+
<Detailsheader="Usage">
144
+
-`preview`: Builds your app and serves it locally, allowing you to
145
+
quickly preview your app running locally in the Workers runtime, via a
146
+
single command. - `deploy`: Builds your app, and then deploys it to
147
+
Cloudflare - `cf-typegen`: Generates a `cloudflare-env.d.ts` file at the
148
+
root of your project containing the types for the env.
149
+
</Details>
135
150
136
151
5.**Develop locally.**
137
152
138
-
After creating your project, run the following command in your project directory to start a local development server.
139
-
The command uses the Next.js development server. It offers the best developer experience by quickly reloading your app after your source code is updated.
153
+
After creating your project, run the following command in your project directory to start a local development server.
154
+
The command uses the Next.js development server. It offers the best developer experience by quickly reloading your app after your source code is updated.
140
155
141
-
<PackageManagerstype="run"args="dev" />
156
+
<PackageManagerstype="run"args="dev" />
142
157
143
158
6.**Test your site with the Cloudflare adapter.**
144
159
145
-
The command used in the previous step uses the Next.js development server to offer a great developer experience.
146
-
However your application will run on Cloudflare Workers so you want to run your integration tests and verify that your application workers correctly in this environment.
160
+
The command used in the previous step uses the Next.js development server to offer a great developer experience.
161
+
However your application will run on Cloudflare Workers so you want to run your integration tests and verify that your application workers correctly in this environment.
147
162
148
-
<PackageManagerstype="run"args="preview" />
163
+
<PackageManagerstype="run"args="preview" />
149
164
150
165
7.**Deploy your project.**
151
166
152
-
You can deploy your project to a [`*.workers.dev` subdomain](/workers/configuration/routing/workers-dev/) or a [custom domain](/workers/configuration/routing/custom-domains/) from your local machine or any CI/CD system (including [Workers Builds](/workers/ci-cd/#workers-builds)). Use the following command to build and deploy. If you're using a CI service, be sure to update your "deploy command" accordingly.
167
+
You can deploy your project to a [`*.workers.dev` subdomain](/workers/configuration/routing/workers-dev/) or a [custom domain](/workers/configuration/routing/custom-domains/) from your local machine or any CI/CD system (including [Workers Builds](/workers/ci-cd/#workers-builds)). Use the following command to build and deploy. If you're using a CI service, be sure to update your "deploy command" accordingly.
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/nuxt.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ import {
13
13
PackageManagers,
14
14
} from"~/components";
15
15
16
-
In this guide, you will create a new [Nuxt](https://nuxt.com/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
16
+
In this guide, you will create a new [Nuxt](https://nuxt.com/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
17
18
18
## 1. Set up a new project
19
19
20
20
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Nuxt's official setup tool, and provide the option to deploy instantly.
21
21
22
-
To use `create-cloudflare` to create a new Nuxt project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
22
+
To use `create-cloudflare` to create a new Nuxt project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/qwik.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ pcx_content_type: how-to
3
3
title: Qwik
4
4
head: []
5
5
description: Create a Qwik application and deploy it to Cloudflare Workers with Workers Assets.
6
+
sidebar:
7
+
badge: Beta
6
8
---
7
9
8
10
import {
@@ -13,13 +15,17 @@ import {
13
15
PackageManagers,
14
16
} from"~/components";
15
17
16
-
In this guide, you will create a new [Qwik](https://qwik.dev/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
18
+
:::note
19
+
Support for Qwik projects on Cloudflare Workers is currently in beta.
20
+
:::
21
+
22
+
In this guide, you will create a new [Qwik](https://qwik.dev/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
23
18
24
## 1. Set up a new project
19
25
20
26
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Qwik's official setup tool, and provide the option to deploy instantly.
21
27
22
-
To use `create-cloudflare` to create a new Qwik project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
28
+
To use `create-cloudflare` to create a new Qwik project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/solid.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ pcx_content_type: how-to
3
3
title: Solid
4
4
head: []
5
5
description: Create a Solid application and deploy it to Cloudflare Workers with Workers Assets.
6
+
sidebar:
7
+
badge: Beta
6
8
---
7
9
8
10
import {
@@ -13,13 +15,17 @@ import {
13
15
PackageManagers,
14
16
} from"~/components";
15
17
16
-
In this guide, you will create a new [Solid](https://www.solidjs.com/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
18
+
:::note
19
+
Support for SolidStart projects on Cloudflare Workers is currently in beta.
20
+
:::
21
+
22
+
In this guide, you will create a new [Solid](https://www.solidjs.com/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
23
18
24
## 1. Set up a new project
19
25
20
26
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Solid's official setup tool, and provide the option to deploy instantly.
21
27
22
-
To use `create-cloudflare` to create a new Solid project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
28
+
To use `create-cloudflare` to create a new Solid project with Workers Assets, run the following command:
Copy file name to clipboardExpand all lines: src/content/docs/workers/frameworks/framework-guides/svelte.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ import {
13
13
PackageManagers,
14
14
} from"~/components";
15
15
16
-
In this guide, you will create a new [Svelte](https://svelte.dev/) application and deploy to Cloudflare Workers (with the new [<InlineBadgepreset="beta" /> Workers Assets](/workers/static-assets/)).
16
+
In this guide, you will create a new [Svelte](https://svelte.dev/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)).
17
17
18
18
## 1. Set up a new project
19
19
20
20
Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, initiate Svelte's official setup tool, and provide the option to deploy instantly.
21
21
22
-
To use `create-cloudflare` to create a new Svelte project with <InlineBadgepreset="beta" /> Workers Assets, run the following command:
22
+
To use `create-cloudflare` to create a new Svelte project with Workers Assets, run the following command:
0 commit comments