Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unstable_ prefix from unstable_blocking #18276

Merged
merged 2 commits into from Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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