Skip to content

Commit c0534a0

Browse files
authored
Merge pull request #454 from dev-five-git/optimize-turbo
Optimize turbo
2 parents afca11c + c00e1d8 commit c0534a0

File tree

56 files changed

+1300
-161
lines changed

Some content is hidden

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

56 files changed

+1300
-161
lines changed

.changeset/tired-berries-wonder.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@devup-ui/webpack-plugin': patch
3+
'@devup-ui/next-plugin': patch
4+
---
5+
6+
Support Turbopack

.github/workflows/publish.yml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,43 @@ on:
99
- main
1010
permissions: write-all
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: false
15+
1216
jobs:
17+
benchmark:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- uses: actions-rust-lang/setup-rust-toolchain@v1
24+
- name: Cargo tarpaulin and fmt
25+
run: |
26+
cargo install cargo-tarpaulin
27+
rustup component add rustfmt clippy
28+
- uses: pnpm/action-setup@v4
29+
name: Install pnpm
30+
with:
31+
run_install: false
32+
33+
- uses: jetli/wasm-pack-action@v0.4.0
34+
with:
35+
version: 'latest'
36+
- name: Install Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
registry-url: "https://registry.npmjs.org"
40+
node-version: 22
41+
cache: 'pnpm'
42+
- run: pnpm i
43+
- run: pnpm build
44+
- name: Benchmark
45+
run: pnpm benchmark
46+
1347
publish:
1448
runs-on: ubuntu-latest
15-
concurrency:
16-
group: ${{ github.workflow }}-${{ github.ref }}
17-
cancel-in-progress: false
1849
steps:
1950
- name: Checkout
2051
uses: actions/checkout@v4
@@ -54,8 +85,6 @@ jobs:
5485
cargo fmt
5586
pnpm test
5687
rm -rf .rustfmt.toml
57-
- name: Benchmark
58-
run: pnpm benchmark
5988
- name: Build Landing
6089
run: |
6190
pnpm -F components build-storybook

apps/landing/next.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import { DevupUI } from '@devup-ui/next-plugin'
22
import createMDX from '@next/mdx'
33

44
const withMDX = createMDX({
5-
// options: {
6-
// remarkPlugins: [remarkGfm],
7-
// },
85
extension: /\.mdx?$/,
96
})
107

118
export default withMDX(
129
DevupUI({
1310
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
1411
output: 'export',
12+
reactCompiler: true,
1513
}),
1614
)

apps/landing/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "node ./script.js && next dev",
88
"search": "node ./script.js",
9-
"build": "node ./script.js && next build --webpack",
9+
"build": "node ./script.js && next build",
1010
"start": "npx serve ./out",
1111
"lint": "eslint"
1212
},
@@ -19,21 +19,22 @@
1919
"@next/mdx": "^16.0",
2020
"body-scroll-lock": "3.1",
2121
"clsx": "^2.1",
22+
"lenis": "1.3",
2223
"next": "^16.0",
2324
"react": "^19.2",
2425
"react-dom": "^19.2",
2526
"react-markdown": "^10.1",
26-
"react-syntax-highlighter": "^15.6",
27-
"lenis": "1.3"
27+
"react-syntax-highlighter": "^15.6"
2828
},
2929
"devDependencies": {
30-
"@types/mdx": "^2.0",
3130
"@devup-ui/next-plugin": "workspace:*",
3231
"@types/body-scroll-lock": "^3.1",
32+
"@types/mdx": "^2.0",
3333
"@types/node": "^24",
3434
"@types/react": "^19",
3535
"@types/react-dom": "^19",
3636
"@types/react-syntax-highlighter": "^15.5",
37+
"babel-plugin-react-compiler": "^1.0",
3738
"typescript": "^5"
3839
}
3940
}

apps/landing/src/app/(detail)/docs/RightIndex.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ export function RightIndex() {
7272
Contents
7373
</Text>
7474
</Flex>
75-
{menus.map((menu) => (
76-
<IndexMenu key={menu.text} onClick={menu.onClick} sub={menu.sub}>
75+
{menus.map((menu, idx) => (
76+
<IndexMenu
77+
key={menu.text + idx}
78+
onClick={menu.onClick}
79+
sub={menu.sub}
80+
>
7781
{menu.text}
7882
</IndexMenu>
7983
))}

apps/landing/src/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export const metadata: Metadata = {
2727
resetCss()
2828

2929
globalCss({
30+
pre: {
31+
borderRadius: '10px',
32+
},
3033
fontFaces: [
3134
{
3235
fontFamily: 'Pretendard',
@@ -85,9 +88,6 @@ globalCss({
8588
lineHeight: '1.5',
8689
letterSpacing: '-0.03em',
8790
},
88-
pre: {
89-
borderRadius: '10px',
90-
},
9191
})
9292

9393
export default function RootLayout({

benchmark.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ function clearBuildFile() {
5959
recursive: true,
6060
force: true,
6161
})
62+
if (existsSync('./benchmark/next-tailwind-turbo/.next'))
63+
rmSync('./benchmark/next-tailwind-turbo/.next', {
64+
recursive: true,
65+
force: true,
66+
})
67+
68+
if (existsSync('./benchmark/next-devup-ui-single-turbo/.next'))
69+
rmSync('./benchmark/next-devup-ui-single-turbo/.next', {
70+
recursive: true,
71+
force: true,
72+
})
73+
if (existsSync('./benchmark/next-devup-ui-single-turbo/df'))
74+
rmSync('./benchmark/next-devup-ui-single-turbo/df', {
75+
recursive: true,
76+
force: true,
77+
})
6278
}
6379

6480
function checkDirSize(path) {
@@ -106,5 +122,7 @@ result.push(benchmark('chakra-ui'))
106122
result.push(benchmark('mui'))
107123
result.push(benchmark('devup-ui'))
108124
result.push(benchmark('devup-ui-single'))
125+
result.push(benchmark('tailwind-turbo'))
126+
result.push(benchmark('devup-ui-single-turbo'))
109127

110128
console.info(result.join('\n'))

benchmark/next-chakra-ui/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"moduleResolution": "bundler",
1212
"resolveJsonModule": true,
1313
"isolatedModules": true,
14-
"jsx": "preserve",
14+
"jsx": "react-jsx",
1515
"incremental": true,
1616
"plugins": [
1717
{
@@ -27,7 +27,8 @@
2727
"**/*.ts",
2828
"**/*.tsx",
2929
".next/types/**/*.ts",
30-
"df/*.d.ts"
30+
"df/*.d.ts",
31+
".next/dev/types/**/*.ts"
3132
],
3233
"exclude": ["node_modules"]
3334
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Nextjs App

0 commit comments

Comments
 (0)