Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions apps/website/app/[[...mdxPath]]/page.jsx

This file was deleted.

19 changes: 0 additions & 19 deletions apps/website/app/_meta.js

This file was deleted.

123 changes: 0 additions & 123 deletions apps/website/app/layout.jsx

This file was deleted.

21 changes: 12 additions & 9 deletions apps/website/components/Customers.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from "next/link";
import customers from '../customers.json';
import customers from "../customers.json";

export default function Customers() {
const showcase = customers.map((customer, index) => {
Expand All @@ -8,16 +7,20 @@ export default function Customers() {
url.searchParams.append("utm_medium", "customers_page");

return (
<Link href={url} key={index}>
<img src={customer.image} style={{
width: customer.width ? `${customer.width}px` : '128px',
padding: '16px'
}} alt={customer.caption}/>
</Link>
<a href={url.toString()} key={index}>
<img
src={customer.image}
style={{
width: customer.width ? `${customer.width}px` : "128px",
padding: "16px",
}}
alt={customer.caption}
/>
</a>
);
});
return (
<div className={'flex items-center flex-wrap justify-center gap-6'}>
<div className={"flex items-center flex-wrap justify-center gap-6"}>
{showcase}
</div>
);
Expand Down
61 changes: 61 additions & 0 deletions apps/website/components/RspressCompat.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from "react";
import {
Callout as RspressCallout,
Tab as RspressTab,
Tabs as RspressTabs,
} from "@rspress/core/theme";

const calloutTypes = new Set([
"tip",
"note",
"important",
"warning",
"caution",
"danger",
"info",
"details",
]);

export function Callout({ children, emoji, type = "info", ...props }) {
const normalizedType = calloutTypes.has(type) ? type : "info";

return (
<RspressCallout type={normalizedType} {...props}>
{emoji ? <span className="mr-2 inline-block">{emoji}</span> : null}
{children}
</RspressCallout>
);
}

export function Tab(props) {
return <RspressTab {...props} />;
}

export function Tabs({ children, items, ...props }) {
const tabValues = Array.isArray(items)
? items.map((item) => ({
label: item,
value: String(item),
}))
: undefined;

const tabChildren = Array.isArray(items)
? React.Children.toArray(children).map((child, index) => {
if (!React.isValidElement(child)) {
return child;
}

return React.cloneElement(child, {
value: String(items[index]),
});
})
: children;

return (
<RspressTabs values={tabValues} {...props}>
{tabChildren}
</RspressTabs>
);
}

Tabs.Tab = Tab;
6 changes: 2 additions & 4 deletions apps/website/components/TeamMembers.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Link from "next/link";

const members = [
{
name: "kdy1 / Donny",
Expand Down Expand Up @@ -50,7 +48,7 @@ export default function TeamMembers() {
<div className="grid grid-cols-3 gap-4 mt-4">
{members.map((member, index) => {
return (
<Link href={`https://github.com/${member.github}`} key={index}>
<a href={`https://github.com/${member.github}`} key={index}>
<div className="flex flex-col items-center">
<img
src={`https://github.com/${member.github}.png`}
Expand All @@ -62,7 +60,7 @@ export default function TeamMembers() {
<div className="font-bold text-center">{member.name}</div>
<div>{member.role}</div>
</div>
</Link>
</a>
);
})}
</div>
Expand Down
1 change: 1 addition & 0 deletions apps/website/components/benchmarks/benchmark.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import React, { useState, useEffect } from "react";
import "chart.js/auto";
import { Line } from "react-chartjs-2";
import styles from "./styles.module.css";

Expand Down
17 changes: 14 additions & 3 deletions apps/website/components/benchmarks/dynamic.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import dynamic from "next/dynamic";
import { BrowserOnly } from "@rspress/core/runtime";
import { lazy, Suspense } from "react";

const Benchmark = dynamic(() => import("./benchmark"));
const Benchmark = lazy(() => import("./benchmark"));

export default Benchmark;
export default function DynamicBenchmark() {
return (
<BrowserOnly fallback={<span>Loading...</span>}>
{() => (
<Suspense fallback={<span>Loading...</span>}>
<Benchmark />
</Suspense>
)}
</BrowserOnly>
);
}
17 changes: 17 additions & 0 deletions apps/website/content/_nav.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"text": "Docs",
"link": "/docs/getting-started",
"activeMatch": "^/docs/"
},
{
"text": "Playground",
"link": "/playground",
"activeMatch": "^/playground"
},
{
"text": "Blog",
"link": "/blog/perf-swc-vs-babel",
"activeMatch": "^/blog/"
}
]
4 changes: 0 additions & 4 deletions apps/website/content/blog/_meta.js

This file was deleted.

12 changes: 12 additions & 0 deletions apps/website/content/blog/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"type": "file",
"name": "perf-swc-vs-babel",
"label": "Performance Comparison of SWC and Babel"
},
{
"type": "file",
"name": "swc-1",
"label": "Introducing SWC 1.0"
}
]
15 changes: 0 additions & 15 deletions apps/website/content/docs/_meta.js

This file was deleted.

Loading