Skip to content

Commit

Permalink
Remove unstable_ prefix from unstable_blocking (#18276)
Browse files Browse the repository at this point in the history
This removes the `unstable_` prefix to prepare for stabilizing the feature
  • Loading branch information
ijjk committed Oct 27, 2020
1 parent 31a011d commit 5a8398e
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Expand Up @@ -594,7 +594,7 @@ export default async function build(
ssgPageRoutes = workerResult.prerenderRoutes
}

if (workerResult.prerenderFallback === 'unstable_blocking') {
if (workerResult.prerenderFallback === 'blocking') {
ssgBlockingFallbackPages.add(page)
} else if (workerResult.prerenderFallback === true) {
ssgStaticFallbackPages.add(page)
Expand Down
6 changes: 3 additions & 3 deletions packages/next/build/utils.ts
Expand Up @@ -575,7 +575,7 @@ export async function buildStaticPaths(
if (
!(
typeof staticPathsResult.fallback === 'boolean' ||
staticPathsResult.fallback === 'unstable_blocking'
staticPathsResult.fallback === 'blocking'
)
) {
throw new Error(
Expand Down Expand Up @@ -700,7 +700,7 @@ export async function isPageStatic(
hasServerProps?: boolean
hasStaticProps?: boolean
prerenderRoutes?: string[] | undefined
prerenderFallback?: boolean | 'unstable_blocking' | undefined
prerenderFallback?: boolean | 'blocking' | undefined
}> {
try {
require('../next-server/lib/runtime-config').setConfig(runtimeEnvConfig)
Expand Down Expand Up @@ -775,7 +775,7 @@ export async function isPageStatic(
}

let prerenderRoutes: Array<string> | undefined
let prerenderFallback: boolean | 'unstable_blocking' | undefined
let prerenderFallback: boolean | 'blocking' | undefined
if (hasStaticProps && hasStaticPaths) {
;({
paths: prerenderRoutes,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/next-dev-server.ts
Expand Up @@ -556,7 +556,7 @@ export default class DevServer extends Server {
return {
staticPaths,
fallbackMode:
fallback === 'unstable_blocking'
fallback === 'blocking'
? 'blocking'
: fallback === true
? 'static'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/types/index.d.ts
Expand Up @@ -111,7 +111,7 @@ export type GetStaticPathsContext = {

export type GetStaticPathsResult<P extends ParsedUrlQuery = ParsedUrlQuery> = {
paths: Array<string | { params: P; locale?: string }>
fallback: boolean | 'unstable_blocking'
fallback: boolean | 'blocking'
}

export type GetStaticPaths<P extends ParsedUrlQuery = ParsedUrlQuery> = (
Expand Down
Expand Up @@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
export async function getStaticPaths() {
return {
paths: [],
fallback: 'unstable_blocking',
fallback: 'blocking',
}
}

Expand Down
Expand Up @@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
export async function getStaticPaths() {
return {
paths: [{ params: { slug: 'a' } }, { params: { slug: 'b' } }],
fallback: 'unstable_blocking',
fallback: 'blocking',
}
}

Expand Down
Expand Up @@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
export async function getStaticPaths() {
return {
paths: [],
fallback: 'unstable_blocking',
fallback: 'blocking',
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/prerender/pages/non-json-blocking/[p].js
Expand Up @@ -7,7 +7,7 @@ export async function getStaticProps() {
}

export async function getStaticPaths() {
return { paths: [], fallback: 'unstable_blocking' }
return { paths: [], fallback: 'blocking' }
}

const Page = ({ time }) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/prerender/test/index.test.js
Expand Up @@ -2101,7 +2101,7 @@ describe('SSG Prerender', () => {
await fs.writeFile(
pagePath,
fallbackBlockingPageContents[page].replace(
"fallback: 'unstable_blocking'",
"fallback: 'blocking'",
'fallback: false'
)
)
Expand Down

0 comments on commit 5a8398e

Please sign in to comment.