Skip to content

Commit

Permalink
Add a SWC badge to Vite's graph label (#3125)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz committed Dec 22, 2022
1 parent 8d86ee5 commit bbd1a5c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/components/pages/pack-home/PackBenchmarks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface BenchmarkBar {
label: string;
key: keyof BenchmarkData;
turbo?: true;
swc?: true;
}

export const DEFAULT_BARS: BenchmarkBar[] = [
Expand All @@ -38,6 +39,7 @@ export const DEFAULT_BARS: BenchmarkBar[] = [
{
key: "vite",
label: "Vite",
swc: true,
},
{
key: "next11",
Expand All @@ -53,6 +55,7 @@ export const HMR_BARS: BenchmarkBar[] = [
{
key: "vite",
label: "Vite",
swc: true,
},
{
key: "next12",
Expand Down
11 changes: 10 additions & 1 deletion docs/components/pages/pack-home/PackBenchmarksGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export function BenchmarksGraph({
<GraphBar
key={bar.key}
turbo={bar.turbo}
Label={<GraphLabel label={bar.label} turbo={bar.turbo} />}
Label={
<GraphLabel label={bar.label} turbo={bar.turbo} swc={bar.swc} />
}
duration={data[bar.key] * 1000}
longestTime={longestTimeWithPadding}
inView={graphInView}
Expand Down Expand Up @@ -291,11 +293,13 @@ const Time = ({
function GraphLabel({
label,
turbo,
swc,
mobileOnly,
esbuild,
}: {
label: string;
turbo?: boolean;
swc?: boolean;
mobileOnly?: boolean;
esbuild?: boolean;
}) {
Expand All @@ -316,6 +320,11 @@ function GraphLabel({
turbo
</p>
)}
{swc && (
<p className="font-space-grotesk m-0 font-light text-[#666666]">
with SWC
</p>
)}
{esbuild && (
<p className="font-space-grotesk m-0 text-[#666666]">esbuild</p>
)}
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/pack/docs/comparisons/vite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Note that Vite is using the official [SWC plugin](https://github.com/vitejs/vite
{
label: 'Vite',
key: 'vite',
swc: true
}
]} />

Expand All @@ -61,5 +62,6 @@ In a 1,000 module application, Turbopack can react to file changes **<DocsBenchm
{
label: 'Vite',
key: 'vite',
swc: true
}
]} />

1 comment on commit bbd1a5c

@vercel
Copy link

@vercel vercel bot commented on bbd1a5c Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.