-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the Next.js Pages guide to use the latest tooling #13001
Conversation
d17cafa
to
c9621c6
Compare
Deploying with Cloudflare Pages
|
Files with changes (up to 15) |
@@ -47,7 +47,7 @@ Git integration cannot currently be added to existing Pages applications. If you | |||
|
|||
## Configure and deploy a project without C3 | |||
|
|||
If you already have a Next.js project or wish to manually create and deploy one without using C3, Cloudflare recommends that you use `@cloudflare/next-on-pages` and refer to its [README](https://github.com/cloudflare/next-on-pages/tree/main/packages/next-on-pages#cloudflarenext-on-pages) for instructions and additional information to help you develop and deploy your project. | |||
If you already have a Next.js project or wish to manually create and deploy one without using C3, Cloudflare recommends that you use `@cloudflare/next-on-pages` and refer to its [README](https://github.com/cloudflare/next-on-pages/blob/3846730c4a0d12/packages/next-on-pages#cloudflarenext-on-pages) for instructions and additional information to help you develop and deploy your project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deadlypants1973 Instead of having generic github links I thought it'd be more secure to have permalinks
(meaning that if the github files change the links keep pointing to the same content, instead of having links pointing to content that might change over time)
Please let me know if you agree 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dario-piotrowicz I recommend against this as the link will take people to a stale version of the doc over time. What I recommend instead is that you create a manual anchor in the readme.md via <a name="manual-installation">
for example and refer to it here. Manual anchors are unlikely to break easily so you get both the stability of the link as ability to refresh the readme.md content without having to come back here to update the link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The #cloudflarenext-on-pages
is actually unnecessary, it is pointing to the readme title (and all it does is making github scroll the user to the beginning of the README), if you're ok with it I might as well just remove it, simply point to the file and revert back the blob/
change 🙂
### Set up bindings for a deployed application | ||
|
||
To access bindings in a deployed application, you will need to [configure](/pages/functions/bindings/) any necessary bindings and connect them to your project via your project's settings page in the Cloudflare dashboard. | ||
|
||
### Add bindings to Typescript projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this section up because, for typescript project it is a prerequisite of the Access bindings in the application
one
c9621c6
to
e925828
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few suggestions but the rest looks great! Thanks Dario
@@ -47,7 +47,7 @@ Git integration cannot currently be added to existing Pages applications. If you | |||
|
|||
## Configure and deploy a project without C3 | |||
|
|||
If you already have a Next.js project or wish to manually create and deploy one without using C3, Cloudflare recommends that you use `@cloudflare/next-on-pages` and refer to its [README](https://github.com/cloudflare/next-on-pages/tree/main/packages/next-on-pages#cloudflarenext-on-pages) for instructions and additional information to help you develop and deploy your project. | |||
If you already have a Next.js project or wish to manually create and deploy one without using C3, Cloudflare recommends that you use `@cloudflare/next-on-pages` and refer to its [README](https://github.com/cloudflare/next-on-pages/blob/3846730c4a0d12/packages/next-on-pages#cloudflarenext-on-pages) for instructions and additional information to help you develop and deploy your project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dario-piotrowicz I recommend against this as the link will take people to a stale version of the doc over time. What I recommend instead is that you create a manual anchor in the readme.md via <a name="manual-installation">
for example and refer to it here. Manual anchors are unlikely to break easily so you get both the stability of the link as ability to refresh the readme.md content without having to come back here to update the link.
@@ -108,7 +108,7 @@ Projects created with C3 have bindings for local development set up by default. | |||
|
|||
{{</Aside>}} | |||
|
|||
To set up bindings for use in local development, you will use the `setupDevBindings` function provided by [`@cloudflare/next-on-pages/next-dev`](https://github.com/cloudflare/next-on-pages/tree/main/internal-packages/next-dev). This function allows you to specify bindings that work locally, and are accessed the same way remote bindings are. | |||
To set up bindings for use in local development, you will use the `setupDevPlatform` function provided by [`@cloudflare/next-on-pages/next-dev`](https://github.com/cloudflare/next-on-pages/blob/3846730c4a0d12/internal-packages/next-dev). This function, tries to read the project's [`wrangler.toml`](/workers/wrangler/configuration/) file and based on it sets up a platform emulation that your Next.js application can make use of locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is already pointing to the readme itself, so if it's ok by you I'll just revert the blob/
part to /tree/main
🙂
update the Next.js Pages guide to use the latest tooling consistently to the changes made in C3: cloudflare/workers-sdk#5009 Such changes include: - renaming `setupDevBindings` with `setupDevPlatform` - updating the bindings access to use `getRequestContext` - update the C3 scaffolded script names - update the `env.d.ts` file content
… next-on-pages READMEs
Co-authored-by: Kate Tungusova <70746074+deadlypants1973@users.noreply.github.com>
764fd04
to
7434eac
Compare
faa51d9
to
7434eac
Compare
update the Next.js Pages guide to use the latest tooling consistently to the changes made in C3: cloudflare/workers-sdk#5009
Such changes include:
setupDevBindings
withsetupDevPlatform
getRequestContext
env.d.ts
file contentresolves #12972