Skip to content

Commit d7332ca

Browse files
authored
Performance optimizations & use Rolldown + Oxc (#677)
1 parent 26dd0f3 commit d7332ca

File tree

8 files changed

+125
-169
lines changed

8 files changed

+125
-169
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ jobs:
2424
uses: biomejs/setup-biome@v2
2525

2626
- name: Run Biome
27-
run: biome ci --error-on-warnings --formatter-enabled=false --assist-enabled=false --enforce-assist=false --css-linter-enabled=false src
28-
29-
27+
run: |
28+
biome ci --error-on-warnings src

lefthook.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,5 @@ pre-commit:
33
check:
44
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
55
root: "react/"
6-
run: bunx --bun biome check --write --error-on-warnings --colors=off {staged_files}
7-
stage_fixed: true
8-
rustywind:
9-
glob: "*.{js,ts,jsx,tsx}"
10-
root: "react/"
11-
run: bunx --bun rustywind --write {staged_files}
6+
run: bunx biome check --write --error-on-warnings {staged_files}
127
stage_fixed: true

react/biome.json

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
33
"files": {
44
"ignoreUnknown": true,
55
"includes": [
66
"**",
7-
"!**/node_modules/",
7+
"!**/node_modules",
88
"!**/.vscode",
99
"!**/.idea",
10-
"!**/public/",
10+
"!**/public",
1111
"!**/dist",
12-
"!**/bun.lock"
12+
"!**/bun.lock",
13+
"!**/src/index.css"
1314
]
1415
},
1516
"formatter": {
@@ -23,19 +24,7 @@
2324
"linter": {
2425
"enabled": true,
2526
"rules": {
26-
"recommended": true,
27-
"style": {
28-
"noParameterAssign": "error",
29-
"useAsConstAssertion": "error",
30-
"useDefaultParameterLast": "error",
31-
"useEnumInitializers": "error",
32-
"useSelfClosingElements": "error",
33-
"useSingleVarDeclarator": "error",
34-
"noUnusedTemplateLiteral": "error",
35-
"useNumberNamespace": "error",
36-
"noInferrableTypes": "error",
37-
"noUselessElse": "error"
38-
}
27+
"recommended": true
3928
}
4029
},
4130
"assist": { "actions": { "source": { "organizeImports": "on" } } },

react/bun.lock

Lines changed: 105 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react/bunfig.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

react/package.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
"type": "module",
66
"scripts": {
77
"dev": "bunx --bun vite",
8-
"build": "tsc && bunx --bun vite build",
8+
"build": "bunx --bun tsc && vite build",
99
"preview": "bunx --bun vite preview",
10-
"check": "biome check --write --unsafe --error-on-warnings .",
11-
"migrate": "biome migrate --write",
12-
"postinstall": "lefthook install"
10+
"check": "biome check --error-on-warnings --write ."
1311
},
1412
"dependencies": {
1513
"@radix-ui/react-accordion": "^1.2.12",
@@ -33,20 +31,13 @@
3331
"@types/node": "^24.3.0",
3432
"@types/react": "^19.1.11",
3533
"@types/react-dom": "^19.1.7",
36-
"@vitejs/plugin-react-swc": "^4.0.1",
37-
"bun-plugin-tailwind": "^0.0.15",
34+
"@vitejs/plugin-react": "^5.0.1",
3835
"lefthook": "^1.12.3",
39-
"rustywind": "^0.24.3",
4036
"tailwindcss": "^4.1.12",
4137
"typescript": "^5.9.2",
42-
"vite": "^7.1.3"
38+
"vite": "npm:rolldown-vite@latest"
4339
},
4440
"trustedDependencies": [
45-
"@swc/core",
46-
"@tailwindcss/oxide",
47-
"browser-tabs-lock",
48-
"esbuild",
49-
"lefthook",
50-
"rustywind"
41+
"lefthook"
5142
]
5243
}

react/src/routes/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChevronDown } from "lucide-react";
2+
import { useId } from "react";
23
import { Link } from "react-router";
34

45
import { Navbar } from "@/components/app/navbar";
@@ -45,6 +46,8 @@ function MenuAnchorButton({ targetId, className }: Readonly<MenuAnchorProps>) {
4546
);
4647
}
4748
function Index() {
49+
const aboutSection = useId();
50+
4851
return (
4952
<>
5053
<Navbar />
@@ -81,13 +84,13 @@ function Index() {
8184
</div>
8285

8386
<div className="flex flex-col items-center md:pt-7">
84-
<MenuAnchorButton targetId="about-section" />
87+
<MenuAnchorButton targetId={aboutSection} />
8588
</div>
8689
</section>
8790

8891
{/* Introduction section */}
8992
<section
90-
id="about-section"
93+
id={aboutSection}
9194
className="container py-8 mx-auto md:py-12 px-18"
9295
>
9396
<div className="flex flex-col items-center md:flex-row">

react/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from "node:path";
22

33
import tailwindcss from "@tailwindcss/vite";
4-
import react from "@vitejs/plugin-react-swc";
4+
import react from "@vitejs/plugin-react";
55
import { defineConfig } from "vite";
66

77
// https://vitejs.dev/config/

0 commit comments

Comments
 (0)