Skip to content

Commit 34ff85b

Browse files
committed
Initialize directory
1 parent 6f07684 commit 34ff85b

File tree

43 files changed

+3606
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3606
-11
lines changed

.github/workflows/turbopack-benchmark.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
- name: Build the benchmark target(s)
4545
run: cargo codspeed build -p turbo-rcstr -p turbopack-ecmascript
4646

47+
- name: Build app build benchmarks
48+
run: cargo codspeed build -p turbopack-cli small_apps
49+
4750
- name: Run the benchmarks
4851
uses: CodSpeedHQ/action@v3
4952
with:

turbopack/benchmark-apps/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Benchmark Apps
2+
3+
This directory contains apps that are used to benchmark the performance of Turbopack.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as React from 'react'
2+
import * as DateFns from 'date-fns'
3+
4+
console.log(DateFns)
5+
6+
export default function Home() {
7+
return <div>Benchmark</div>
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as React from 'react'
2+
import { format } from 'date-fns'
3+
4+
export default function Home() {
5+
return <div>{format(new Date(), "'Today is a' eeee")}</div>
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable react/jsx-pascal-case */
2+
import * as React from 'react'
3+
import * as FramerMotion from 'framer-motion'
4+
5+
console.log(FramerMotion)
6+
7+
export default function Home() {
8+
return (
9+
<div>
10+
<FramerMotion.motion.div animate={{ x: 0 }} />
11+
</div>
12+
)
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as React from 'react'
2+
import { motion } from 'framer-motion'
3+
4+
export default function Home() {
5+
return (
6+
<div>
7+
<motion.div animate={{ x: 0 }} />
8+
</div>
9+
)
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)

turbopack/benchmark-apps/joy/App.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import * as React from 'react'
2+
import { Container, Typography, Box, Link } from '@mui/joy'
3+
import ProTip from './ProTip'
4+
5+
function Copyright() {
6+
return (
7+
<Typography
8+
textAlign="center"
9+
sx={{
10+
color: 'text.secondary',
11+
}}
12+
>
13+
{'Copyright © '}
14+
<Link href="https://mui.com/">Your Website</Link>{' '}
15+
{new Date().getFullYear()}.
16+
</Typography>
17+
)
18+
}
19+
20+
export default function App() {
21+
return (
22+
<Container maxWidth="sm">
23+
<Box sx={{ my: 4 }}>
24+
<Typography level="h4" component="h1" sx={{ mb: 2 }}>
25+
Material UI Vite.js example in TypeScript
26+
</Typography>
27+
<ProTip />
28+
<Copyright />
29+
</Box>
30+
</Container>
31+
)
32+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as React from 'react'
2+
import { Link, Typography, SvgIcon, type SvgIconProps } from '@mui/joy'
3+
4+
function LightBulbIcon(props: SvgIconProps) {
5+
return (
6+
<SvgIcon {...props}>
7+
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z" />
8+
</SvgIcon>
9+
)
10+
}
11+
12+
export default function ProTip() {
13+
return (
14+
<Typography sx={{ mt: 6, mb: 3, color: 'text.secondary' }}>
15+
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
16+
{'Pro tip: See more '}
17+
<Link href="https://mui.com/material-ui/getting-started/templates/">
18+
templates
19+
</Link>
20+
{' in the Material UI documentation.'}
21+
</Typography>
22+
)
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-joy/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import { CssBaseline } from '@mui/joy'
4+
import App from './App'
5+
6+
ReactDOM.createRoot(document.getElementById('root')!).render(
7+
<React.StrictMode>
8+
<CssBaseline />
9+
<App />
10+
</React.StrictMode>
11+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as React from 'react'
2+
import * as Icons from 'lucide-react'
3+
4+
export default function Home() {
5+
const dynamicName = 'Camera'
6+
const Icon = Icons[dynamicName]
7+
return (
8+
<div>
9+
<Icon />
10+
</div>
11+
)
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as React from 'react'
2+
import { Camera } from 'lucide-react'
3+
4+
export default function Home() {
5+
return (
6+
<div>
7+
<Camera />
8+
</div>
9+
)
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="initial-scale=1, width=device-width" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src-mui/index.tsx"></script>
10+
</body>
11+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react'
2+
import * as ReactDOM from 'react-dom/client'
3+
import App from './App'
4+
5+
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
<React.StrictMode>
7+
<App />
8+
</React.StrictMode>
9+
)

turbopack/benchmark-apps/mui/App.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import * as React from 'react'
2+
import Container from '@mui/material/Container'
3+
import Typography from '@mui/material/Typography'
4+
import Box from '@mui/material/Box'
5+
import Link from '@mui/material/Link'
6+
import ProTip from './components/ProTip'
7+
import Copyright from './components/Copyright'
8+
9+
export default function Home() {
10+
return (
11+
<Container maxWidth="lg">
12+
<Box
13+
sx={{
14+
my: 4,
15+
display: 'flex',
16+
flexDirection: 'column',
17+
justifyContent: 'center',
18+
alignItems: 'center',
19+
}}
20+
>
21+
<Typography variant="h4" component="h1" sx={{ mb: 2 }}>
22+
Material UI - Next.js App Router example in TypeScript
23+
</Typography>
24+
<Link href="/about" color="secondary">
25+
Go to the about page
26+
</Link>
27+
<ProTip />
28+
<Copyright />
29+
</Box>
30+
</Container>
31+
)
32+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as React from 'react'
2+
import Link from '@mui/material/Link'
3+
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
4+
import Typography from '@mui/material/Typography'
5+
6+
function LightBulbIcon(props: SvgIconProps) {
7+
return (
8+
<SvgIcon {...props}>
9+
<path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z" />
10+
</SvgIcon>
11+
)
12+
}
13+
14+
export default function ProTip() {
15+
return (
16+
<Typography sx={{ mt: 6, mb: 3, color: 'text.secondary' }}>
17+
<LightBulbIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
18+
{'Pro tip: See more '}
19+
<Link href="https://mui.com/material-ui/getting-started/templates/">
20+
templates
21+
</Link>
22+
{' in the Material UI documentation.'}
23+
</Typography>
24+
)
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as React from 'react'
2+
import Typography from '@mui/material/Typography'
3+
import MuiLink from '@mui/material/Link'
4+
5+
export default function Copyright() {
6+
return (
7+
<Typography
8+
variant="body2"
9+
align="center"
10+
sx={{
11+
color: 'text.secondary',
12+
}}
13+
>
14+
{'Copyright © '}
15+
<MuiLink color="inherit" href="https://mui.com/">
16+
Your Website
17+
</MuiLink>{' '}
18+
{new Date().getFullYear()}.
19+
</Typography>
20+
)
21+
}

0 commit comments

Comments
 (0)