Skip to content
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

Add Workers Assets + Vue framework guide #20584

Open
wants to merge 3 commits into
base: production
Choose a base branch
from

Conversation

emily-shen
Copy link
Contributor

Summary

Essentially the same as #20214 :)

cc @ToriLindsay - I've added the section on bindings back in, as I think its useful to have. If it looks okay we can add it to the React guide as well?

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Howdy and thanks for contributing to our repo. We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hyperlint Review is complete!

Hyperlint Vale Style Guide Review

Reviewed 1 files and found 1 issues.

See the inline comments and suggestions below.

Hyperlint Link Check Review

Reviewed 1 files and found 0 issues.


We are upgrading our reviewer model! Going forward, our model will learn your particular style - which comments you all accept and reject, so that it can further personalize its suggestions.

What is Hyperlint?

Hyperlint is an AI agent that helps you write, edit, and maintain your documentation. It can review, edit, and suggest fixes for your documentation.

Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation.


## Bindings

Your new project also contains a Worker (at `./server/index.ts`), which you can use as a backend API for your Vue application. From this Worker, you can use bindings to access resources on the Cloudflare Developer Platform. Learn how to [configure Workers bindings](/workers/runtime-apis/bindings/).
Copy link
Contributor

@ToriLindsay ToriLindsay Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Your new project also contains a Worker (at `./server/index.ts`), which you can use as a backend API for your Vue application. From this Worker, you can use bindings to access resources on the Cloudflare Developer Platform. Learn how to [configure Workers bindings](/workers/runtime-apis/bindings/).
Your Vue application cannot directly access Workers bindings, but it can interact with them through a Worker backend API at `./server/index.ts`. You can make [`fetch()` requests](/workers/runtime-apis/fetch/) from your Vue application to the Worker, which can then handle the request and connect to bindings. Learn how to [configure Workers bindings](/workers/runtime-apis/bindings/).

@emily-shen
To answer your comment, I removed Bindings from the React framework guide per @petebacondarwin 's recommendation, because React is different from the other frameworks in that it doesn't connect with Workers directly (if I understand correctly) and it's simpler without mentioning Bindings. But it seems like maybe Vue is similar to React in that way?
If so, here is what I had written for React (adapted for Vue) before I saw Pete's comment about deleting it. Let me know what you think. If this works, it's up to you / @petebacondarwin if you think we should add it into both guides? (And also Gatsby + other similar frameworks?)

Copy link
Contributor Author

@emily-shen emily-shen Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup the React and Vue templates are very similar so whatever we end up with should apply to both. I meant to chip in the react PR but saw it was getting merged, thought it would be easier to followup here - sorry about the confusion 😅

It's definitely simpler to omit bindings, but imo it's also less complete. We could've created a template that didn't have a Worker and only React/Vue, but since we did include a Worker for a backend, it seems like we should explain that here in the docs, along with a bit of info about how to set up bindings. The suggestion you have about sounds great to me for that purpose.

This wouldn't apply to Gatsby etc. though, because those template don't include a Worker.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emily-shen
Awesome. Thanks for the clarification! If we have time on this, I'll wait for @petebacondarwin to confirm that we can add it to React as well so we're all aligned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit about the phrasing of "Workers backend API" - someone could confuse it with a Workers platform API, rather than a worker being used for a backend?

what about:

Suggested change
Your new project also contains a Worker (at `./server/index.ts`), which you can use as a backend API for your Vue application. From this Worker, you can use bindings to access resources on the Cloudflare Developer Platform. Learn how to [configure Workers bindings](/workers/runtime-apis/bindings/).
Your new project also contains a Worker at `./server/index.ts`, which you can use as a backend API for your Vue application. While your Vue application cannot directly access Workers bindings, it can interact with them through this Worker. You can make [`fetch()` requests](/workers/runtime-apis/fetch/) from your Vue application to the Worker, which can then handle the request and connect to bindings. Learn how to [configure Workers bindings](/workers/runtime-apis/bindings/).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section looks good. Feel free to roll it out to the React doc too. Either in this PR or we/I can create a new PR for React.


<Render file="workers-assets-routing-summary" />

## Bindings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Bindings
## Connect Vue with Workers bindings

@ToriLindsay
Copy link
Contributor

Summary

Essentially the same as #20214 :)

cc @ToriLindsay - I've added the section on bindings back in, as I think its useful to have. If it looks okay we can add it to the React guide as well?

Answered as inline suggestion


## Bindings

Your new project also contains a Worker (at `./server/index.ts`), which you can use as a backend API for your Vue application. From this Worker, you can use bindings to access resources on the Cloudflare Developer Platform. Learn how to [configure Workers bindings](/workers/runtime-apis/bindings/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section looks good. Feel free to roll it out to the React doc too. Either in this PR or we/I can create a new PR for React.

@emily-shen
Copy link
Contributor Author

Updated the react doc here: 64a5a5c

Copy link
Contributor

@ToriLindsay ToriLindsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emily-shen Approved.

@emily-shen
Copy link
Contributor Author

@ToriLindsay added the section to the react template already in 64a5a5c :)

Thanks for all your help!

I'll merge this next Tuesday when our next c3 release is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked product:workers Related to Workers product size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants