File tree 2 files changed +26
-4
lines changed
2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ import {
14
14
loadLocalModules ,
15
15
loadRemoteModules ,
16
16
} from "./module.js" ;
17
+ // @deno -types="./util.ts"
18
+ import { registerReactDevtoolsHook } from "./util.js" ;
19
+
20
+ registerReactDevtoolsHook ( ) ;
17
21
18
22
await Promise . all ( [ mixin ( INTERNAL_TRANSFORMER ) , loadLocalModules ( ) ] ) ;
19
23
console . time ( "onSpotifyPreInit" ) ;
@@ -22,9 +26,7 @@ console.timeEnd("onSpotifyPreInit");
22
26
23
27
console . time ( "onSpotifyInit" ) ;
24
28
await Promise . all (
25
- [ "/vendor~xpui.js" , "/xpui.js" ] . map ( applyTransforms ) . map ( async ( p ) =>
26
- import ( await p )
27
- ) ,
29
+ [ "/vendor~xpui.js" , "/xpui.js" ] . map ( applyTransforms ) . map ( async ( p ) => import ( await p ) ) ,
28
30
) ;
29
31
console . timeEnd ( "onSpotifyInit" ) ;
30
32
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ export const matchLast = (str: string, pattern: RegExp) => {
46
46
return Array . from ( matches ) . at ( - 1 ) ! ;
47
47
} ;
48
48
49
-
50
49
export function stringifyUrlSearchParams (
51
50
params : Record < string , string | string [ ] > ,
52
51
) {
@@ -62,3 +61,24 @@ export function stringifyUrlSearchParams(
62
61
}
63
62
return searchParams . toString ( ) ;
64
63
}
64
+
65
+ declare global {
66
+ var __REACT_DEVTOOLS_GLOBAL_HOOK__ : {
67
+ isDisabled : boolean ;
68
+ supportsFiber : boolean ;
69
+ inject : ( $ : any ) => void ;
70
+ } ;
71
+ var findHostInstanceByFiber : ( fiber : any ) => any ;
72
+ var findFiberByHostInstance : ( hostInstance : any ) => any ;
73
+ }
74
+
75
+ export function registerReactDevtoolsHook ( ) {
76
+ globalThis [ "__REACT_DEVTOOLS_GLOBAL_HOOK__" ] = {
77
+ isDisabled : false ,
78
+ supportsFiber : true ,
79
+ inject ( $ ) {
80
+ globalThis [ "findHostInstanceByFiber" ] = $ . findHostInstanceByFiber ;
81
+ globalThis [ "findFiberByHostInstance" ] = $ . findFiberByHostInstance ;
82
+ } ,
83
+ } ;
84
+ }
You can’t perform that action at this time.
0 commit comments