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,5 @@
import styles from './hello.module.css'
export default function Hello() {
return <p className={styles.hello}>hello world</p>
}

View File

@@ -0,0 +1,3 @@
.hello {
color: orange;
}

View File

@@ -0,0 +1,6 @@
import '../styles/styles.css'
// This default export is required in a new `pages/_app.js` file.
export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}

View File

@@ -0,0 +1,21 @@
import styles from '../styles/index.module.css'
import dynamic from 'next/dynamic'
const Hello = dynamic(() => import('../components/hello'))
export default function Home() {
return (
<div className={styles.hello}>
<p>Hello World</p>
<Hello />
</div>
)
}
export const getServerSideProps = () => {
return {
props: {
hello: 'world',
},
}
}

View File

@@ -0,0 +1,19 @@
import styles from '../styles/index.module.css'
import Hello from '../components/hello'
export default function Home() {
return (
<div className={styles.hello}>
<p>Hello World</p>
<Hello />
</div>
)
}
export const getServerSideProps = () => {
return {
props: {
hello: 'world',
},
}
}

View File

@@ -0,0 +1,18 @@
.hello {
font:
15px Helvetica,
Arial,
sans-serif;
background: #eee;
padding: 100px;
text-align: center;
transition: 100ms ease-in background;
}
.hello:hover {
background: #ccc;
}
.extra-style1 {
background: #000;
}

View File

@@ -0,0 +1,12 @@
body {
font-family:
'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica', 'Arial',
sans-serif;
padding: 20px 20px 60px;
max-width: 680px;
margin: 0 auto;
}
.extra-style {
font-size: 200%;
}

View File

@@ -0,0 +1,87 @@
/* eslint-env jest */
import globOrigig from 'glob'
import { promisify } from 'util'
import { join } from 'path'
import {
killApp,
findPort,
nextStart,
nextBuild,
renderViaHTTP,
} from 'next-test-utils'
import fs from 'fs-extra'
const glob = promisify(globOrigig)
const appDir = join(__dirname, '../')
const nextConfig = join(appDir, 'next.config.js')
let appPort
let app
function runTests() {
it('should have all CSS files in manifest', async () => {
const cssFiles = (
await glob('**/*.css', {
cwd: join(appDir, '.next/static'),
})
).map((file) => join('.next/static', file))
const requiredServerFiles = await fs.readJSON(
join(appDir, '.next/required-server-files.json')
)
expect(
requiredServerFiles.files.filter((file) => file.endsWith('.css'))
).toEqual(cssFiles)
})
it('should inline critical CSS', async () => {
const html = await renderViaHTTP(appPort, '/')
expect(html).toMatch(
/<link rel="stylesheet" href="\/_next\/static\/.*\.css(\?dpl=.*)?" .*>/
)
expect(html).toMatch(/body{/)
})
it('should inline critical CSS (dynamic)', async () => {
const html = await renderViaHTTP(appPort, '/another')
expect(html).toMatch(
/<link rel="stylesheet" href="\/_next\/static\/.*\.css(\?dpl=.*)?" .*>/
)
expect(html).toMatch(/body{/)
})
it('should not inline non-critical css', async () => {
const html = await renderViaHTTP(appPort, '/')
expect(html).not.toMatch(/.extra-style/)
})
}
describe('CSS optimization for SSR apps', () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await fs.writeFile(
nextConfig,
`module.exports = { experimental: {optimizeCss: true} }`,
'utf8'
)
if (fs.pathExistsSync(join(appDir, '.next'))) {
await fs.remove(join(appDir, '.next'))
}
// TODO optimizeCss is broken when ?dpl is added to CSS URLs
await nextBuild(appDir, undefined, { disableAutoSkewProtection: true })
appPort = await findPort()
app = await nextStart(appDir, appPort, {
disableAutoSkewProtection: true,
})
})
afterAll(async () => {
await killApp(app)
await fs.remove(nextConfig)
})
runTests()
}
)
})