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

Rearrange exports for RSC and add experimental RSC route to example #913

Merged
merged 6 commits into from
Nov 18, 2022

Conversation

adamjmcgrath
Copy link
Contributor

📋 Changes

  • moved /frontend -> /client to align with Next.js
  • moved client code out of the main export to /client (eg import { useUser } from '@auth0/nextjs-auth0/client') because server components can't import client code
  • moved /middleware -> /edge (eg import { withMiddlewareAuthRequired } from '@auth0/nextjs-auth0/edge') because this export will include code that can run on the Edge runtime in Server Components and API Routes in addition to Middleware.

@adamjmcgrath adamjmcgrath added the review:large Large review label Nov 18, 2022
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner November 18, 2022 12:29
@vercel
Copy link

vercel bot commented Nov 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nextjs-auth0 ⬜️ Ignored (Inspect) Nov 18, 2022 at 1:24PM (UTC)

src/helpers/testing.ts Outdated Show resolved Hide resolved
WithPageAuthRequiredProps,
WithPageAuthRequiredOptions
} from './with-page-auth-required';
export { ConfigProvider, ConfigProviderProps, useConfig };
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to export useConfig given that it's only used internally?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for ConfigProvider and ConfigProviderProps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a fair point, will fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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


const Header = (): React.ReactElement => {
const { user } = useUser();

return (
<header>
<div id="header">
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: should this be a <nav>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be a <header> - but the Server Component renderer was throwing errors on <header>, so I changed it to a <div>

V2_MIGRATION_GUIDE.md Outdated Show resolved Hide resolved
@adamjmcgrath adamjmcgrath merged commit 76c386f into vNext Nov 18, 2022
@adamjmcgrath adamjmcgrath deleted the server-client-export branch November 18, 2022 13:38
@adamjmcgrath adamjmcgrath mentioned this pull request Nov 30, 2022
@Widcket Widcket mentioned this pull request Jan 21, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:large Large review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants