-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
docs(static-deploy): improve Cloudflare documentation to highlight Workers #21411
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
base: main
Are you sure you want to change the base?
Conversation
- Rename 'Cloudflare Pages' section to 'Cloudflare' in deployment guide - Add Cloudflare Workers as the primary deployment option - Include setup instructions for create-cloudflare CLI - Document how to add plugin to existing projects - Highlight Environment API integration and full platform support - Keep Cloudflare Pages as secondary option for existing projects - Reference Cloudflare Vite plugin as example in Environment API docs Cloudflare Workers with the Vite plugin is now the recommended approach for deploying Vite applications to Cloudflare, supporting SPAs, SSR, and the full Cloudflare Developer Platform.
docs/guide/static-deploy.md
Outdated
| #### Create a new app | ||
|
|
||
| You can create a new Vite project configured for Cloudflare Workers using `create-cloudflare`: | ||
|
|
||
| ```bash | ||
| $ npm create cloudflare@latest my-vite-app -- --framework=react | ||
| ``` | ||
|
|
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 don't think we should be pushing users towards React in the Vite docs. We could include React and Vue (arguably we should add SPA templates for more frameworks) or omit this section.
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 think once we support other frameworks in create cloudflare we could come back to this. Vite's choice on whether we should make this example more generic for now.
We should absolutely get a Vite example with another framework in create cloudflare though.
|
|
||
| The Cloudflare Vite plugin supports the full [Cloudflare Developer Platform](https://developers.cloudflare.com/workers/), including KV, D1, Durable Objects, Workflows, and more. Learn more in the [Cloudflare Vite Plugin documentation](https://developers.cloudflare.com/workers/vite-plugin/). | ||
|
|
||
| ### Cloudflare Pages |
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.
Do we need to include Pages still? I think this guide is mainly geared towards users deploying for the first time.
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 think once we have autoconfig working in GA with Vite static sites we can remove this. That would be the equivalent.
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.
When should the (first-time) user choose Pages over Workers? If it's only for existing users, I think it should be removed. If it's for Git integration (until implemented to Workers), I think we should have "Cloudflare Workers via Wrangler" section and "Cloudflare Pages with Git" section.
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.
So this is a little complex and we're arguably not helping ourselves here.
Cloudflare Pages is a still supported product that is seeing no further development.
We are bringing all the features that Pages is popular for into Workers. At some point in the future it's likely the two products will merge but only at the point where we are at full parity and there is a Pages-equivalent experience in Workers.
For the purposes of this guide, Workers has a git integration and you can start with a project from git. However, right now you need a wrangler configuration file for a Worker to be deployed. We have work due for release this quarter that will (for the most part) remove that requirement by automatically generating it when you link a repository.
Ideally, if you're a knowledgeable user, and you want to get the most out of Vite, our best platform is Workers and will continue to be Workers. Perhaps that means that we should drop the Pages section entirely. The only case in which Pages is better for you is if you just want to deploy and forget about it, which as said we aim to rectify through automatic configuration this quarter.
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.
Hi from the SvelteKit team 👋🏼 we're wondering if we should also try to steer users towards Workers by adding a note in the Cloudflare Pages section of https://svelte.dev/docs/kit/adapter-cloudflare
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
- Remove 'Create a new app' section to avoid framework bias - Simplify setup instructions by removing numbered list - Add minimal backend API example showing Worker with /api/ route - Demonstrate API runs in dev server and deploys with frontend - Link to full tutorial for complete walkthrough
|
|
||
| The Cloudflare Vite plugin supports the full [Cloudflare Developer Platform](https://developers.cloudflare.com/workers/), including KV, D1, Durable Objects, Workflows, and more. Learn more in the [Cloudflare Vite Plugin documentation](https://developers.cloudflare.com/workers/vite-plugin/). | ||
|
|
||
| ### Cloudflare Pages |
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.
When should the (first-time) user choose Pages over Workers? If it's only for existing users, I think it should be removed. If it's for Git integration (until implemented to Workers), I think we should have "Cloudflare Workers via Wrangler" section and "Cloudflare Pages with Git" section.
Hello!
I work on the authoring team at Cloudflare responsible for Vite on the Cloudflare Workers and Pages platform.
We wanted to suggest some updates to the documentation to highlight some of our work that we think will improve users experience using Cloudflare. The changes are summarised below:
Thanks so much, happy to work on this with you if you want further changes or clarifications,
Matt
cc: @jamesopstad