-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Next.js integration: run Toolpad apps as React server components #3125
base: master
Are you sure you want to change the base?
Conversation
dir: string; | ||
} | ||
|
||
export async function ToolpadApp({ base, dir = './toolpad' }: ToolpadAppServerProps) { |
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.
How does the app decide which page to run? If it's the URL path concerning base
, is it possible to abstract the URL from the app and modify the props as follows?
export interface ToolpadAppServerProps {
dir: string;
page: string;
}
It could help us dynamically render any page without worrying about the paths, giving user more control IMO. WDYT?
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.
Yes, that makes sense. This is somewhat on hold because it depends on a bunch of low-level work that needs to happen first. We'll also have to abstract Toolpad routing to be able to plug in the Next.js router.
Another option I'm thinking of is to expose another component that renders a single page instead of the whole app.
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.
Another option I'm thinking of is to expose another component that renders a single page instead of the whole app.
Yes, that would be even more useful for my use case where I have a backend to pull the MDX file and I can transform it on the fly render the page without even shell. If we can pass components
and resources
as well, the applications can utilize Toolpad's application model to render the generated pages in our app.
WIP
Closes #3012
To Do:
@blitz/internal
warninglatest-version
generates webpack warnings