Skip to content

Commit 0265aed

Browse files
committed
fix: add JSON serialization and enhanced data handling
- Add superjson dependency for robust serialization - Create JsonViewer and ValueEditor components for better data display - Implement custom serialization utilities with fallback handling - Add theme hook for consistent UI styling - Enhance query and mutation explorers with improved data visualization - Update injected script to serialize payloads before messaging fixes BigInt serialization #1
1 parent 16c9c54 commit 0265aed

23 files changed

Lines changed: 935 additions & 207 deletions

.clinerules

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Cline's Memory Bank
2+
3+
I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
4+
5+
## Memory Bank Structure
6+
7+
The Memory Bank consists of core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
8+
9+
flowchart TD
10+
PB[projectbrief.md] --> PC[productContext.md]
11+
PB --> SP[systemPatterns.md]
12+
PB --> TC[techContext.md]
13+
14+
PC --> AC[activeContext.md]
15+
SP --> AC
16+
TC --> AC
17+
18+
AC --> P[progress.md]
19+
20+
### Core Files (Required)
21+
1. `projectbrief.md`
22+
- Foundation document that shapes all other files
23+
- Created at project start if it doesn't exist
24+
- Defines core requirements and goals
25+
- Source of truth for project scope
26+
27+
2. `productContext.md`
28+
- Why this project exists
29+
- Problems it solves
30+
- How it should work
31+
- User experience goals
32+
33+
3. `activeContext.md`
34+
- Current work focus
35+
- Recent changes
36+
- Next steps
37+
- Active decisions and considerations
38+
- Important patterns and preferences
39+
- Learnings and project insights
40+
41+
4. `systemPatterns.md`
42+
- System architecture
43+
- Key technical decisions
44+
- Design patterns in use
45+
- Component relationships
46+
- Critical implementation paths
47+
48+
5. `techContext.md`
49+
- Technologies used
50+
- Development setup
51+
- Technical constraints
52+
- Dependencies
53+
- Tool usage patterns
54+
55+
6. `progress.md`
56+
- What works
57+
- What's left to build
58+
- Current status
59+
- Known issues
60+
- Evolution of project decisions
61+
62+
### Additional Context
63+
Create additional files/folders within memory-bank/ when they help organize:
64+
- Complex feature documentation
65+
- Integration specifications
66+
- API documentation
67+
- Testing strategies
68+
- Deployment procedures
69+
70+
## Core Workflows
71+
72+
### Plan Mode
73+
flowchart TD
74+
Start[Start] --> ReadFiles[Read Memory Bank]
75+
ReadFiles --> CheckFiles{Files Complete?}
76+
77+
CheckFiles -->|No| Plan[Create Plan]
78+
Plan --> Document[Document in Chat]
79+
80+
CheckFiles -->|Yes| Verify[Verify Context]
81+
Verify --> Strategy[Develop Strategy]
82+
Strategy --> Present[Present Approach]
83+
84+
### Act Mode
85+
flowchart TD
86+
Start[Start] --> Context[Check Memory Bank]
87+
Context --> Update[Update Documentation]
88+
Update --> Execute[Execute Task]
89+
Execute --> Document[Document Changes]
90+
91+
## Documentation Updates
92+
93+
Memory Bank updates occur when:
94+
1. Discovering new project patterns
95+
2. After implementing significant changes
96+
3. When user requests with **update memory bank** (MUST review ALL files)
97+
4. When context needs clarification
98+
99+
flowchart TD
100+
Start[Update Process]
101+
102+
subgraph Process
103+
P1[Review ALL Files]
104+
P2[Document Current State]
105+
P3[Clarify Next Steps]
106+
P4[Document Insights & Patterns]
107+
108+
P1 --> P2 --> P3 --> P4
109+
end
110+
111+
Start --> Process
112+
113+
Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.
114+
115+
REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,3 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25-
26-
memory-bank
27-
.clinerules

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "memory-bank"]
2+
path = memory-bank
3+
url = git@github.com:DeeCode-inc/tanstack-query-chrome-devtools-memory-bank.git

memory-bank

Submodule memory-bank added at 9f6fcac

package-lock.json

