first commit
Some checks failed
Test examples / Test Examples (20) (push) Has been cancelled
Test examples / Test Examples (22) (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Trigger Release / start (push) Has been cancelled
Stale issue handler / stale (push) Has been cancelled
Update Font Data / create-pull-request (push) Has been cancelled
build-and-deploy / deploy-target (push) Has been cancelled
build-and-deploy / build (push) Has been cancelled
build-and-deploy / stable - aarch64-unknown-linux-musl - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-unknown-linux-musl - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-unknown-linux-gnu - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-unknown-linux-gnu - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-pc-windows-msvc - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-pc-windows-msvc - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-apple-darwin - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-apple-darwin - node@16 (push) Has been cancelled
build-and-deploy / build-wasm (nodejs) (push) Has been cancelled
build-and-deploy / build-wasm (web) (push) Has been cancelled
build-and-deploy / Deploy preview tarball (push) Has been cancelled
build-and-deploy / Potentially publish release (push) Has been cancelled
build-and-deploy / publish-turbopack-npm-packages (push) Has been cancelled
build-and-deploy / Deploy examples (push) Has been cancelled
build-and-deploy / thank you, build (push) Has been cancelled
build-and-deploy / Upload Turbopack Bytesize metrics to Datadog (push) Has been cancelled
Rspack Next.js development integration tests / Rspack integration tests (push) Has been cancelled
Rspack Next.js production integration tests / Rspack integration tests (push) Has been cancelled
Turbopack Next.js development integration tests / Next.js integration tests (push) Has been cancelled
Turbopack Next.js production integration tests / Next.js integration tests (push) Has been cancelled
Update Rspack test manifest / Update and upload Rspack development test manifest (push) Has been cancelled
Update Rspack test manifest / Update and upload Rspack production test manifest (push) Has been cancelled
Upload bundler test manifests to areweturboyet.com / Upload test results (push) Has been cancelled
Update React / create-pull-request (push) Has been cancelled
test-e2e-project-reset-cron / reset-test-project (push) Has been cancelled
Notify about the top 15 issues/PRs/feature requests (most reacted) in the last 90 days / run (push) Has been cancelled

This commit is contained in:
Arian Tron
2026-03-10 19:37:31 +03:30
commit 61f56f997c
27684 changed files with 2784175 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
export async function getStaticProps() {
return {
props: {
world: 'world',
time: new Date().getTime(),
other: Math.random(),
},
revalidate: 1,
}
}
const Page = ({ world, time, other }) => {
return (
<div>
<p>hello {world}</p>
<span>time: {time}</span>
<span>other: {other}</span>
</div>
)
}
export default Page

View File

@@ -0,0 +1,22 @@
export async function getStaticProps() {
return {
props: {
world: 'world',
time: new Date().getTime(),
other: Math.random(),
},
revalidate: 1,
}
}
const Page = ({ world, time, other }) => {
return (
<div>
<p>hello {world}</p>
<span>time: {time}</span>
<span>other: {other}</span>
</div>
)
}
export default Page

View File

@@ -0,0 +1,22 @@
export async function getStaticProps() {
return {
props: {
world: 'world',
time: new Date().getTime(),
other: Math.random(),
},
revalidate: 1,
}
}
const Page = ({ world, time, other }) => {
return (
<div>
<p>hello {world}</p>
<span>time: {time}</span>
<span>other: {other}</span>
</div>
)
}
export default Page

View File

@@ -0,0 +1,22 @@
export async function getStaticProps() {
return {
props: {
world: 'world',
time: new Date().getTime(),
other: Math.random(),
},
revalidate: 1,
}
}
const Page = ({ world, time, other }) => {
return (
<div>
<p>hello {world}</p>
<span>time: {time}</span>
<span>other: {other}</span>
</div>
)
}
export default Page

View File

@@ -0,0 +1,18 @@
export async function getStaticProps() {
return {
props: {
world: 'world',
},
revalidate: 10,
}
}
const Page = ({ world }) => {
return (
<div>
<p>hello {world}</p>
</div>
)
}
export default Page

View File

@@ -0,0 +1,125 @@
/* eslint-env jest */
import fs from 'fs-extra'
import {
findPort,
killApp,
nextBuild,
nextStart,
renderViaHTTP,
waitFor,
getPageFileFromPagesManifest,
fetchViaHTTP,
} from 'next-test-utils'
import { join } from 'path'
const appDir = join(__dirname, '..')
let app
let appPort
let buildId
function runTests(route, routePath) {
it(`[${route}] should regenerate page when revalidate time exceeded`, async () => {
const fileName = join(
appDir,
'.next',
'server',
getPageFileFromPagesManifest(appDir, routePath).replace('.js', '.html')
)
const initialHtmlFile = await fs.readFile(fileName, 'utf8')
await waitFor(1000) // Wait revalidate duration
expect(await renderViaHTTP(appPort, route)).toBe(initialHtmlFile)
await waitFor(500) // Wait for regeneration to occur
const regeneratedFileHtml = await fs.readFile(fileName, 'utf8')
expect(regeneratedFileHtml).not.toBe(initialHtmlFile)
expect(await renderViaHTTP(appPort, route)).toBe(regeneratedFileHtml)
})
it(`[${route}] should regenerate /_next/data when revalidate time exceeded`, async () => {
const fileName = join(
appDir,
'.next',
'server',
getPageFileFromPagesManifest(appDir, routePath).replace('.js', '.json')
)
const route = join(`/_next/data/${buildId}`, `${routePath}.json`)
const initialFileJson = await fs.readFile(fileName, 'utf8')
await waitFor(1000) // Wait revalidate duration
expect(JSON.parse(await renderViaHTTP(appPort, route))).toEqual(
JSON.parse(initialFileJson)
)
await waitFor(500) // Wait for regeneration to occur
const regeneratedFileJson = await fs.readFile(fileName, 'utf8')
expect(regeneratedFileJson).not.toBe(initialFileJson)
expect(JSON.parse(await renderViaHTTP(appPort, route))).toEqual(
JSON.parse(regeneratedFileJson)
)
})
}
describe('SSG Prerender Revalidate', () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, [])
appPort = await findPort()
app = await nextStart(appDir, appPort, {})
buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
})
afterAll(() => killApp(app))
runTests('/', '/')
runTests('/named', '/named')
runTests('/nested', '/nested')
runTests('/nested/named', '/nested/named')
it('should return cache-control header on 304 status', async () => {
const url = `http://localhost:${appPort}`
const res1 = await fetchViaHTTP(url, '/static')
const cacheControl200 = res1.headers.get('Cache-Control')
const etag = res1.headers.get('ETag')
const headers = { 'If-None-Match': etag }
const res2 = await fetchViaHTTP(url, '/static', undefined, { headers })
const cacheControl304 = res2.headers.get('Cache-Control')
expect(cacheControl304).toEqual(cacheControl200)
})
}
)
// Regression test for https://github.com/vercel/next.js/issues/24806
describe('[regression] production mode and incremental cache size exceeded', () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, [])
appPort = await findPort()
app = await nextStart(appDir, appPort, {
// The lowest size of the LRU cache that can be set is "1"
// this will cause the cache size to always be exceeded
env: { __NEXT_TEST_MAX_ISR_CACHE: '1' },
})
buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
})
afterAll(() => killApp(app))
runTests('/', '/')
runTests('/named', '/named')
runTests('/nested', '/nested')
runTests('/nested/named', '/nested/named')
}
)
})
})