* Rename unstable GSP revalidate field
* Update error message
* Tweak error message some more
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
* Verify GS(S)P Serializability
* Add support for cyclic refs
* Add unit tests
* Test for error in development mode
* Fix prerender preview tests
* Fix gssp preview tests
* fix 2x test cases
* Add desired test
* fix some more tests
* Fix route manifest expect
* Fix test expects
* Test that `getServerSideProps` does not error in production
* Test that getStaticProps is not checked in production
* Test serialization check during build
* Fix export detection for serverless
* Update test/unit/is-serializable-props.test.js
Co-Authored-By: JJ Kasper <jj@jjsweb.site>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
* Rename getServerProps to getServerSideProps
* Remove unstable_ prefix from new methods
* Add error when legacy methods are detected
* Add legacy methods for babel transform
* Add unstable_getServerSideProps also
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Update types import
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Ability to Disable SSG Fallback
* Throw error when value is missing
* Fix existing tests
* Adjust error message
* Do not render fallback at build time for `fallback: false` page
* Fix existing fallback behavior
* fix build
* fix version
* fix some tests
* Fix last test
* Add docs for get static paths
* Add explicit mode tests
* test for fallback error message
This adds a `isFallback` property to detect if the page is being rendered in "fallback" mode or normal mode.
Accessed via the `useRouter()` hook.
---
Closes#10527
* Add initial SSG fallback handling
* Remove extra changes and update fallback handling
* Remove extra timeout for testing
* Update SSG tests in dynamic-routing suite
* Add racing to decide between rendering fallback and data
* Update size-limit test
* Update comment
* Make sure to follow correct route change order
* Make comment more verbose for racing
* Revert getStaticData to only return Promise
* Make sure to update URL on fallback
* Add retrying for data, de-dupe initial fallback request, and merge fallback replace
* Update to add preload for fallback pages data
* Add test for data preload link
* Use pre-built fallback in production mode
* Remove preload link for fallback from _document
* Update to make sure fallback is rendered correctly for serverless
* Use Cached SSG Data on History Navigation
* Add data caching test
* Create a static data cache
* Eliminate an if / return
* Do not cache in dev mode
* bump
* bump
* bump
* bump
Co-authored-by: JJ Kasper <jj@jjsweb.site>
* WIP: rename get static paths
* Adjust logic
* Add warning
* rename constant
* Check for error when using old method
* Add friendly error message
* Test for message of invalid keys
* replace index with dots
* Ensure directory before flushing cache iSSG file
* Add test for prerender cache flush
* Nest the dynamic route test one more level
* update fetch for test
* Update error check
* Configure the Default Revalidate
The default revalidate behavior should be configured by Next.js. Otherwise, the behavior might drift or change in non-semver compliant ways between Next.js and the builder (or other 3rd party setups).
* Add additional comment
* Add revalidate header and error when invalid
object from getStaticProps
* Make sprCache no-op in dev mode
* Update packages/next/next-server/server/next-server.ts
* Update tests for fixes
* Update getStaticProps error and add test
* Update manifest test
* Add validating revalidate value
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Change from error to warning high revalidate value
* initial commit for SPRv2
* Add initial SPR cache handling
* update SPR handling
* Implement SPR handling in render
* Update tests, handle caching with serverless next
start, add TODOs, and update manifest generating
* Handle no prerender-manifest from not being used
* Fix url.parse error
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
* Replace set with constants in next-page-config
* simplify sprStatus.used
* Add error if getStaticProps is used with getInitialProps
* Remove stale TODO
* Update revalidate values in SPR cache for non-seeded routes
* Apply suggestions from code review
* Remove concurrency type
* Rename variable for clarity
* Add copying prerender files during export
* Add comment for clarity
* Fix exporting
* Update comment
* Add additional note
* Rename variable
* Update to not re-export SPR pages from build
* Hard navigate when fetching data fails
* Remove default extension
* Add brackets
* Add checking output files to prerender tests
* Adjust export move logic
* Clarify behavior of export aggregation
* Update variable names for clarity
* Update tests
* Add comment
* s/an oxymoron/contradictory/
* rename
* Extract error case
* Add tests for exporting SPR pages and update
/_next/data endpoint to end with .json
* Relocate variable
* Adjust route building
* Rename to unstable
* Rename unstable_getStaticParams
* Fix linting
* Only add this when a data request
* Update prerender data tests
* s/isServerless/isLikeServerless/
* Don't rely on query for `next start` in serverless mode
* Rename var
* Update renderedDuringBuild check
* Add test for dynamic param with bracket
* Fix serverless next start handling
* remove todo
* Adjust comment
* Update calculateRevalidate
* Remove cache logic from render.tsx
* Remove extra imports
* Move SPR cache logic to next-server
* Remove old isDynamic prop
* Add calling App getInitialProps for SPR pages
* Update revalidate logic
* Add isStale to SprCacheValue
* Update headers for SPR
* add awaiting pendingRevalidation
* Dont return null for revalidation render
* Adjust logic
* Be sure to remove coalesced render
* Fix data for serverless
* Create a method coalescing utility
* Remove TODO
* Extract send payload helper
* Wrap in-line
* Move around some code
* Add tests for de-duping and revalidating
* Update prerender manifest test
* Add checking for hybrid AMP during static check
* Update to always hit server for prerender data
* Add removing of SPR code when not used
* Add checking for hybrid AMP during static check
* Update to always hit server for prerender data
* Add removing of SPR code when not used
* Update dead code elimination
* Revert "Remove Old Prerender Implementation (#8218)"
This reverts commit 2ab300dd81.
* Add contentHandler for page config
* Rename config from contentHandler to re-use
experimentalPrerender
* Remove un-needed changes
* Replace backslashes for manifest
* Update manifest output format
* Make prerender: true enable SPR behavior and update
to merge prerender-manifest for flying-shuttle
* Fix output path for / prerender file
* Add dynamic routes to test suite
* Add generating and previewing of skeletons
for prerendered dynamic routes
* remove inline prerender option
* update to not replace getInitialProps which allows
nested getInitialProps and add query when fetching prerender
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Remove legacy prerender option
* Apply suggestions from review
* Apply more suggestions from review
* Apply suggestions from code review
Co-Authored-By: Joe Haddad <timer150@gmail.com>
* Add handling of error when parsing json
* Update handling of moving exported pages
* Rename nextPreviewSkeleton to _nextPreviewSkeleton
* bump
* Add prerender PageConfig option
* Update PageConfig type
* Add inlining of data when pre-render is set and add tests
* Update types import
* Add check for props
* Rename prerender to experimentalPrerender for now