-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
feat(create-pages): page part component #1313
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
ah page parts pages need to be added to the typegen /draft |
@@ -237,6 +252,11 @@ export const createPages = < | |||
createLayout: CreateLayout; | |||
createRoot: CreateRoot; | |||
createApi: CreateApi; | |||
/** | |||
* Page Part pages are assumed to be dynamic in order to allow dynamic components. |
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.
This sounds like a limitation.
Can't we make all page parts static and make the entire page static?
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.
Technically you can, but why would you?
If your goal is to make a static page, shouldn't you just use createPage?
createPagePart only seems useful when you're mixing dynamic and static which then requires the page to be dynamic, right?
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.
shouldn't you just use createPage?
Technically, not always.
getConfig
itself is dynamically configurable at build time.
export const getConfig = async () => {
return {
render: Date.now() < SOME_POINT ? 'static' : 'dynamic',
};
};
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.
I see what you mean. I can add logic for static page when all parts are static in that case. Thanks for the example.
page part components open up support for multiple components per each page. These components are siblings in place of where a page component would be typically.
this is useful for marking parts of a page static and other parts dynamic.