Skip to content

Commit

Permalink
Remove legacy checks for unstable_getXProps (vercel#55813)
Browse files Browse the repository at this point in the history
These methods have been landed for multiple years now, it's fine to remove the legacy checks for `unstable_`.
  • Loading branch information
timneutkens authored Sep 22, 2023
1 parent 6177f9f commit dca5e22
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 133 deletions.
32 changes: 0 additions & 32 deletions packages/next/src/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1580,38 +1580,6 @@ export async function isPageStatic({
const hasStaticProps = !!componentsResult.getStaticProps
const hasStaticPaths = !!componentsResult.getStaticPaths
const hasServerProps = !!componentsResult.getServerSideProps
const hasLegacyServerProps = !!(await componentsResult.ComponentMod
.unstable_getServerProps)
const hasLegacyStaticProps = !!(await componentsResult.ComponentMod
.unstable_getStaticProps)
const hasLegacyStaticPaths = !!(await componentsResult.ComponentMod
.unstable_getStaticPaths)
const hasLegacyStaticParams = !!(await componentsResult.ComponentMod
.unstable_getStaticParams)

if (hasLegacyStaticParams) {
throw new Error(
`unstable_getStaticParams was replaced with getStaticPaths. Please update your code.`
)
}

if (hasLegacyStaticPaths) {
throw new Error(
`unstable_getStaticPaths was replaced with getStaticPaths. Please update your code.`
)
}

if (hasLegacyStaticProps) {
throw new Error(
`unstable_getStaticProps was replaced with getStaticProps. Please update your code.`
)
}

if (hasLegacyServerProps) {
throw new Error(
`unstable_getServerProps was replaced with getServerSideProps. Please update your code.`
)
}

// A page cannot be prerendered _and_ define a data requirement. That's
// contradictory!
Expand Down
7 changes: 0 additions & 7 deletions test/integration/legacy-ssg-methods-error/pages/index.js

This file was deleted.

58 changes: 0 additions & 58 deletions test/integration/legacy-ssg-methods-error/test/index.test.js

This file was deleted.

18 changes: 0 additions & 18 deletions test/integration/prerender-legacy/pages/blog/[post].js

This file was deleted.

18 changes: 0 additions & 18 deletions test/integration/prerender-legacy/test/index.test.js

This file was deleted.

0 comments on commit dca5e22

Please sign in to comment.