Skip to content

Commit 4d1cb84

Browse files
committed
fix bugs
1 parent 77695eb commit 4d1cb84

File tree

9 files changed

+123
-131
lines changed

9 files changed

+123
-131
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ If you're trying to spin it up on CF, try adding this to your `optimizeDeps` in
6262
optimizeDeps: {
6363
include: [
6464
// other optimized deps
65-
"@bkrem/react-transition-group",
6665
],
6766
},
6867
```

docs/content/01-started/01-installation.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ If you're trying to spin it up on CF, try adding this to your `optimizeDeps` in
5858
optimizeDeps: {
5959
include: [
6060
// other optimized deps
61-
"@bkrem/react-transition-group",
6261
],
6362
},
6463
```

packages/react-router-devtools/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ If you're trying to spin it up on CF, try adding this to your `optimizeDeps` in
6262
optimizeDeps: {
6363
include: [
6464
// other optimized deps
65-
"beautify",
66-
"react-diff-viewer-continued",
67-
"classnames",
68-
"@bkrem/react-transition-group",
6965
],
7066
},
7167
```

packages/react-router-devtools/src/client/components/Tag.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ interface TagProps {
1313
color: keyof typeof TAG_COLORS
1414
children: ReactNode
1515
className?: string
16+
size?: "small" | "default"
1617
}
1718

18-
const Tag = ({ color, children, className }: TagProps) => {
19+
const Tag = ({ color, children, className, size = "default" }: TagProps) => {
1920
const { styles } = useStyles()
2021
return (
2122
<span
22-
className={cx(styles.tag.base, styles.tag[color.toLowerCase() as Lowercase<keyof typeof TAG_COLORS>], className)}
23+
className={cx(
24+
styles.tag.base,
25+
size === "small" && styles.tag.small,
26+
styles.tag[color.toLowerCase() as Lowercase<keyof typeof TAG_COLORS>],
27+
className
28+
)}
2329
>
2430
{children}
2531
</span>

packages/react-router-devtools/src/client/components/network-tracer/NetworkWaterfall.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ const NetworkWaterfall: React.FC<Props> = ({ requests, width }) => {
363363
</button>
364364
<div className={styles.network.waterfall.methodTag}>
365365
{request?.method && (
366-
<Tag className="!px-1 !py-0 text-[0.7rem]" color={METHOD_COLORS[request.method]}>
366+
<Tag size="small" color={METHOD_COLORS[request.method]}>
367367
{request.method}
368368
</Tag>
369369
)}
@@ -379,9 +379,6 @@ const NetworkWaterfall: React.FC<Props> = ({ requests, width }) => {
379379
styles.network.waterfall.scrollContainer,
380380
isDragging ? styles.network.waterfall.scrollContainerGrabbing : styles.network.waterfall.scrollContainerGrab
381381
)}
382-
style={{
383-
height: Math.min(filteredRequests.length * (BAR_HEIGHT + BAR_PADDING) + 24, window.innerHeight - 200),
384-
}}
385382
onMouseDown={handleMouseDown}
386383
onMouseMove={handleMouseMove}
387384
onMouseUp={handleMouseUp}
@@ -440,26 +437,6 @@ const NetworkWaterfall: React.FC<Props> = ({ requests, width }) => {
440437
/>
441438
</AnimatePresence>
442439
)}
443-
{/* <div className="sticky top-0 z-10 bg-gray-900 p-2 border-b border-gray-700 flex items-center gap-2">
444-
<button
445-
type="button"
446-
className="p-1 hover:bg-gray-700 rounded"
447-
onClick={() => setScale((s) => Math.min(MAX_SCALE, s + 0.1))}
448-
>
449-
<div id="zoom-in" className="w-4 h-4" />
450-
</button>
451-
<button
452-
type="button"
453-
className="p-1 hover:bg-gray-700 rounded"
454-
onClick={() => setScale((s) => Math.max(MIN_SCALE, s - 0.1))}
455-
>
456-
<div id="zoom-out" className="w-4 h-4" />
457-
</button>
458-
<button type="button" className="p-1 hover:bg-gray-700 rounded" onClick={handleReset}>
459-
<div id="rotate-ccw" className="w-4 h-4" />
460-
</button>
461-
<div className="text-sm text-gray-400">Scale: {scale.toFixed(2)}x</div>
462-
</div> */}
463440
</div>
464441
)
465442
}

packages/react-router-devtools/src/client/context/requests/request-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const RequestContext = createContext<{
99
}>({ requests: [], removeAllRequests: () => {}, isLimitReached: false })
1010

1111
const requestMap = new Map<string, RequestEvent>()
12-
const MAX_REQUESTS = 42
12+
const MAX_REQUESTS = 60
1313

1414
export const RequestProvider = ({ children }: { children: ReactNode }) => {
1515
const [requests, setRequests] = useState<RequestEvent[]>([])

packages/react-router-devtools/src/client/styles/use-styles.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ const stylesFactory = (theme: "light" | "dark") => {
308308
font-weight: 500;
309309
height: max-content;
310310
`,
311+
small: css`
312+
padding: 0 0.25rem;
313+
font-size: 0.7rem;
314+
`,
311315
green: css`
312316
border: 1px solid #10b981;
313317
color: ${textPrimary};
@@ -1935,6 +1939,7 @@ const stylesFactory = (theme: "light" | "dark") => {
19351939
flex: 1;
19361940
overflow: hidden;
19371941
width: 100%;
1942+
min-height: 0;
19381943
`,
19391944
},
19401945

