@@ -71,25 +71,20 @@ export function initializeDbDevtools(): void {
71
71
// Create the registry directly without importing SolidJS code to avoid SSR issues
72
72
try {
73
73
// Import and call the core initialization asynchronously, but ensure registry exists first
74
- const registryPromise = import ( '@tanstack/db-devtools' ) . then ( ( module ) => {
75
- console . log ( 'DbDevtools: Core devtools module loaded' )
74
+ import ( '@tanstack/db-devtools' ) . then ( ( module ) => {
76
75
module . initializeDbDevtools ( )
77
- console . log ( 'DbDevtools: Core initialization complete' )
78
76
} ) . catch ( ( error ) => {
79
77
console . warn ( 'DbDevtools: Failed to load core devtools module:' , error )
80
78
} )
81
79
82
80
// Create immediate registry that works with the SolidJS UI while core loads
83
81
if ( ! ( window as any ) . __TANSTACK_DB_DEVTOOLS__ ) {
84
- console . log ( 'DbDevtools: Creating immediate registry...' )
85
82
86
83
const collections = new Map ( )
87
84
88
85
const registry = {
89
86
collections,
90
87
registerCollection : ( collection : any ) => {
91
- console . log ( 'DbDevtools: Registering collection:' , collection . id )
92
-
93
88
const metadata = {
94
89
id : collection . id ,
95
90
type : collection . id . startsWith ( 'live-query-' ) ? 'live-query' : 'collection' ,
@@ -112,8 +107,6 @@ export function initializeDbDevtools(): void {
112
107
}
113
108
114
109
collections . set ( collection . id , entry )
115
- console . log ( 'DbDevtools: Collection registered successfully:' , collection . id )
116
- console . log ( 'DbDevtools: Total collections now:' , collections . size )
117
110
} ,
118
111
unregisterCollection : ( id : string ) => {
119
112
collections . delete ( id )
@@ -135,10 +128,8 @@ export function initializeDbDevtools(): void {
135
128
return { ...entry . metadata }
136
129
} ,
137
130
getAllCollectionMetadata : ( ) => {
138
- console . log ( 'DbDevtools: getAllCollectionMetadata called, total collections:' , collections . size )
139
-
140
131
const results = [ ]
141
- for ( const [ id , entry ] of collections ) {
132
+ for ( const [ , entry ] of collections ) {
142
133
const collection = entry . weakRef . deref ( )
143
134
if ( collection ) {
144
135
// Collection is still alive, update metadata
@@ -148,22 +139,14 @@ export function initializeDbDevtools(): void {
148
139
entry . metadata . transactionCount = collection . transactions ?. size || 0
149
140
entry . metadata . lastUpdated = new Date ( )
150
141
results . push ( { ...entry . metadata } )
151
- console . log ( 'DbDevtools: Found live collection:' , {
152
- id,
153
- status : collection . status ,
154
- size : collection . size ,
155
- type : entry . metadata . type
156
- } )
157
142
} else {
158
143
// Collection was garbage collected
159
144
entry . metadata . status = 'cleaned-up'
160
145
entry . metadata . lastUpdated = new Date ( )
161
146
results . push ( { ...entry . metadata } )
162
- console . log ( 'DbDevtools: Found GC\'d collection:' , id )
163
147
}
164
148
}
165
149
166
- console . log ( 'DbDevtools: Returning metadata for' , results . length , 'collections' )
167
150
return results
168
151
} ,
169
152
getCollection : ( id : string ) => {
@@ -209,7 +192,6 @@ export function initializeDbDevtools(): void {
209
192
210
193
// Set up the registry on window
211
194
; ( window as any ) . __TANSTACK_DB_DEVTOOLS__ = registry
212
- console . log ( 'DbDevtools: Registry created successfully' )
213
195
}
214
196
215
197
// Set up automatic collection registration
@@ -221,16 +203,13 @@ export function initializeDbDevtools(): void {
221
203
}
222
204
}
223
205
}
224
-
225
- console . log ( 'DbDevtools: Initialization complete' )
226
206
} catch ( error ) {
227
207
console . warn ( 'DbDevtools: Failed to initialize devtools:' , error )
228
208
229
209
// Final fallback: set up a basic registration function so collections don't fail
230
210
if ( ! ( window as any ) . __TANSTACK_DB_DEVTOOLS_REGISTER__ ) {
231
- console . log ( 'DbDevtools: Setting up fallback registration function...' )
232
211
; ( window as any ) . __TANSTACK_DB_DEVTOOLS_REGISTER__ = ( collection : any ) => {
233
- console . log ( 'DbDevtools: Fallback - collection registered:' , collection . id )
212
+ // Silent fallback registration
234
213
}
235
214
}
236
215
}
0 commit comments