Skip to content

Commit c63acd3

Browse files
committed
DTS improvements + small bug fix
1 parent 19730d3 commit c63acd3

4 files changed

Lines changed: 29 additions & 30 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "remix-development-tools",
33
"description": "Remix development tools.",
44
"author": "Alem Tuzlak",
5-
"version": "2.1.1",
5+
"version": "2.1.2",
66
"license": "MIT",
77
"keywords": [
88
"remix",

src/RemixDevTools/RemixDevTools.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ import rdtStylesheet from "../input.css?inline";
1212
import { useOutletAugment } from "./hooks/useOutletAugment";
1313
import { useResetDetachmentCheck } from "./hooks/detached/useResetDetachmentCheck";
1414
import { useSetRouteBoundaries } from "./hooks/useSetRouteBoundaries";
15-
import { REMIX_DEV_TOOLS } from "./utils/storage";
15+
import {
16+
REMIX_DEV_TOOLS,
17+
REMIX_DEV_TOOLS_DETACHED_OWNER,
18+
REMIX_DEV_TOOLS_IS_DETACHED,
19+
setSessionItem,
20+
setStorageItem,
21+
} from "./utils/storage";
1622
import { useSyncStateWhenDetached } from "./hooks/detached/useSyncStateWhenDetached";
1723

1824
const InjectedStyles = () => <style dangerouslySetInnerHTML={{ __html: rdtStylesheet }} />;
@@ -23,7 +29,7 @@ const RemixDevTools = ({ plugins }: RemixDevToolsProps) => {
2329
useResetDetachmentCheck();
2430
useSetRouteBoundaries();
2531
useSyncStateWhenDetached();
26-
const { detachedWindowOwner, isDetached } = useDetachedWindowControls();
32+
const { detachedWindowOwner, isDetached, setDetachedWindowOwner } = useDetachedWindowControls();
2733
const { settings } = useSettingsContext();
2834
const { persistOpen } = usePersistOpen();
2935
const { position } = settings;
@@ -32,7 +38,18 @@ const RemixDevTools = ({ plugins }: RemixDevToolsProps) => {
3238

3339
// If the dev tools are detached, we don't want to render the main panel
3440
if (detachedWindowOwner) {
35-
return null;
41+
return (
42+
<div id={REMIX_DEV_TOOLS} className="remix-dev-tools">
43+
<Trigger
44+
isOpen={false}
45+
setIsOpen={() => {
46+
setDetachedWindowOwner(false);
47+
setStorageItem(REMIX_DEV_TOOLS_IS_DETACHED, "false");
48+
setSessionItem(REMIX_DEV_TOOLS_DETACHED_OWNER, "false");
49+
}}
50+
/>
51+
</div>
52+
);
3653
}
3754

3855
return (

src/RemixDevTools/hooks/detached/useCheckIfStillDetached.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const useCheckIfStillDetached = () => {
4444

4545
// If the detached window is unloaded we want to check if it is still there
4646
if (shouldCheckDetached && !checking) {
47-
setTimeout(() => setChecking(true), 50);
47+
setTimeout(() => setChecking(true), 200);
4848
}
4949
},
5050
[checking]

vite.config.ts

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,14 @@ export default defineConfig({
88
{
99
...ts2({
1010
check: true,
11-
exclude: [
12-
"**/__tests__/**",
13-
"**/__mocks__/**",
14-
"**/*.test.ts",
15-
"**/*.test.tsx",
16-
"**/*.config.ts",
17-
"**/env.ts",
18-
"**/components/**",
19-
"**/context/**",
20-
"**/hooks/detached/**",
21-
"**/hooks/useOutletAugment.tsx",
22-
"**/hooks/useHorizontalScroll.ts",
23-
"**/hooks/useAttachListener.ts",
24-
"**/hooks/useDebounce.ts",
25-
"**/hooks/useSetRouteBoundaries.ts",
26-
"**/hooks/useResize.ts",
27-
"**/hooks/useTabs.ts",
28-
"**/hooks/useTerminalShortcuts.ts",
29-
"**/hooks/useTimelineHandler.ts",
30-
"**/tabs/**",
31-
"**/utils/**",
32-
"**/remix-app-for-testing/**",
33-
"**/monitor/**",
34-
"**/layout/**",
11+
include: [
12+
"**/RemixDevTools/RemixDevTools.tsx",
13+
"**/RemixDevTools/index.ts",
14+
"**/src/index.ts",
15+
"**/hooks/useRemixForgeSocket.ts",
16+
"**/tabs/index.tsx",
17+
"**/init/project.tsx",
3518
],
36-
3719
tsconfig: resolve(__dirname, `tsconfig.json`),
3820
tsconfigOverride: {
3921
compilerOptions: {

0 commit comments

Comments
 (0)