Skip to content

Commit bf33f4a

Browse files
authored
refactor: replace deprecated rolldown-vite with vite-plus (#183)
rolldown-vite is deprecated in favor of Vite 8 / Vite+. Remove all rolldown-vite references and rebrand the version-benchmarking feature: - Point client types at vite-plus/client - Drop rolldown-vite from the tracked npm packages and GitHub dependents - Retarget the version-override tool at stable Vite 8 releases (override-rolldown.mjs -> override-vite.mjs) - Rename the stats feature to Vite Stats (page, components, route, data file, workflow)
1 parent 3355722 commit bf33f4a

18 files changed

Lines changed: 94 additions & 265 deletions

.github/workflows/update-rolldown-stats.yml renamed to .github/workflows/update-vite-stats.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Update Rolldown Stats
1+
name: Update Vite Stats
22

33
on:
44
workflow_dispatch:
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
cache: true
2727

28-
- name: Run rolldown stats collection
28+
- name: Run vite stats collection
2929
run: vp run generate
3030
env:
3131
GITHUB_TOKEN: ${{ github.token }}
@@ -36,11 +36,11 @@ jobs:
3636
- name: Check for changes
3737
id: git-check
3838
run: |
39-
if git diff --exit-code data/rolldown-version-stats.json; then
40-
echo "No changes detected in rolldown-version-stats.json"
39+
if git diff --exit-code data/vite-version-stats.json; then
40+
echo "No changes detected in vite-version-stats.json"
4141
echo "changes=false" >> $GITHUB_OUTPUT
4242
else
43-
echo "Changes detected in rolldown-version-stats.json"
43+
echo "Changes detected in vite-version-stats.json"
4444
echo "changes=true" >> $GITHUB_OUTPUT
4545
fi
4646
@@ -49,8 +49,8 @@ jobs:
4949
run: |
5050
git config --local user.email "1430279+Boshen@users.noreply.github.com"
5151
git config --local user.name "Boshen"
52-
git add data/rolldown-version-stats.json
53-
git commit -m "chore: update rolldown version stats"
52+
git add data/vite-version-stats.json
53+
git commit -m "chore: update vite version stats"
5454
git push origin main
5555
5656
- name: No changes to commit

apps/dashboard/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SidebarProvider } from "./context/SidebarContext";
88
const HomePage = lazy(() => import("./pages/HomePage"));
99
const MinificationBenchmarksPage = lazy(() => import("./pages/MinificationBenchmarksPage"));
1010
const NpmPackagesPage = lazy(() => import("./pages/NpmPackagesPage"));
11-
const RolldownStatsPage = lazy(() => import("./pages/RolldownStatsPage"));
11+
const ViteStatsPage = lazy(() => import("./pages/ViteStatsPage"));
1212
const DependentsPage = lazy(() => import("./pages/DependentsPage"));
1313

1414
// Loading component for Suspense fallback
@@ -33,10 +33,10 @@ function App() {
3333
}
3434
/>
3535
<Route
36-
path="rolldown-stats"
36+
path="vite-stats"
3737
element={
3838
<Suspense fallback={<PageLoader />}>
39-
<RolldownStatsPage />
39+
<ViteStatsPage />
4040
</Suspense>
4141
}
4242
/>

