You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the presence in a page/component of getInitialProps() disables the automatic static optimization. Having that optimization helps a lot to improve performance.
In the official Tina tutorial for Next.js, I can't find how to pull the required data to pre-render a page (in case it's a static one), at build time. Is this already happening or not? In other words, is Tina using getInitialProps() to pull the data at runtime, thus turning Next.js in a dynamic-only framework?
Thanks for bringing this up @sorleone - I'm still getting the hang of Next and figuring out the best way to do things. You are correct that the current implementation demonstrated in Tina's Next.js tutorial does not create a static site, but in fact requires a node server to prepare the markdown content upon request. I know this isn't ideal, but for what it's worth, the tutorials on the Tina site are primarily geared toward showing you how to use Tina and aim to spend a minimum amount of time on project setup.
It's true that getInitialProps disables automatic static optimization, but you can still manually tell Next how to export static pages for your site by creating an exportPathMap() function in next.config.js. NextJS has a tutorial on how to use exportPathMap that might help you along here.
I'm going to close this issue, with two notes:
Issues related to the documentation or content on tinacms.org would better fit in the tinacms-site repo, so please feel free to post any further concerns there.
After researching this issue, I plan to write a blog post on how to use exportPathMap to statically generate pages. This post will be published to tinacms.org, so keep an eye out for it!
As you can read here:
https://nextjs.org/docs#automatic-static-optimization
the presence in a page/component of
getInitialProps()
disables the automatic static optimization. Having that optimization helps a lot to improve performance.In the official Tina tutorial for Next.js, I can't find how to pull the required data to pre-render a page (in case it's a static one), at build time. Is this already happening or not? In other words, is Tina using
getInitialProps()
to pull the data at runtime, thus turning Next.js in a dynamic-only framework?https://tinacms.org/docs/nextjs/creating-forms
The text was updated successfully, but these errors were encountered: