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

improve Neon guide, highlighting API use in Next.js #1234

Merged
merged 8 commits into from
Jul 16, 2024
Merged

improve Neon guide, highlighting API use in Next.js #1234

merged 8 commits into from
Jul 16, 2024

Conversation

kevinzunigacuellar
Copy link
Contributor

@kevinzunigacuellar kevinzunigacuellar commented Jul 6, 2024

Explanation:

The current Neon guide, despite being written for Clerk, doesn't highlight the use of Clerk APIs within the demo app.

This PR:

  • Removed unnecessary drizzle migration step.
  • Reordered final steps to improve continuity.
  • Highlighted usage of clerk skd in middleware and server actions.
  • Edited section titles
  • Remove classNames for better readability
  • Simplify code blocks

Kevin Zuniga Cuellar added 2 commits July 5, 2024 22:51
@kevinzunigacuellar kevinzunigacuellar requested a review from a team as a code owner July 6, 2024 03:25
Copy link
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

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

Thank you for these suggestions!! We definitely need to market the use of Clerk more. I like the separation of the server action / UI section. I like that you removed the styling - that was a good find!

I've left other suggestions - and one overall suggestion is that we should use auth().userId instead of currentUser().user.id
currentUser() counts towards rate limiting and is better suited for retrieving the entire User object. because we only need the user's ID in these examples, it'd be better to use auth().userId - it won't count towards rate limiting and gives us exactly what we need.

docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
1. Inside the `app/` directory, create a `db` folder.
1. Inside the `db/` folder, create a `schema.ts` file and an `index.ts` file.
1. Use the tabs below to find the example code for the schema and index files.
To define the database schema and set up the database connection, create a `schema.ts` and a `index.ts` file in the `app/db` directory. In this example, `user_id` will be used to store the user's Clerk ID in the database.
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you're moving away from the numbered list?

Shaquil, our previous Docs team member who came from Vercel docs, implemented numbered lists to give broken-down, instructional steps. We have to tell users that they need to create a db folder - they probably won't have one in their app already.

Let's try combining your suggestion with the numbered instructions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the instructions are short and intertwined enough to be condensed into a sentence.

The most important part to highlight is the use of user_id to store the user ID. Since having a database file is very common, users will likely modify their existing schema rather than creating one from scratch.

However, if you prefer to keep the numbered list, I am more than happy to combine both suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

let's combine both suggestions and see how it looks - and then decide :~)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in 5cc044c

docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
docs/integrations/databases/neon.mdx Outdated Show resolved Hide resolved
@kevinzunigacuellar
Copy link
Contributor Author

I've included many of your suggestions, including using auth() instead of currentUser(), and made a few rewording changes. Let me know what you think. I believe it's coming together nicely. Thanks for the thorough review @alexisintech !

Copy link
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

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

amazing updates - thank you so much for contributing on this 😸💖

@alexisintech alexisintech merged commit 8baaa7e into clerk:main Jul 16, 2024
2 checks passed
@kevinzunigacuellar kevinzunigacuellar deleted the neon-notes branch July 16, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants