Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2123535
turbopack support
RJWadley Oct 8, 2025
11de4e6
add changeset
RJWadley Oct 8, 2025
2cb684b
support multiple turbopack globs
RJWadley Oct 9, 2025
ef28103
properly encode input CSS
RJWadley Oct 11, 2025
f5035e8
fix: correctly emit global styles
RJWadley Oct 13, 2025
abf86a5
stub "next/font" module so that it can be accessed in css contexts
RJWadley Oct 22, 2025
499388e
use data URI css imports instead of fake virtual files
RJWadley Oct 23, 2025
4d4246a
update tests for next
RJWadley Oct 23, 2025
1ecc4df
package version fixes
RJWadley Oct 23, 2025
17197d7
format, lint
RJWadley Oct 23, 2025
99a6087
resolve all modules via turbopack
RJWadley Oct 30, 2025
64ef34b
HMR fixes
RJWadley Nov 3, 2025
8a519a3
font improvments, experimental next stubbing
RJWadley Nov 4, 2025
31a01ce
fix: correctly detect production for identifiers default
RJWadley Nov 4, 2025
b492ce0
fix: errors during HMR are unrecoverable
RJWadley Nov 10, 2025
ca539f2
log cleanup
RJWadley Nov 13, 2025
568bd26
enforcement strategy test
RJWadley Nov 17, 2025
129f1e5
Revert "enforcement strategy test"
RJWadley Nov 17, 2025
c1146fe
cleanup, several misc fixes, drop support for next 15.x
RJWadley Nov 21, 2025
fef865f
Merge branch 'master' into turbo-loader
RJWadley Nov 21, 2025
40b4342
cleanup
RJWadley Nov 21, 2025
37559ad
auto configure cleanup
RJWadley Nov 21, 2025
4096a6d
cleanup
RJWadley Nov 21, 2025
097e438
update docs
RJWadley Nov 21, 2025
ebbde85
cleanup
RJWadley Nov 21, 2025
86c0a18
next font cleanup, webpack cleanup
RJWadley Nov 21, 2025
c5123b8
re-add next font injection
RJWadley Nov 21, 2025
f5163f1
version cleanup
RJWadley Nov 21, 2025
65b2416
fix missed font files
RJWadley Nov 21, 2025
338c4b2
create stress test
RJWadley Nov 22, 2025
2f40ad9
improve turbopack performance
RJWadley Nov 23, 2025
cc5e81f
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley Nov 24, 2025
c075bf3
add changesets for `compiler`
RJWadley Nov 24, 2025
fb4368a
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley Nov 26, 2025
bfbe735
set node version
RJWadley Nov 28, 2025
a8978e7
create duplication test
RJWadley Nov 28, 2025
733d396
gitignore next-env
RJWadley Nov 28, 2025
f1f2859
test both webpack & turbo
RJWadley Nov 28, 2025
94b1337
turbopack: improve deduplication
RJWadley Nov 29, 2025
5a3b02b
test fixes
RJWadley Nov 29, 2025
8774a31
snapshot test cleanup
RJWadley Nov 29, 2025
e12a93c
Merge branch 'turbo-loader' into deduplication
RJWadley Nov 29, 2025
517eb40
format
RJWadley Nov 29, 2025
77ad23f
rerequire
RJWadley Nov 29, 2025
e7e3be6
update fixture names
RJWadley Nov 29, 2025
19aa0bf
revert
RJWadley Nov 29, 2025
7c0975c
unify next tests
RJWadley Nov 30, 2025
7b9313c
split next clean and next build
RJWadley Nov 30, 2025
5513572
restrict push workflows to master branch
RJWadley Nov 30, 2025
521171f
parallelize next tests, annotate failures
RJWadley Nov 30, 2025
dce5049
format
RJWadley Nov 30, 2025
d63cafb
Merge pull request #1 from RJWadley/deduplication
RJWadley Dec 1, 2025
4d17853
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley Dec 8, 2025
824a20b
support image imports
RJWadley Dec 10, 2025
f796980
typecast
RJWadley Dec 10, 2025
6069616
revert devEngines
RJWadley Dec 10, 2025
885c8af
update lockfile
RJWadley Dec 10, 2025
501a69d
type mismatch
RJWadley Dec 10, 2025
eb2a5f9
Merge pull request #2 from RJWadley/next-image
RJWadley Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/fresh-wombats-stick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@vanilla-extract/turbopack-plugin': minor
'@vanilla-extract/next-plugin': minor
---

turbopack support for next.js >= 16.0.0
5 changes: 5 additions & 0 deletions .changeset/green-years-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/compiler': minor
---

add `splitCssPerRule` option, generate one CSS import per rule instead of one per file. used by turbopack.
5 changes: 5 additions & 0 deletions .changeset/heavy-boxes-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/compiler': minor
---

