forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Client request BUILD_ID from the Server (vercel#6891)
* Generate two versions of pages * Add code VSCode deleted * Add dynamicBuildId option to __NEXT_DATA__ * Reduce amount of diff * Make getPageFile code easier to read * Minimize diff * minimize diff * Fix default value for dynamicBuildId * Fix weird bug * Fetch the head build id on client * Move __selectivePageBuilding * Add tests * Remove _this * Add console warning
- Loading branch information
Showing
22 changed files
with
294 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Failed to load `BUILD_ID` from Server | ||
|
||
#### Why This Error Occurred | ||
|
||
The deployment was generated incorrectly or the server was overloaded at the time of the request. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Please make sure you are using the latest version of the `@now/next` builder in your `now.json`. | ||
If this error persists, please file a bug report. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import fs from 'fs' | ||
import {promisify} from 'util' | ||
import {join} from 'path' | ||
import {BUILD_ID_FILE} from 'next-server/constants' | ||
import {BUILD_ID_FILE, HEAD_BUILD_ID_FILE} from 'next-server/constants' | ||
|
||
const writeFile = promisify(fs.writeFile) | ||
|
||
export async function writeBuildId (distDir: string, buildId: string): Promise<void> { | ||
export async function writeBuildId (distDir: string, buildId: string, headBuildId: boolean): Promise<void> { | ||
const buildIdPath = join(distDir, BUILD_ID_FILE) | ||
await writeFile(buildIdPath, buildId, 'utf8') | ||
|
||
if (headBuildId) { | ||
const headBuildIdPath = join(distDir, HEAD_BUILD_ID_FILE) | ||
await writeFile(headBuildIdPath, buildId, 'utf8') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.