MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / attach_debugger

Function attach_debugger

extension/src/real_world.ts:75–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74
75async function attach_debugger() {
76
77 let debug = await import('@solid-devtools/debugger')
78
79 const instance = debug.useDebugger()
80
81 /* Check versions */
82 warn_on_version_mismatch(instance.versions.get_client(),
83 import.meta.env.EXPECTED_CLIENT,
84 'solid-devtools')
85
86 warn_on_version_mismatch(instance.versions.get_solid(),
87 instance.versions.get_expected_solid(),
88 'solid-js')
89
90 // in case of navigation/page reload, reset the locator mode state in the extension
91 window_post_message('ResetPanel', undefined)
92 window_post_message('Debugger_Connected', {
93 client: instance.versions.get_client(),
94 solid: instance.versions.get_solid(),
95 })
96
97 /* From Content */
98 window_on_message(e => {
99 // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
100 switch (e.kind) {
101 case 'DevtoolsOpened':
102 instance.toggleEnabled(e.data)
103 break
104 default:
105 /* Content -> Debugger */
106 instance.emit(e as any)
107 }
108 })
109
110 /* Debugger -> Content */
111 instance.listen(window_post_message_obj)
112}
113
114
115class Version {

Callers 1

update_detectedFunction · 0.85

Calls 3

window_post_messageFunction · 0.90
window_on_messageFunction · 0.90
warn_on_version_mismatchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…