-
Notifications
You must be signed in to change notification settings - Fork 212
(docs: nextjs QS) fix incorrect title; update convexclientprovider explanation #60
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
Conversation
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.
Thank you! I'll land this, expect to see it out later today
@@ -133,8 +130,9 @@ version of this quickstart. | |||
</Step> | |||
|
|||
<Step title="Create a client component for the Convex provider"> | |||
Add a new file <JSDialectFileName name="ConvexClientProvider.tsx" /> in the `app/` folder. Include the `"use client";` directive, create a | |||
`ConvexReactClient` and a component that wraps its children in a `ConvexProvider`. | |||
For `<ConvexProvider>` to work on the client, `<ConvexReactClient>` must be passed to it. |
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.
For `<ConvexProvider>` to work on the client, `<ConvexReactClient>` must be passed to it. | |
For `<ConvexProvider>` to work on the client, `ConvexReactClient` must be passed to it. |
package, which provides a convenient interface for working | ||
with Convex. |
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.
package, which provides a convenient interface for working | |
with Convex. | |
package. |
agree "from a React app" wasn't very useful, and now the rest doesn't seem useful either IMO
`ConvexReactClient` and a component that wraps its children in a `ConvexProvider`. | ||
For `<ConvexProvider>` to work on the client, `<ConvexReactClient>` must be passed to it. | ||
|
||
In the `app/` folder, add a new file <JSDialectFileName name="ConvexClientProvider.tsx" /> with the following code. This creates a component that wraps `<ConvexProvider>` and passes it the `<ConvexReactClient>`. |
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.
In the `app/` folder, add a new file <JSDialectFileName name="ConvexClientProvider.tsx" /> with the following code. This creates a component that wraps `<ConvexProvider>` and passes it the `<ConvexReactClient>`. | |
In the `app/` folder, add a new file <JSDialectFileName name="ConvexClientProvider.tsx" /> with the following code. This creates a client component that wraps `<ConvexProvider>` and passes it the `<ConvexReactClient>`. |
@@ -172,7 +170,7 @@ version of this quickstart. | |||
</Step> | |||
|
|||
<Step title="Start the app"> | |||
Start the app, open [http://localhost:3000](http://localhost:3000) in a browser, | |||
Run your development server, open [http://localhost:3000](http://localhost:3000) in a browser, |
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.
since "development server" is an overloaded term in convex I'll add "Next.js" or "frontend" here
love it |
Yeah good point, we held off to avoid needing to create Next.js-specific code using the (at the time only used by) Next.js Maybe soon! This isn't the only way to set this up Convex providers with Clerk but it seems reasonable to make the common path easier. |
Landed in 85fe152 Thanks @alexisintech! |
woah what did you do to get it into that commit?? also, love all the helpful communication and openness to accepting these updates ❤️ thanks so much :) |
thanks for sharing the motivation behind these changes, gives us some positive second order effects from teaching in addition to the specific improvements! we're using copybara to get code between our open source repo and the closed-source one, which unfortunately means the PR shows as Closed instead of Merged here but at least does preserve authorship via |
awesome! i've never seen that, its so cool |
Clerk employee here 👋 While checking out the Convex docs to see how to integrate Convex into a Clerk + Next.js app, I noticed the Next.js QS could use some love. From the Clerk Docs team to yours 💜
Notes about the changes:
convex/
folder" should be the lead of a sentence, because its the first in a sequence of events. A user will first need to go to theirconvex/
folder to then create a new file; it's the first step so it should be the first direction given in the sentence.and the export name: `api.tasks.get`.
. It originally read asthe export name, `api.tasks.get`.
which grammatically was telling me that the export name wasapi.tasks.get
which I was really confused by. When I finally got to the end of the QS, I learned that the API function itself is what's calledapi.tasks.get
and then I understood what the doc was trying to convey. So I've made a small change to help understandability.Also, I'm surprised you don't abstract the
ConvexClientProvider
part away for users so they can skip the step of creating it themselves and simply import it from Convex itself and then wrap their app (similar to how we doClerkProvider
). 👀Cheers 😸💖
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.