-
Notifications
You must be signed in to change notification settings - Fork 335
turbopack support #1639
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
Open
RJWadley
wants to merge
70
commits into
vanilla-extract-css:master
Choose a base branch
from
RJWadley:turbo-loader
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,901
−681
Open
turbopack support #1639
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
2123535
turbopack support
RJWadley 11de4e6
add changeset
RJWadley 2cb684b
support multiple turbopack globs
RJWadley ef28103
properly encode input CSS
RJWadley f5035e8
fix: correctly emit global styles
RJWadley abf86a5
stub "next/font" module so that it can be accessed in css contexts
RJWadley 499388e
use data URI css imports instead of fake virtual files
RJWadley 4d4246a
update tests for next
RJWadley 1ecc4df
package version fixes
RJWadley 17197d7
format, lint
RJWadley 99a6087
resolve all modules via turbopack
RJWadley 64ef34b
HMR fixes
RJWadley 8a519a3
font improvments, experimental next stubbing
RJWadley 31a01ce
fix: correctly detect production for identifiers default
RJWadley b492ce0
fix: errors during HMR are unrecoverable
RJWadley ca539f2
log cleanup
RJWadley 568bd26
enforcement strategy test
RJWadley 129f1e5
Revert "enforcement strategy test"
RJWadley c1146fe
cleanup, several misc fixes, drop support for next 15.x
RJWadley fef865f
Merge branch 'master' into turbo-loader
RJWadley 40b4342
cleanup
RJWadley 37559ad
auto configure cleanup
RJWadley 4096a6d
cleanup
RJWadley 097e438
update docs
RJWadley ebbde85
cleanup
RJWadley 86c0a18
next font cleanup, webpack cleanup
RJWadley c5123b8
re-add next font injection
RJWadley f5163f1
version cleanup
RJWadley 65b2416
fix missed font files
RJWadley 338c4b2
create stress test
RJWadley 2f40ad9
improve turbopack performance
RJWadley cc5e81f
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley c075bf3
add changesets for `compiler`
RJWadley fb4368a
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley bfbe735
set node version
RJWadley a8978e7
create duplication test
RJWadley 733d396
gitignore next-env
RJWadley f1f2859
test both webpack & turbo
RJWadley 94b1337
turbopack: improve deduplication
RJWadley 5a3b02b
test fixes
RJWadley 8774a31
snapshot test cleanup
RJWadley e12a93c
Merge branch 'turbo-loader' into deduplication
RJWadley 517eb40
format
RJWadley 77ad23f
rerequire
RJWadley e7e3be6
update fixture names
RJWadley 19aa0bf
revert
RJWadley 7c0975c
unify next tests
RJWadley 7b9313c
split next clean and next build
RJWadley 5513572
restrict push workflows to master branch
RJWadley 521171f
parallelize next tests, annotate failures
RJWadley dce5049
format
RJWadley d63cafb
Merge pull request #1 from RJWadley/deduplication
RJWadley 4d17853
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley 824a20b
support image imports
RJWadley f796980
typecast
RJWadley 6069616
revert devEngines
RJWadley 885c8af
update lockfile
RJWadley 501a69d
type mismatch
RJWadley eb2a5f9
Merge pull request #2 from RJWadley/next-image
RJWadley def2d7f
Merge remote-tracking branch 'upstream/master' into turbo-loader
RJWadley 3c52ba4
add experimental warning
RJWadley 4912dac
simplify regex
RJWadley d7fe730
add warning when configuring turbopack on next < 16
RJWadley b533945
revert workflows
RJWadley 6d3de32
simplify font transform
RJWadley 610ebcd
Update .changeset/fresh-wombats-stick.md
RJWadley b2555ee
move functions, cleanup parameter assignment
RJWadley 2f72b36
move turbopack options to unstable_turbopack
RJWadley 7fd502b
tighten next/font typing
RJWadley 4ff3498
rename experimental compiler APIs
RJWadley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 @@ | ||
| --- | ||
| '@vanilla-extract/turbopack-plugin': minor | ||
| '@vanilla-extract/next-plugin': minor | ||
| --- | ||
|
|
||
| Add turbopack support for next.js >= 16.0.0 |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| '@vanilla-extract/compiler': minor | ||
| --- | ||
|
|
||
| add `unstable_splitCssPerRule` option, generate one CSS import per rule instead of one per file. used by turbopack. |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| '@vanilla-extract/compiler': minor | ||
| --- | ||
|
|
||
| add `unstable_invalidateAllModules` to manually clear module cache |
This file contains hidden or 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,8 @@ | ||
| --- | ||
| '@vanilla-extract/compiler': patch | ||
| '@vanilla-extract/css': patch | ||
| '@vanilla-extract/turbopack-plugin': patch | ||
| '@vanilla-extract/next-plugin': patch | ||
| --- | ||
|
|
||
| turbopack: improve CSS deduplication |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| '@vanilla-extract/compiler': minor | ||
| --- | ||
|
|
||
| the `cssImportSpecifier` option receives the css content in addition to the module id |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ test-results | |
| .next | ||
| .DS_Store | ||
| .idea | ||
| next-env.d.ts | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ pnpm-lock.yaml | |
| *-snapshots | ||
| test-results | ||
| examples/remix/build | ||
| .pnpm-store | ||
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions
4
fixtures/next-pages-router/package.json → fixtures/next-12-pages-router/package.json
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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,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); | ||
This file contains hidden or 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,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:*" | ||
| } | ||
| } |
This file contains hidden or 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,9 @@ | ||
| import { creepsterText } from '../../styles/creepster.css'; | ||
|
|
||
| export default function CreepsterPage() { | ||
| return ( | ||
| <div className={creepsterText}> | ||
| This text should look scary (Creepster Font) | ||
| </div> | ||
| ); | ||
| } |
5 changes: 5 additions & 0 deletions
5
fixtures/next-16-app-pages-router/src/app/duplication-test/a-plain.css.ts
This file contains hidden or 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,5 @@ | ||
| import { globalStyle } from '@vanilla-extract/css'; | ||
|
|
||
| globalStyle('body', { | ||
| backgroundColor: '#0cdbcd', | ||
| }); |
9 changes: 9 additions & 0 deletions
9
fixtures/next-16-app-pages-router/src/app/duplication-test/a.css.ts
This file contains hidden or 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,9 @@ | ||
| import { globalStyle, style } from '@vanilla-extract/css'; | ||
|
|
||
| globalStyle('body', { | ||
| backgroundColor: '#0cdbcd', | ||
| }); | ||
|
|
||
| export const a = style({ | ||
| border: '1px solid black', | ||
| }); |
5 changes: 5 additions & 0 deletions
5
fixtures/next-16-app-pages-router/src/app/duplication-test/b-plain.css.ts
This file contains hidden or 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,5 @@ | ||
| import { globalStyle } from '@vanilla-extract/css'; | ||
|
|
||
| globalStyle('body', { | ||
| backgroundColor: '#0cdbcd', | ||
| }); |
9 changes: 9 additions & 0 deletions
9
fixtures/next-16-app-pages-router/src/app/duplication-test/b.css.ts
This file contains hidden or 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,9 @@ | ||
| import { globalStyle, style } from '@vanilla-extract/css'; | ||
|
|
||
| globalStyle('body', { | ||
| backgroundColor: '#0cdbcd', | ||
| }); | ||
|
|
||
| export const b = style({ | ||
| border: '1px solid red', | ||
| }); |
5 changes: 5 additions & 0 deletions
5
fixtures/next-16-app-pages-router/src/app/duplication-test/extra/c-plain.css.ts
This file contains hidden or 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,5 @@ | ||
| import { globalStyle } from '@vanilla-extract/css'; | ||
|
|
||
| globalStyle('body', { | ||
| backgroundColor: '#0cdbcd', | ||
| }); |
9 changes: 9 additions & 0 deletions
9
fixtures/next-16-app-pages-router/src/app/duplication-test/extra/c.css.ts
This file contains hidden or 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,9 @@ | ||
| import { globalStyle, style } from '@vanilla-extract/css'; | ||
|
|
||
| globalStyle('body', { | ||
| backgroundColor: '#0cdbcd', | ||
| }); | ||
|
|
||
| export const c = style({ | ||
| border: '1px solid black', | ||
| }); |
18 changes: 18 additions & 0 deletions
18
fixtures/next-16-app-pages-router/src/app/duplication-test/page.tsx
This file contains hidden or 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,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
10
fixtures/next-16-app-pages-router/src/app/features/page.tsx
This file contains hidden or 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 @@ | ||
| import html from '@fixtures/features/src/html'; | ||
|
|
||
| export default function Features() { | ||
| return ( | ||
| <> | ||
| <span id="features" /> | ||
| <div dangerouslySetInnerHTML={{ __html: html }} /> | ||
| </> | ||
| ); | ||
| } |
12 changes: 12 additions & 0 deletions
12
fixtures/next-16-app-pages-router/src/app/function-serializer/page.tsx
This file contains hidden or 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,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> | ||
| ); | ||
| } |
14 changes: 14 additions & 0 deletions
14
fixtures/next-16-app-pages-router/src/app/function-serializer/runtime.tsx
This file contains hidden or 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,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(' ')} | ||
| /> | ||
| ); | ||
| }; | ||
| } |
12 changes: 12 additions & 0 deletions
12
fixtures/next-16-app-pages-router/src/app/function-serializer/source.css.ts
This file contains hidden or 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,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', | ||
| }); |
28 changes: 28 additions & 0 deletions
28
fixtures/next-16-app-pages-router/src/app/function-serializer/styled.ts
This file contains hidden or 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,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; | ||
| } |
This file contains hidden or 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,11 @@ | ||
| export default function RootLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <html lang="en"> | ||
| <body>{children}</body> | ||
| </html> | ||
| ); | ||
| } |
41 changes: 41 additions & 0 deletions
41
fixtures/next-16-app-pages-router/src/app/next-font/page.tsx
This file contains hidden or 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,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> | ||
| ); | ||
| } |
13 changes: 13 additions & 0 deletions
13
fixtures/next-16-app-pages-router/src/app/next-image/image.css.ts
This file contains hidden or 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,13 @@ | ||
| import logo from './logo.png'; | ||
| import { style } from '@vanilla-extract/css'; | ||
| import type { StaticImageData } from 'next/image'; | ||
|
|
||
| // types are funky because of our monorepo setup | ||
| const withCast = logo as unknown as StaticImageData; | ||
|
|
||
| export const imageStyle = style({ | ||
| backgroundImage: `url(${withCast.src})`, | ||
| width: `${withCast.width}px`, | ||
| height: `${withCast.height}px`, | ||
| border: '1px solid red', | ||
| }); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
fixtures/next-16-app-pages-router/src/app/next-image/page.tsx
This file contains hidden or 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,5 @@ | ||
| import { imageStyle } from './image.css'; | ||
|
|
||
| export default function NextImagePage() { | ||
| return <div className={imageStyle}>Next Image Page</div>; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this import be using the package specifier rather than relative path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would be better IMO, but neither of the existing next fixtures do, and we'll experience type errors if we try. see
scripts/copy-next-plugin.tsfor a bit more context.this is another thing I'd like to clean up soon, but opted to just match the status quo for the first revision. happy to take another look if you want it in this PR.