Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ let result = []

result.push(benchmark('tailwind'))
result.push(benchmark('stylex'))
result.push(benchmark('stylex-turbo'))
result.push(benchmark('stylex-turbo-devup-ui'))
result.push(benchmark('vanilla-extract'))
result.push(benchmark('kuma-ui'))
result.push(benchmark('panda-css'))
Expand Down
3 changes: 3 additions & 0 deletions benchmark/next-stylex-turbo-devup-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.next/
next-env.d.ts
df/
18 changes: 18 additions & 0 deletions benchmark/next-stylex-turbo-devup-ui/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Metadata } from 'next'

export const metadata: Metadata = {
title: 'StyleX Turbopack Devup UI benchmark',
description: 'StyleX benchmark built with Next.js Turbopack and Devup UI',
}

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
81 changes: 81 additions & 0 deletions benchmark/next-stylex-turbo-devup-ui/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
'use client'

import { Box, globalCss } from '@devup-ui/react'
import * as stylex from '@stylexjs/stylex'
import { useState } from 'react'

const styles = stylex.create({
base: {
fontSize: 32,
position: 'relative',
paddingTop: '28px',
paddingBottom: '28px',
backgroundColor: {
default: 'blue',
':hover': 'yellow',
},
cursor: {
default: 'pointer',
':hover': 'cell',
},
},
typo: {
color: 'var(--text)',
},
conditional: {
color: 'green',
},
conditional1: {
color: 'blue',
},
hello: {
fontSize: 32,
paddingRight: '20px',
},
hello2: {
fontSize: 12,
},
})

globalCss({
'*': {
boxSizing: 'border-box',
p: 0,
m: 0,
},
})

export default function HomePage() {
const [_, setColor] = useState('yellow')
const [enabled, setEnabled] = useState(false)

return (
<div>
<Box as="p" style={{ backgroundColor: 'blue' }}>
Track & field champions:
</Box>
<Box as="section" {...stylex.props(styles.base)}>
<div>hello</div>
<div>hello</div>
</Box>
<Box {...stylex.props(styles.typo)}>text</Box>
<Box
{...stylex.props(
enabled ? styles.conditional : styles.conditional1,
styles.hello,
)}
>
hello
</Box>
<Box {...stylex.props(styles.hello2)}>hello</Box>
<button
onClick={() => {
setColor('blue')
setEnabled((prev) => !prev)
}}
>
Change
</button>
</div>
)
}
3 changes: 3 additions & 0 deletions benchmark/next-stylex-turbo-devup-ui/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { DevupUI } from '@devup-ui/next-plugin'

export default DevupUI({}, { singleCss: true })
28 changes: 28 additions & 0 deletions benchmark/next-stylex-turbo-devup-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "next-stylex-turbo-devup-ui-benchmark",
"version": "0.1.0",
"type": "module",
"private": true,
"scripts": {
"predev": "rimraf .next df",
"prebuild": "rimraf .next df",
"dev": "next dev",
"build": "next build --experimental-debug-memory-usage",
"start": "next start"
},
"dependencies": {
"@devup-ui/react": "workspace:^",
"@stylexjs/stylex": "^0.19",
"next": "16.3",
"react": "19.2",
"react-dom": "19.2"
},
"devDependencies": {
"@devup-ui/next-plugin": "workspace:^",
"@types/node": "^26.2",
"@types/react": "^19.2",
"@types/react-dom": "^19.2",
"rimraf": "^6.1",
"typescript": "^7.0"
}
}
34 changes: 34 additions & 0 deletions benchmark/next-stylex-turbo-devup-ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "es2024",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
2 changes: 2 additions & 0 deletions benchmark/next-stylex-turbo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.next/
next-env.d.ts
7 changes: 7 additions & 0 deletions benchmark/next-stylex-turbo/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@stylex;

* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
20 changes: 20 additions & 0 deletions benchmark/next-stylex-turbo/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import './globals.css'

import type { Metadata } from 'next'

export const metadata: Metadata = {
title: 'StyleX Turbopack benchmark',
description: 'StyleX benchmark built with Next.js Turbopack',
}

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
70 changes: 70 additions & 0 deletions benchmark/next-stylex-turbo/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
'use client'

import * as stylex from '@stylexjs/stylex'
import { useState } from 'react'

const styles = stylex.create({
base: {
fontSize: 32,
position: 'relative',
paddingTop: '28px',
paddingBottom: '28px',
backgroundColor: {
default: 'blue',
':hover': 'yellow',
},
cursor: {
default: 'pointer',
':hover': 'cell',
},
},
typo: {
color: 'var(--text)',
},
conditional: {
color: 'green',
},
conditional1: {
color: 'blue',
},
hello: {
fontSize: 32,
paddingRight: '20px',
},
hello2: {
fontSize: 12,
},
})

export default function HomePage() {
const [_, setColor] = useState('yellow')
const [enabled, setEnabled] = useState(false)

return (
<div>
<p style={{ backgroundColor: 'blue' }}>Track & field champions:</p>
<section {...stylex.props(styles.base)}>
<div>hello</div>
<div>hello</div>
</section>
<div {...stylex.props(styles.typo)}>text</div>
<div
{...stylex.props(
enabled ? styles.conditional : styles.conditional1,
styles.hello,
)}
>
hello
</div>
<div {...stylex.props(styles.hello2)}>hello</div>
<button
onClick={() => {
setColor('blue')
setEnabled((prev) => !prev)
}}
>
Change
</button>
</div>
)
}
22 changes: 22 additions & 0 deletions benchmark/next-stylex-turbo/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const path = require('node:path')

module.exports = {
presets: ['next/babel'],
plugins: [
[
'@stylexjs/babel-plugin',
{
dev: process.env.NODE_ENV !== 'production',
runtimeInjection: false,
genConditionalClasses: true,
treeshakeCompensation: true,
aliases: {
'@/*': [path.join(__dirname, '*')],
},
unstable_moduleResolution: {
type: 'commonJS',
},
},
],
],
}
2 changes: 2 additions & 0 deletions benchmark/next-stylex-turbo/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('next').NextConfig} */
module.exports = {}
28 changes: 28 additions & 0 deletions benchmark/next-stylex-turbo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "next-stylex-turbo-benchmark",
"version": "0.1.0",
"private": true,
"scripts": {
"predev": "rimraf .next",
"prebuild": "rimraf .next",
"dev": "next dev",
"build": "next build --experimental-debug-memory-usage",
"start": "next start"
},
"dependencies": {
"@stylexjs/stylex": "^0.19",
"next": "16.3",
"react": "19.2",
"react-dom": "19.2"
},
"devDependencies": {
"@stylexjs/babel-plugin": "0.19.0",
"@stylexjs/postcss-plugin": "0.19.0",
"@types/node": "^26.2",
"@types/react": "^19.2",
"@types/react-dom": "^19.2",
"postcss": "^8.5",
"rimraf": "^6.1",
"typescript": "^7.0"
}
}
8 changes: 8 additions & 0 deletions benchmark/next-stylex-turbo/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
plugins: {
'@stylexjs/postcss-plugin': {
include: ['app/**/*.{js,jsx,ts,tsx}'],
exclude: ['**/node_modules/**', '**/.next/**'],
},
},
}
34 changes: 34 additions & 0 deletions benchmark/next-stylex-turbo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "es2024",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
Loading
Loading