apps/dashboard/src/NpmPackages.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { PackageDownloadsList } from "./components/npm/PackageDownloadsList";
33
const packages = [
44
"vite",
55
"vitest",
6-
"rolldown-vite",
76
"rolldown",
87
"tsdown",
98
"oxlint",
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { BuildTimeChart } from "./components/rolldown/BuildTimeChart";
2-
import { BundleSizeChart } from "./components/rolldown/BundleSizeChart";
3-
import { MetricNavigation } from "./components/rolldown/MetricNavigation";
4-
import { StatsCards } from "./components/rolldown/StatsCards";
1+
import { BuildTimeChart } from "./components/vite/BuildTimeChart";
2+
import { BundleSizeChart } from "./components/vite/BundleSizeChart";
3+
import { MetricNavigation } from "./components/vite/MetricNavigation";
4+
import { StatsCards } from "./components/vite/StatsCards";
55

6-
interface RolldownStatsProps {
6+
interface ViteStatsProps {
77
selectedMetric: string;
88
setSelectedMetric: (metric: string) => void;
99
}
1010

11-
function RolldownStats({ selectedMetric, setSelectedMetric }: RolldownStatsProps) {
11+
function ViteStats({ selectedMetric, setSelectedMetric }: ViteStatsProps) {
1212
return (
1313
<>
1414
<MetricNavigation selectedMetric={selectedMetric} setSelectedMetric={setSelectedMetric} />
@@ -27,4 +27,4 @@ function RolldownStats({ selectedMetric, setSelectedMetric }: RolldownStatsProps
2727
);
2828
}
2929

30-
export default RolldownStats;
30+
export default ViteStats;

apps/dashboard/src/__tests__/pages.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { describe, expect, it } from "vite-plus/test";
44
import App from "../App";
55
import MinificationBenchmarksPage from "../pages/MinificationBenchmarksPage";
66
import NpmPackagesPage from "../pages/NpmPackagesPage";
7-
import RolldownStatsPage from "../pages/RolldownStatsPage";
7+
import ViteStatsPage from "../pages/ViteStatsPage";
88

99
describe("Pages rendering tests", () => {
1010
it("should render App component without errors", () => {
@@ -16,10 +16,10 @@ describe("Pages rendering tests", () => {
1616
expect(container).toBeTruthy();
1717
});
1818

19-
it("should render RolldownStatsPage without errors", () => {
19+
it("should render ViteStatsPage without errors", () => {
2020
const { container } = render(
2121
<MemoryRouter>
22-
<RolldownStatsPage />
22+
<ViteStatsPage />
2323
</MemoryRouter>,
2424
);
2525
expect(container).toBeTruthy();

apps/dashboard/src/components/layout/Sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const navItems: NavItem[] = [
2727
icon: <Home size={20} />,
2828
},
2929
{
30-
path: "/rolldown-stats",
31-
label: "Rolldown Stats",
30+
path: "/vite-stats",
31+
label: "Vite Stats",
3232
icon: <Package size={20} />,
3333
},
3434
{

apps/dashboard/src/components/rolldown/BuildTimeChart.tsx renamed to apps/dashboard/src/components/vite/BuildTimeChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import {
1111
YAxis,
1212
} from "recharts";
1313
import * as semver from "semver";
14-
import rolldownStats from "../../../../../data/rolldown-version-stats.json";
14+
import viteStats from "../../../../../data/vite-version-stats.json";
1515

16-
const buildTimeData = rolldownStats
16+
const buildTimeData = viteStats
1717
.map((stat) => ({
1818
name: `v${stat.version}`,
1919
value: stat.buildTime,

apps/dashboard/src/components/rolldown/BundleSizeChart.tsx renamed to apps/dashboard/src/components/vite/BundleSizeChart.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ import {
1212
YAxis,
1313
} from "recharts";
1414
import * as semver from "semver";
15-
import rolldownStats from "../../../../../data/rolldown-version-stats.json";
15+
import viteStats from "../../../../../data/vite-version-stats.json";
1616

17-
const sortedRolldownStats = [...rolldownStats].toSorted((a, b) =>
18-
semver.compare(a.version, b.version),
19-
);
17+
const sortedViteStats = [...viteStats].toSorted((a, b) => semver.compare(a.version, b.version));
2018

21-
const bundleSizeDiffData = sortedRolldownStats.map((stat, index) => {
19+
const bundleSizeDiffData = sortedViteStats.map((stat, index) => {
2220
if (index === 0) {
2321
return {
2422
name: `v${stat.version}`,
@@ -31,7 +29,7 @@ const bundleSizeDiffData = sortedRolldownStats.map((stat, index) => {
3129
};
3230
}
3331

34-
const prevSize = sortedRolldownStats[index - 1].totalSize;
32+
const prevSize = sortedViteStats[index - 1].totalSize;
3533
const currentSize = stat.totalSize;
3634
const diff = currentSize - prevSize;
3735

apps/dashboard/src/components/rolldown/MetricNavigation.tsx renamed to apps/dashboard/src/components/vite/MetricNavigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Clock, Package } from "lucide-react";
22

3-
const rolldownMetrics = [
3+
const viteMetrics = [
44
{ id: "bundleSize", name: "Bundle Size", icon: Package },
55
{ id: "buildTime", name: "Build Time", icon: Clock },
66
];
@@ -13,7 +13,7 @@ interface MetricNavigationProps {
1313
export function MetricNavigation({ selectedMetric, setSelectedMetric }: MetricNavigationProps) {
1414
return (
1515
<nav className="px-6 py-4 border-b border-[var(--color-border)] flex gap-2">
16-
{rolldownMetrics.map((metric) => {
16+
{viteMetrics.map((metric) => {
1717
const Icon = metric.icon;
1818
return (
1919
<button

apps/dashboard/src/components/rolldown/StatsCards.tsx renamed to apps/dashboard/src/components/vite/StatsCards.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { useMemo } from "react";
22
import { formatNumberWithCommas } from "@vibe/utils";
3-
import rolldownStats from "../../../../../data/rolldown-version-stats.json";
3+
import viteStats from "../../../../../data/vite-version-stats.json";
44

55
export function StatsCards() {
66
const stats = useMemo(() => {
7-
const buildTimeData = rolldownStats.map((stat) => stat.buildTime);
7+
const buildTimeData = viteStats.map((stat) => stat.buildTime);
88
const avgBuildTime = Math.round(
99
buildTimeData.reduce((sum, item) => sum + item, 0) / buildTimeData.length,
1010
);
11-
const latestStat = rolldownStats[rolldownStats.length - 1];
12-
const totalSizes = rolldownStats.map((s) => s.totalSize);
11+
const latestStat = viteStats[viteStats.length - 1];
12+
const totalSizes = viteStats.map((s) => s.totalSize);
1313
const sizeRange = Math.round((Math.max(...totalSizes) - Math.min(...totalSizes)) / 1024);
1414

1515
return [
@@ -30,8 +30,8 @@ export function StatsCards() {
3030
},
3131
{
3232
label: "Versions Tested",
33-
value: rolldownStats.length.toString(),
34-
badge: `${rolldownStats[0]?.version} - ${latestStat?.version}`,
33+
value: viteStats.length.toString(),
34+
badge: `${viteStats[0]?.version} - ${latestStat?.version}`,
3535
},
3636
];
3737
}, []);

0 commit comments

Comments
 (0)