Unverified Commit 5a8398e3 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Remove unstable_ prefix from unstable_blocking (#18276)

This removes the `unstable_` prefix to prepare for stabilizing the feature
parent 31a011d6
...@@ -594,7 +594,7 @@ export default async function build( ...@@ -594,7 +594,7 @@ export default async function build(
ssgPageRoutes = workerResult.prerenderRoutes ssgPageRoutes = workerResult.prerenderRoutes
} }
if (workerResult.prerenderFallback === 'unstable_blocking') { if (workerResult.prerenderFallback === 'blocking') {
ssgBlockingFallbackPages.add(page) ssgBlockingFallbackPages.add(page)
} else if (workerResult.prerenderFallback === true) { } else if (workerResult.prerenderFallback === true) {
ssgStaticFallbackPages.add(page) ssgStaticFallbackPages.add(page)
......
...@@ -575,7 +575,7 @@ export async function buildStaticPaths( ...@@ -575,7 +575,7 @@ export async function buildStaticPaths(
if ( if (
!( !(
typeof staticPathsResult.fallback === 'boolean' || typeof staticPathsResult.fallback === 'boolean' ||
staticPathsResult.fallback === 'unstable_blocking' staticPathsResult.fallback === 'blocking'
) )
) { ) {
throw new Error( throw new Error(
...@@ -700,7 +700,7 @@ export async function isPageStatic( ...@@ -700,7 +700,7 @@ export async function isPageStatic(
hasServerProps?: boolean hasServerProps?: boolean
hasStaticProps?: boolean hasStaticProps?: boolean
prerenderRoutes?: string[] | undefined prerenderRoutes?: string[] | undefined
prerenderFallback?: boolean | 'unstable_blocking' | undefined prerenderFallback?: boolean | 'blocking' | undefined
}> { }> {
try { try {
require('../next-server/lib/runtime-config').setConfig(runtimeEnvConfig) require('../next-server/lib/runtime-config').setConfig(runtimeEnvConfig)
...@@ -775,7 +775,7 @@ export async function isPageStatic( ...@@ -775,7 +775,7 @@ export async function isPageStatic(
} }
let prerenderRoutes: Array<string> | undefined let prerenderRoutes: Array<string> | undefined
let prerenderFallback: boolean | 'unstable_blocking' | undefined let prerenderFallback: boolean | 'blocking' | undefined
if (hasStaticProps && hasStaticPaths) { if (hasStaticProps && hasStaticPaths) {
;({ ;({
paths: prerenderRoutes, paths: prerenderRoutes,
......
...@@ -556,7 +556,7 @@ export default class DevServer extends Server { ...@@ -556,7 +556,7 @@ export default class DevServer extends Server {
return { return {
staticPaths, staticPaths,
fallbackMode: fallbackMode:
fallback === 'unstable_blocking' fallback === 'blocking'
? 'blocking' ? 'blocking'
: fallback === true : fallback === true
? 'static' ? 'static'
......
...@@ -111,7 +111,7 @@ export type GetStaticPathsContext = { ...@@ -111,7 +111,7 @@ export type GetStaticPathsContext = {
export type GetStaticPathsResult<P extends ParsedUrlQuery = ParsedUrlQuery> = { export type GetStaticPathsResult<P extends ParsedUrlQuery = ParsedUrlQuery> = {
paths: Array<string | { params: P; locale?: string }> paths: Array<string | { params: P; locale?: string }>
fallback: boolean | 'unstable_blocking' fallback: boolean | 'blocking'
} }
export type GetStaticPaths<P extends ParsedUrlQuery = ParsedUrlQuery> = ( export type GetStaticPaths<P extends ParsedUrlQuery = ParsedUrlQuery> = (
......
...@@ -5,7 +5,7 @@ import { useRouter } from 'next/router' ...@@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
export async function getStaticPaths() { export async function getStaticPaths() {
return { return {
paths: [], paths: [],
fallback: 'unstable_blocking', fallback: 'blocking',
} }
} }
......
...@@ -5,7 +5,7 @@ import { useRouter } from 'next/router' ...@@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
export async function getStaticPaths() { export async function getStaticPaths() {
return { return {
paths: [{ params: { slug: 'a' } }, { params: { slug: 'b' } }], paths: [{ params: { slug: 'a' } }, { params: { slug: 'b' } }],
fallback: 'unstable_blocking', fallback: 'blocking',
} }
} }
......
...@@ -5,7 +5,7 @@ import { useRouter } from 'next/router' ...@@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
export async function getStaticPaths() { export async function getStaticPaths() {
return { return {
paths: [], paths: [],
fallback: 'unstable_blocking', fallback: 'blocking',
} }
} }
......
...@@ -7,7 +7,7 @@ export async function getStaticProps() { ...@@ -7,7 +7,7 @@ export async function getStaticProps() {
} }
export async function getStaticPaths() { export async function getStaticPaths() {
return { paths: [], fallback: 'unstable_blocking' } return { paths: [], fallback: 'blocking' }
} }
const Page = ({ time }) => { const Page = ({ time }) => {
......
...@@ -2101,7 +2101,7 @@ describe('SSG Prerender', () => { ...@@ -2101,7 +2101,7 @@ describe('SSG Prerender', () => {
await fs.writeFile( await fs.writeFile(
pagePath, pagePath,
fallbackBlockingPageContents[page].replace( fallbackBlockingPageContents[page].replace(
"fallback: 'unstable_blocking'", "fallback: 'blocking'",
'fallback: false' 'fallback: false'
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment