Skip to content

Commit c522826

Browse files
committed
readme update
1 parent 63bfe17 commit c522826

2 files changed

Lines changed: 33 additions & 45 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<center>
2-
<img src="./assets/remix-dev-tools.png" align="middle" width="160" height="160" alt="Remix Development Tools" />
2+
<img src="./assets/remix-dev-tools.png" style="display: block; margin: 0 auto;" align="middle" width="160" height="160" alt="Remix Development Tools" />
33
</center>
44

55
# Remix Development Tools

src/RemixDevTools/init/project.tsx

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,19 @@ import { EntryContext } from "@remix-run/server-runtime";
22
import clsx from "clsx";
33

44
export const InvisibleBoundary = ({ path }: { path: string }) => {
5-
return (
6-
<div
7-
className={clsx(
8-
"rdt-invisible rdt-absolute rdt-hidden rdt-h-0 rdt-w-0",
9-
path
10-
)}
11-
/>
12-
);
5+
return <div className={clsx("rdt-invisible rdt-absolute rdt-hidden rdt-h-0 rdt-w-0", path)} />;
136
};
147

158
export const initServer = (context: EntryContext) => {
169
return {
1710
...context,
18-
routeModules: Object.entries(context.routeModules).reduce(
19-
(acc, [key, value]) => {
20-
if (key === "root") {
21-
return {
22-
...acc,
23-
[key]: value,
24-
};
25-
}
26-
return {
27-
...acc,
28-
[key]: {
29-
...value,
30-
default: () => {
31-
return (
32-
<>
33-
<InvisibleBoundary path={key} />
34-
<value.default />
35-
</>
36-
);
37-
},
38-
},
39-
};
40-
},
41-
{}
42-
),
43-
};
44-
};
45-
46-
export const initClient = () => {
47-
window.__remixRouteModules = Object.keys(window.__remixRouteModules).reduce(
48-
(acc, key) => {
49-
const value = window.__remixRouteModules[key];
11+
routeModules: Object.entries(context.routeModules).reduce((acc, [key, value]) => {
5012
if (key === "root") {
5113
return {
5214
...acc,
5315
[key]: value,
5416
};
5517
}
56-
5718
return {
5819
...acc,
5920
[key]: {
@@ -68,9 +29,36 @@ export const initClient = () => {
6829
},
6930
},
7031
};
71-
},
72-
{}
73-
);
32+
}, {}),
33+
};
34+
};
35+
36+
export const initClient = () => {
37+
window.__remixRouteModules = Object.keys(window.__remixRouteModules).reduce((acc, key) => {
38+
const value = window.__remixRouteModules[key];
39+
40+
if (key === "root") {
41+
return {
42+
...acc,
43+
[key]: value,
44+
};
45+
}
46+
47+
return {
48+
...acc,
49+
[key]: {
50+
...value,
51+
default: () => {
52+
return (
53+
<>
54+
<InvisibleBoundary path={key} />
55+
<value.default />
56+
</>
57+
);
58+
},
59+
},
60+
};
61+
}, {});
7462
};
7563

7664
// Graveyard of failed attempts

0 commit comments

Comments
 (0)