add `invalidateAllModules` to manually clear module cache
8 changes: 8 additions & 0 deletions .changeset/slimy-poems-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@vanilla-extract/compiler': patch
'@vanilla-extract/css': patch
'@vanilla-extract/turbopack-plugin': patch
'@vanilla-extract/next-plugin': patch
---

turbopack: improve CSS deduplication
5 changes: 5 additions & 0 deletions .changeset/tough-mails-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/compiler': minor
---

the `cssImportSpecifier` option receives the css content in addition to the module id
5 changes: 4 additions & 1 deletion .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Deploy site

on: push
on:
push:
branches:
- master

jobs:
deploy-site:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Validate

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ test-results
.next
.DS_Store
.idea
next-env.d.ts
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ pnpm-lock.yaml
*-snapshots
test-results
examples/remix/build
.pnpm-store
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@fixtures/next-pages-router",
"name": "@fixtures/next-12-pages-router",
"description": "Next pages router fixtures",
"version": "0.0.7",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"clean-build": "pnpm clean && next build",
"clean": "pnpm clean:dev && pnpm clean:prod",
"clean:dev": "rm -rf .next",
"clean:prod": "rm -rf dist"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"jsx": "preserve",
"strictNullChecks": true
"strictNullChecks": true,
"module": "esnext",
"moduleResolution": "node"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ const withVanillaExtract = createVanillaExtractPlugin();

/** @type {import('next').NextConfig} */
const config = withVanillaExtract({
// exporting a static build for next 13
// due to issues with distDir on next custom server
output: 'export',
// we need to differentiate build and dev folders
// so they don't overwrite eachother when running tests
distDir: process.env.NODE_ENV === 'production' ? 'dist' : '.next',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@fixtures/next-app-router",
"name": "@fixtures/next-13-app-router",
"description": "Next app router fixtures",
"version": "0.0.7",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"clean-build": "pnpm clean && pnpm build",
"clean": "pnpm clean:dev && pnpm clean:prod",
"clean:dev": "rm -rf .next",
"clean:prod": "rm -rf dist"
},
Expand All @@ -19,7 +17,7 @@
"@vanilla-extract/css": "workspace:*",
"@vanilla-extract/recipes": "workspace:*",
"@vanilla-extract/sprinkles": "workspace:*",
"next": "npm:[email protected].4",
"next": "npm:[email protected].11",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"name": "next"
}
],
"strictNullChecks": true
"strictNullChecks": true,
"module": "esnext"
},
"include": [
"next-env.d.ts",
Expand Down
13 changes: 13 additions & 0 deletions fixtures/next-16-app-pages-router/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NextConfig } from 'next';
import { createVanillaExtractPlugin } from './next-plugin/dist/vanilla-extract-next-plugin.cjs.js';
const withVanillaExtract = createVanillaExtractPlugin();

export const config: NextConfig = {
distDir: process.env.NEXT_DIST_DIR || '.next',
experimental: { externalDir: true },
onDemandEntries: { maxInactiveAge: 1000 * 60 * 60 },
transpilePackages: ['@fixtures/sprinkles/src/html'],
devIndicators: false,
};

export default withVanillaExtract(config);
32 changes: 32 additions & 0 deletions fixtures/next-16-app-pages-router/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@fixtures/next-16-app-pages-router",
"version": "0.0.1",
"private": true,
"description": "Next 16 fixture with app + pages routers; supports webpack and turbopack builds",
"scripts": {
"dev-webpack": "NEXT_DIST_DIR=.next/webpack next dev --webpack",
"dev-turbo": "NEXT_DIST_DIR=.next/turbo next dev --turbo",
"build-webpack": "NEXT_DIST_DIR=dist/webpack next build --webpack",
"start-webpack": "NEXT_DIST_DIR=dist/webpack next start",
"build-turbo": "NEXT_DIST_DIR=dist/turbo next build --turbo",
"start-turbo": "NEXT_DIST_DIR=dist/turbo next start",
"clean:dev": "rm -rf .next",
"clean:prod": "rm -rf dist"
},
"dependencies": {
"@fixtures/features": "workspace:*",
"@fixtures/recipes": "workspace:*",
"@fixtures/sprinkles": "workspace:*",
"@vanilla-extract/css": "workspace:*",
"@vanilla-extract/recipes": "workspace:*",
"@vanilla-extract/sprinkles": "workspace:*",
"next": "npm:next@^16.0.0",
"react": "npm:react@^19.2.0",
"react-dom": "npm:react-dom@^19.2.0"
},
"devDependencies": {
"@types/react": "^18.2.55",
"@vanilla-extract/next-plugin": "workspace:*",
"@vanilla-extract/webpack-plugin": "workspace:*"
}
}
9 changes: 9 additions & 0 deletions fixtures/next-16-app-pages-router/src/app/creepster/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { creepsterText } from '../../styles/creepster.css';

