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

DX Guide: Using Organization Slugs in URLs #1664

Merged
merged 49 commits into from
Dec 20, 2024
Merged

Conversation

izaaklauer
Copy link
Contributor

@izaaklauer izaaklauer commented Oct 28, 2024

Preview: https://clerk.com/docs/pr/1664/organizations/org-slugs-in-urls
✅ Depends on https://github.com/clerk/clerk-docs/pull/1634/files
✅ Depends on publication of https://github.com/clerk/orgs

What changed?

This adds a new DX guide based on new middleware options (introduced in clerk/javascript#3977) for managing the active clerk organization with URL patterns.

@izaaklauer izaaklauer requested a review from a team as a code owner October 28, 2024 20:17
Copy link

Hey, here’s your docs preview: https://clerk.com/docs/pr/1664

Comment on lines 66 to 67
> links with their coworkers. Public documentation, marketing, and third-party blogs are also
> made easier to write if links aren't tied to any specific organization.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this feel clear enough to folks? If not, I can add an example. It would be something like:

For example, if someone is writing a public post that includes a link to settings, if that link is /orgs/acmecorp/settings, it will only be useful to employees of Acmecorp! If the URL is just /settings, then it's universally applicable and automatically contextualized into the click-er's organization by virtue of the organization encoded on the Clerk session.

docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
> Skipping organization activation.

> [!CAUTION]
> It is ultimately the responsibility of the page to ensure that it renders the appropriate content for a given URL, and
Copy link
Member

Choose a reason for hiding this comment

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

IMO those "caution" blocks can be a bit alarming to developers. I'd suggest removing this block and putting more specific guidance with comments on the code block below.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with Laura. We should avoid having multiple callouts especially ones that are lengthy.

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'll be honest, inspiring mild alarm in the reader is what I was going for. If a developer were to just look at the organization slug in the URL, assume this meant that the middleware authorized access to the org, then render some sensitive org-specific content from their backend, that would be a very bad bug.

Hey @BRKalow , do you happen to have an opinion on the best way to communicate this one?

docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
Copy link
Member

@LauraBeatris LauraBeatris left a comment

Choose a reason for hiding this comment

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

🏅 Looking good! I'll leave the rest of the feedback here to @victoriaxyz

Copy link
Contributor

@victoriaxyz victoriaxyz left a comment

Choose a reason for hiding this comment

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

Looking great! 🎉

Some notes:

  • headings should be in active voice
  • use contractions for verbs
  • avoid using too many callouts

docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/guides/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/manifest.json Outdated Show resolved Hide resolved
@alexisintech alexisintech force-pushed the izaak/orgs-132-dx-guide branch from 0df3fd6 to 5d7de1a Compare November 4, 2024 18:55
docs/organizations/using-org-slugs.mdx Outdated Show resolved Hide resolved
docs/organizations/org-slugs-in-urls.mdx Outdated Show resolved Hide resolved
docs/organizations/org-slugs-in-urls.mdx Outdated Show resolved Hide resolved
docs/organizations/org-slugs-in-urls.mdx Outdated Show resolved Hide resolved
@victoriaxyz
Copy link
Contributor

Hey @izaaklauer, here are my update: 3957f81 and ba9a40b

  • rewrite sections and headings
  • fix title, description, and steps in <TutorialHero />
  • fix code examples: file names, line highlighting, param order, and comments

docs/organizations/org-slugs-in-urls.mdx Outdated Show resolved Hide resolved
docs/organizations/org-slugs-in-urls.mdx Outdated Show resolved Hide resolved
docs/organizations/org-slugs-in-urls.mdx Outdated Show resolved Hide resolved
Copy link
Contributor Author

@izaaklauer izaaklauer left a comment

Choose a reason for hiding this comment

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

@alexisintech alexisintech merged commit fcd6039 into main Dec 20, 2024
4 checks passed
@alexisintech alexisintech deleted the izaak/orgs-132-dx-guide branch December 20, 2024 15:31
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.

4 participants