@@ -1943,28 +1948,29 @@ const stylesFactory = (theme: "light" | "dark") => {
19431948
// NetworkPanel
19441949
panel: {
19451950
container: css`
1946-
height: 100%;
1951+
height: 100%;
19471952
overflow-y: auto;
19481953
color: #e5e7eb;
19491954
`,
19501955
innerContainer: css`
1951-
height: 100%;
1956+
height: 100%;
19521957
margin-left: auto;
19531958
margin-right: auto;
19541959
padding: 1rem;
19551960
`,
19561961
cardContainer: css`
1957-
height: 100%;
1962+
1963+
height: 100%;
19581964
background-color: #1f2937;
19591965
border-radius: 0.5rem;
19601966
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
19611967
overflow: hidden;
19621968
`,
19631969
networkContainer: css`
1964-
height: 100%;
1970+
height: 100%;
19651971
border-top: 1px solid #374151;
19661972
padding: 1rem;
1967-
overflow-y: auto;
1973+
overflow: hidden;
19681974
`,
19691975
},
19701976

@@ -2041,7 +2047,7 @@ const stylesFactory = (theme: "light" | "dark") => {
20412047
justify-content: space-between;
20422048
gap: 1rem;
20432049
padding: 0.625rem 1rem;
2044-
margin-bottom: 1rem;
2050+
margin-bottom: 1rem;
20452051
background-color: rgba(59, 130, 246, 0.1);
20462052
border-bottom: 1px solid rgba(59, 130, 246, 0.3);
20472053
font-size: 0.75rem;
@@ -2065,6 +2071,7 @@ const stylesFactory = (theme: "light" | "dark") => {
20652071
`,
20662072
flexContainer: css`
20672073
display: flex;
2074+
20682075
`,
20692076
requestsHeader: css`
20702077
height: 1.25rem;
@@ -2093,7 +2100,7 @@ const stylesFactory = (theme: "light" | "dark") => {
20932100
requestButton: css`
20942101
display: flex;
20952102
width: 100%;
2096-
align-items: center;
2103+
align-items: baseline;
20972104
gap: 0.375rem;
20982105
padding-left: 0.375rem;
20992106
padding-right: 0.375rem;

packages/react-router-devtools/src/vite/plugin.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
242242
include: [
243243
...(config.optimizeDeps?.include ?? []),
244244
"react-router-devtools > react-d3-tree",
245-
"react-router-devtools > @bkrem/react-transition-group",
246245
"react-router-devtools/client",
247246
"react-router-devtools/context",
248247
"react-router-devtools/server",
Lines changed: 99 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,99 @@
1-
import logoDark from "./logo-dark.svg";
2-
import logoLight from "./logo-light.svg";
3-
4-
export function Welcome({ message }: { message: string }) {
5-
return (
6-
<main className="flex h-screen items-center justify-center">
7-
<div className="flex flex-col items-center gap-16">
8-
<header className="flex flex-col items-center gap-9">
9-
<h1 className="leading text-2xl font-bold text-gray-800 dark:text-gray-100">
10-
{message}
11-
</h1>
12-
<div className="w-[500px] max-w-[100vw] p-4">
13-
<img
14-
src={logoLight}
15-
alt="React Router"
16-
className="block w-full dark:hidden"
17-
/>
18-
<img
19-
src={logoDark}
20-
alt="React Router"
21-
className="hidden w-full dark:block"
22-
/>
23-
</div>
24-
</header>
25-
<nav className="flex flex-col items-center justify-center gap-4 rounded-3xl border border-gray-200 p-6 dark:border-gray-700">
26-
<p className="leading-6 text-gray-700 dark:text-gray-200">
27-
What&apos;s next?
28-
</p>
29-
<ul>
30-
{resources.map(({ href, text, icon }) => (
31-
<li key={href}>
32-
<a
33-
className="group flex items-center gap-3 self-stretch p-3 leading-normal text-blue-700 hover:underline dark:text-blue-500"
34-
href={href}
35-
target="_blank"
36-
rel="noreferrer"
37-
>
38-
{icon}
39-
{text}
40-
</a>
41-
</li>
42-
))}
43-
</ul>
44-
</nav>
45-
</div>
46-
</main>
47-
);
48-
}
49-
50-
const resources = [
51-
{
52-
href: "https://reactrouter.com/docs",
53-
text: "React Router Docs",
54-
icon: (
55-
<svg
56-
xmlns="http://www.w3.org/2000/svg"
57-
width="24"
58-
height="20"
59-
viewBox="0 0 20 20"
60-
fill="none"
61-
className="stroke-gray-600 group-hover:stroke-current dark:stroke-gray-300"
62-
>
63-
<path
64-
d="M9.99981 10.0751V9.99992M17.4688 17.4688C15.889 19.0485 11.2645 16.9853 7.13958 12.8604C3.01467 8.73546 0.951405 4.11091 2.53116 2.53116C4.11091 0.951405 8.73546 3.01467 12.8604 7.13958C16.9853 11.2645 19.0485 15.889 17.4688 17.4688ZM2.53132 17.4688C0.951566 15.8891 3.01483 11.2645 7.13974 7.13963C11.2647 3.01471 15.8892 0.951453 17.469 2.53121C19.0487 4.11096 16.9854 8.73551 12.8605 12.8604C8.73562 16.9853 4.11107 19.0486 2.53132 17.4688Z"
65-
strokeWidth="1.5"
66-
strokeLinecap="round"
67-
/>
68-
</svg>
69-
),
70-
},
71-
{
72-
href: "https://rmx.as/discord",
73-
text: "Join Discord",
74-
icon: (
75-
<svg
76-
xmlns="http://www.w3.org/2000/svg"
77-
width="24"
78-
height="20"
79-
viewBox="0 0 24 20"
80-
fill="none"
81-
className="stroke-gray-600 group-hover:stroke-current dark:stroke-gray-300"
82-
>
83-
<path
84-
d="M15.0686 1.25995L14.5477 1.17423L14.2913 1.63578C14.1754 1.84439 14.0545 2.08275 13.9422 2.31963C12.6461 2.16488 11.3406 2.16505 10.0445 2.32014C9.92822 2.08178 9.80478 1.84975 9.67412 1.62413L9.41449 1.17584L8.90333 1.25995C7.33547 1.51794 5.80717 1.99419 4.37748 2.66939L4.19 2.75793L4.07461 2.93019C1.23864 7.16437 0.46302 11.3053 0.838165 15.3924L0.868838 15.7266L1.13844 15.9264C2.81818 17.1714 4.68053 18.1233 6.68582 18.719L7.18892 18.8684L7.50166 18.4469C7.96179 17.8268 8.36504 17.1824 8.709 16.4944L8.71099 16.4904C10.8645 17.0471 13.128 17.0485 15.2821 16.4947C15.6261 17.1826 16.0293 17.8269 16.4892 18.4469L16.805 18.8725L17.3116 18.717C19.3056 18.105 21.1876 17.1751 22.8559 15.9238L23.1224 15.724L23.1528 15.3923C23.5873 10.6524 22.3579 6.53306 19.8947 2.90714L19.7759 2.73227L19.5833 2.64518C18.1437 1.99439 16.6386 1.51826 15.0686 1.25995ZM16.6074 10.7755L16.6074 10.7756C16.5934 11.6409 16.0212 12.1444 15.4783 12.1444C14.9297 12.1444 14.3493 11.6173 14.3493 10.7877C14.3493 9.94885 14.9378 9.41192 15.4783 9.41192C16.0471 9.41192 16.6209 9.93851 16.6074 10.7755ZM8.49373 12.1444C7.94513 12.1444 7.36471 11.6173 7.36471 10.7877C7.36471 9.94885 7.95323 9.41192 8.49373 9.41192C9.06038 9.41192 9.63892 9.93712 9.6417 10.7815C9.62517 11.6239 9.05462 12.1444 8.49373 12.1444Z"
85-
strokeWidth="1.5"
86-
/>
87-
</svg>
88-
),
89-
},
90-
];
1+
import { Form } from "react-router";
2+
import logoDark from "./logo-dark.svg";
3+
import logoLight from "./logo-light.svg";
4+
5+
export function Welcome({ message }: { message: string }) {
6+
return (
7+
<main className="flex h-screen items-center justify-center">
8+
<div className="flex flex-col items-center gap-16">
9+
<header className="flex flex-col items-center gap-9">
10+
<h1 className="leading text-2xl font-bold text-gray-800 dark:text-gray-100">
11+
{message}
12+
</h1>
13+
<Form>
14+
<button
15+
type="submit"
16+
className="rounded-full bg-blue-600 px-6 py-3 font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800"
17+
>
18+
Get Started
19+
</button>
20+
</Form>
21+
<div className="w-[500px] max-w-[100vw] p-4">
22+
<img
23+
src={logoLight}
24+
alt="React Router"
25+
className="block w-full dark:hidden"
26+
/>
27+
<img
28+
src={logoDark}
29+
alt="React Router"
30+
className="hidden w-full dark:block"
31+
/>
32+
</div>
33+
</header>
34+
<nav className="flex flex-col items-center justify-center gap-4 rounded-3xl border border-gray-200 p-6 dark:border-gray-700">
35+
<p className="leading-6 text-gray-700 dark:text-gray-200">
36+
What&apos;s next?
37+
</p>
38+
<ul>
39+
{resources.map(({ href, text, icon }) => (
40+
<li key={href}>
41+
<a
42+
className="group flex items-center gap-3 self-stretch p-3 leading-normal text-blue-700 hover:underline dark:text-blue-500"
43+
href={href}
44+
target="_blank"
45+
rel="noreferrer"
46+
>
47+
{icon}
48+
{text}
49+
</a>
50+
</li>
51+
))}
52+
</ul>
53+
</nav>
54+
</div>
55+
</main>
56+
);
57+
}
58+
59+
const resources = [
60+
{
61+
href: "https://reactrouter.com/docs",
62+
text: "React Router Docs",
63+
icon: (
64+
<svg
65+
xmlns="http://www.w3.org/2000/svg"
66+
width="24"
67+
height="20"
68+
viewBox="0 0 20 20"
69+
fill="none"
70+
className="stroke-gray-600 group-hover:stroke-current dark:stroke-gray-300"
71+
>
72+
<path
73+
d="M9.99981 10.0751V9.99992M17.4688 17.4688C15.889 19.0485 11.2645 16.9853 7.13958 12.8604C3.01467 8.73546 0.951405 4.11091 2.53116 2.53116C4.11091 0.951405 8.73546 3.01467 12.8604 7.13958C16.9853 11.2645 19.0485 15.889 17.4688 17.4688ZM2.53132 17.4688C0.951566 15.8891 3.01483 11.2645 7.13974 7.13963C11.2647 3.01471 15.8892 0.951453 17.469 2.53121C19.0487 4.11096 16.9854 8.73551 12.8605 12.8604C8.73562 16.9853 4.11107 19.0486 2.53132 17.4688Z"
74+
strokeWidth="1.5"
75+
strokeLinecap="round"
76+
/>
77+
</svg>
78+
),
79+
},
80+
{
81+
href: "https://rmx.as/discord",
82+
text: "Join Discord",
83+
icon: (
84+
<svg
85+
xmlns="http://www.w3.org/2000/svg"
86+
width="24"
87+
height="20"
88+
viewBox="0 0 24 20"
89+
fill="none"
90+
className="stroke-gray-600 group-hover:stroke-current dark:stroke-gray-300"
91+
>
92+
<path
93+
d="M15.0686 1.25995L14.5477 1.17423L14.2913 1.63578C14.1754 1.84439 14.0545 2.08275 13.9422 2.31963C12.6461 2.16488 11.3406 2.16505 10.0445 2.32014C9.92822 2.08178 9.80478 1.84975 9.67412 1.62413L9.41449 1.17584L8.90333 1.25995C7.33547 1.51794 5.80717 1.99419 4.37748 2.66939L4.19 2.75793L4.07461 2.93019C1.23864 7.16437 0.46302 11.3053 0.838165 15.3924L0.868838 15.7266L1.13844 15.9264C2.81818 17.1714 4.68053 18.1233 6.68582 18.719L7.18892 18.8684L7.50166 18.4469C7.96179 17.8268 8.36504 17.1824 8.709 16.4944L8.71099 16.4904C10.8645 17.0471 13.128 17.0485 15.2821 16.4947C15.6261 17.1826 16.0293 17.8269 16.4892 18.4469L16.805 18.8725L17.3116 18.717C19.3056 18.105 21.1876 17.1751 22.8559 15.9238L23.1224 15.724L23.1528 15.3923C23.5873 10.6524 22.3579 6.53306 19.8947 2.90714L19.7759 2.73227L19.5833 2.64518C18.1437 1.99439 16.6386 1.51826 15.0686 1.25995ZM16.6074 10.7755L16.6074 10.7756C16.5934 11.6409 16.0212 12.1444 15.4783 12.1444C14.9297 12.1444 14.3493 11.6173 14.3493 10.7877C14.3493 9.94885 14.9378 9.41192 15.4783 9.41192C16.0471 9.41192 16.6209 9.93851 16.6074 10.7755ZM8.49373 12.1444C7.94513 12.1444 7.36471 11.6173 7.36471 10.7877C7.36471 9.94885 7.95323 9.41192 8.49373 9.41192C9.06038 9.41192 9.63892 9.93712 9.6417 10.7815C9.62517 11.6239 9.05462 12.1444 8.49373 12.1444Z"
94+
strokeWidth="1.5"
95+
/>
96+
</svg>
97+
),
98+
},
99+
];

0 commit comments

Comments
 (0)