export default function CreepsterPage() {
return (
<div className={creepsterText}>
This text should look scary (Creepster Font)
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { globalStyle } from '@vanilla-extract/css';

globalStyle('body', {
backgroundColor: '#0cdbcd',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { globalStyle, style } from '@vanilla-extract/css';

globalStyle('body', {
backgroundColor: '#0cdbcd',
});

export const a = style({
border: '1px solid black',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { globalStyle } from '@vanilla-extract/css';

globalStyle('body', {
backgroundColor: '#0cdbcd',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { globalStyle, style } from '@vanilla-extract/css';

globalStyle('body', {
backgroundColor: '#0cdbcd',
});

export const b = style({
border: '1px solid red',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { globalStyle } from '@vanilla-extract/css';

globalStyle('body', {
backgroundColor: '#0cdbcd',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { globalStyle, style } from '@vanilla-extract/css';

globalStyle('body', {
backgroundColor: '#0cdbcd',
});

export const c = style({
border: '1px solid black',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import './a-plain.css';
import { a } from './a.css';
import './b-plain.css';
import { b } from './b.css';
import './extra/c-plain.css';
import { c } from './extra/c.css';

export default function DuplicationTestPage() {
return (
<div>
<div className={a}>
<div className={b}>
<div className={c}>duplication test</div>
</div>
</div>
</div>
);
}
10 changes: 10 additions & 0 deletions fixtures/next-16-app-pages-router/src/app/features/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import html from '@fixtures/features/src/html';

export default function Features() {
return (
<>
<span id="features" />
<div dangerouslySetInnerHTML={{ __html: html }} />
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { RedBox, BlueText } from './source.css';

export default function Page() {
return (
<div>
<h1>Function Serializer Test</h1>
<RedBox>
This should be a red box with <BlueText>blue text</BlueText> inside
</RedBox>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export function runtimeStyled<Tag extends keyof JSX.IntrinsicElements>(
tag: Tag,
className: string,
) {
return function Component(props: React.ComponentProps<Tag>) {
const Element = tag as any;
return (
<Element
{...props}
className={[props.className, className].filter(Boolean).join(' ')}
/>
);
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { styled } from './styled';

export const RedBox = styled('div', {
backgroundColor: 'red',
color: 'white',
padding: '20px',
});

export const BlueText = styled('span', {
color: 'blue',
fontWeight: 'bold',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { addFunctionSerializer } from '@vanilla-extract/css/functionSerializer';
import { style, type StyleRule } from '@vanilla-extract/css';
import { runtimeStyled } from './runtime';
import React from 'react';

if (React.version.includes('canary')) {
throw new Error(
'detected vendored React in styles, this will cause errors in some projects',
);
}

export function styled<Tag extends keyof JSX.IntrinsicElements>(
tag: Tag,
styles: StyleRule,
) {
const className = style(styles);
const args = [tag, className] as const;

const Component = runtimeStyled(...args);

addFunctionSerializer(Component, {
importPath: './runtime',
importName: 'runtimeStyled',
args,
});

return Component;
}
11 changes: 11 additions & 0 deletions fixtures/next-16-app-pages-router/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
41 changes: 41 additions & 0 deletions fixtures/next-16-app-pages-router/src/app/next-font/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import * as directFonts from '../../styles/fonts';
import { pickedValues } from '../../styles/nextFont.css';

export default function NextFontChecks() {
const pairs: Array<
[string, string | number | undefined, string | number | undefined]
> = [];

for (const [name, vePicked] of Object.entries(pickedValues)) {
const direct = directFonts[name as keyof typeof directFonts];
const style = direct?.style || {};
pairs.push([`${name} family`, vePicked.fontFamily, style.fontFamily]);
pairs.push([`${name} weight`, vePicked.fontWeight, style.fontWeight]);
pairs.push([`${name} style`, vePicked.fontStyle, style.fontStyle]);
}

pairs.sort((a, b) => a[0].localeCompare(b[0]));

for (const [name, fromVe, direct] of pairs) {
if (String(fromVe) !== String(direct)) {
throw new Error(
`[next-font] mismatch for ${name}:\n${String(fromVe)} !==\n${String(
direct,
)}`,
);
}
}

return (
<div id="next-font-checks-16">
<h2>next 16 next/font comparisons</h2>
<ul>
{pairs.map(([name, fromVe, direct]) => (
<li key={name} data-name={name} data-ve={fromVe} data-direct={direct}>
{name}: {fromVe}
</li>
))}
</ul>
</div>
);
}
Loading