Lines changed: 41 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build",
8+
"build": "vite build && vite build --mode injected",
99
"lint": "eslint .",
1010
"preview": "vite preview",
1111
"prettier:format": "prettier --write .",
1212
"prettier:check": "prettier --check .",
1313
"prepare": "husky"
1414
},
1515
"dependencies": {
16-
"@microlink/react-json-view": "^1.26.2",
1716
"@tanstack/query-core": "^5.80.2",
1817
"class-variance-authority": "^0.7.1",
1918
"clsx": "^2.1.1",
2019
"highlight.js": "^11.11.1",
2120
"lucide-react": "^0.522.0",
2221
"react": "^19.1.0",
23-
"react-dom": "^19.1.0"
22+
"react-dom": "^19.1.0",
23+
"superjson": "^2.2.2"
2424
},
2525
"devDependencies": {
2626
"@eslint/js": "^9.25.0",

src/App.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function App() {
2121
artificialStates,
2222
sendMessage,
2323
} = useConnection();
24-
const { isDarkMode, handleQueryAction } = useUIState(sendMessage);
24+
const { handleQueryAction } = useUIState(sendMessage);
2525
const {
2626
currentView,
2727
searchTerm,
@@ -95,7 +95,6 @@ function App() {
9595
: null
9696
}
9797
onAction={handleQueryAction}
98-
isDarkMode={isDarkMode}
9998
artificialStates={artificialStates}
10099
/>
101100
) : (
@@ -105,7 +104,6 @@ function App() {
105104
? mutations[selectedMutationIndex]
106105
: null
107106
}
108-
isDarkMode={isDarkMode}
109107
/>
110108
)
111109
}

src/components/common/DataExplorer.tsx

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { useState, useEffect } from "react";
2-
import JsonView, { type InteractionProps } from "@microlink/react-json-view";
2+
import { JsonViewer } from "./JsonViewer";
33

44
interface DataExplorerProps {
55
data?: unknown;
66
error?: unknown;
7-
isDarkMode: boolean;
87
title: string;
98
emptyMessage?: string;
10-
onEdit?: (edit: InteractionProps) => void;
9+
onEdit?: (newData: unknown) => void;
10+
readonly?: boolean;
1111
}
1212

1313
export function DataExplorer({
1414
data,
1515
error,
16-
isDarkMode,
1716
title,
1817
emptyMessage = "No data available",
1918
onEdit,
19+
readonly,
2020
}: DataExplorerProps) {
2121
const [isContentEntering, setIsContentEntering] = useState(false);
2222
const [hasDataLoaded, setHasDataLoaded] = useState(false);
@@ -40,38 +40,16 @@ export function DataExplorer({
4040
className={`bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded p-3 ${isContentEntering ? "content-enter" : ""}`}
4141
>
4242
{data !== undefined && data !== null ? (
43-
<JsonView
44-
src={data}
43+
<JsonViewer
44+
data={data}
4545
collapsed={1}
46-
displayDataTypes={false}
47-
displayObjectSize={true}
48-
enableClipboard={true}
4946
onEdit={onEdit}
50-
onAdd={onEdit}
51-
onDelete={onEdit}
52-
theme={isDarkMode ? "monokai" : "rjv-default"}
53-
style={{
54-
fontSize: "12px",
55-
fontFamily: "monospace",
56-
backgroundColor: "transparent",
57-
}}
47+
readonly={readonly}
5848
/>
5949
) : error ? (
6050
<div className="text-red-600 dark:text-red-400 text-sm">
6151
<div className="font-medium mb-2">Error occurred:</div>
62-
<JsonView
63-
src={error}
64-
collapsed={1}
65-
displayDataTypes={false}
66-
displayObjectSize={true}
67-
enableClipboard={true}
68-
theme={isDarkMode ? "monokai" : "rjv-default"}
69-
style={{
70-
fontSize: "12px",
71-
fontFamily: "monospace",
72-
backgroundColor: "transparent",
73-
}}
74-
/>
52+
<JsonViewer data={error} collapsed={1} />
7553
</div>
7654
) : (
7755
<div className="text-gray-500 dark:text-gray-400 text-sm italic">

0 commit comments

Comments
 (0)