bippy 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SMK2GONO.cjs → chunk-AREN6L74.cjs} +7 -26
- package/dist/chunk-EQDYOXOH.js +13 -0
- package/dist/{chunk-6RFLBWUK.js → chunk-Q5GNWPUS.js} +7 -24
- package/dist/chunk-WAO3TF75.cjs +15 -0
- package/dist/core-DkN3hFCY.d.cts +261 -0
- package/dist/core-DkN3hFCY.d.ts +261 -0
- package/dist/core.cjs +57 -57
- package/dist/core.d.cts +3 -195
- package/dist/core.d.ts +3 -195
- package/dist/core.js +1 -1
- package/dist/index.cjs +74 -74
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.global.js +9 -0
- package/dist/index.js +2 -2
- package/dist/inspect.cjs +474 -351
- package/dist/inspect.js +439 -316
- package/dist/sw.cjs +43 -25
- package/dist/sw.js +43 -25
- package/package.json +8 -2
- package/dist/chunk-6TJRMCM3.js +0 -1
- package/dist/chunk-YZYCWAB2.cjs +0 -2
- package/dist/sw.d.cts +0 -69
- package/dist/sw.d.ts +0 -69
- package/dist/sw.global.js +0 -9
package/dist/sw.cjs
CHANGED
|
@@ -9,30 +9,48 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
// src/install-hook-script-string.ts
|
|
13
|
+
var INSTALL_HOOK_SCRIPT_STRING = "(()=>{try{var t=()=>{};const n=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:n,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){var e=++o;return n.set(e,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,e},_instrumentationIsActive:!1,_script:!0}}catch{}})()";
|
|
14
|
+
|
|
12
15
|
// src/sw.ts
|
|
13
|
-
(() =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
hasUnsupportedRendererAttached: false,
|
|
24
|
-
renderers,
|
|
25
|
-
onCommitFiberRoot: NO_OP,
|
|
26
|
-
onCommitFiberUnmount: NO_OP,
|
|
27
|
-
onPostCommitFiberRoot: NO_OP,
|
|
28
|
-
inject(renderer) {
|
|
29
|
-
const nextID = ++id;
|
|
30
|
-
renderers.set(nextID, renderer);
|
|
31
|
-
globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive = true;
|
|
32
|
-
return nextID;
|
|
33
|
-
},
|
|
34
|
-
_instrumentationIsActive: false
|
|
35
|
-
};
|
|
36
|
-
} catch {
|
|
16
|
+
self.addEventListener("install", () => self.skipWaiting());
|
|
17
|
+
self.addEventListener(
|
|
18
|
+
"activate",
|
|
19
|
+
(event) => event.waitUntil(self.clients.claim())
|
|
20
|
+
);
|
|
21
|
+
self.addEventListener("fetch", (event) => {
|
|
22
|
+
const url = event.request.url;
|
|
23
|
+
if (!url.endsWith(".js")) {
|
|
24
|
+
event.respondWith(fetch(event.request));
|
|
25
|
+
return;
|
|
37
26
|
}
|
|
38
|
-
|
|
27
|
+
event.respondWith(
|
|
28
|
+
fetch(event.request.clone(), {
|
|
29
|
+
mode: "cors",
|
|
30
|
+
credentials: "omit",
|
|
31
|
+
headers: { Accept: "*/*" }
|
|
32
|
+
}).then(async (response) => {
|
|
33
|
+
if (!response?.ok || response.type === "opaque") {
|
|
34
|
+
return fetch(event.request);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const text = await response.clone().text();
|
|
38
|
+
const modifiedText = `${INSTALL_HOOK_SCRIPT_STRING}
|
|
39
|
+
${text}`;
|
|
40
|
+
const headers = new Headers(response.headers);
|
|
41
|
+
headers.set("Content-Type", "application/javascript");
|
|
42
|
+
headers.set(
|
|
43
|
+
"Content-Length",
|
|
44
|
+
new TextEncoder().encode(modifiedText).length.toString()
|
|
45
|
+
);
|
|
46
|
+
return new Response(modifiedText, {
|
|
47
|
+
status: response.status,
|
|
48
|
+
statusText: response.statusText,
|
|
49
|
+
headers
|
|
50
|
+
});
|
|
51
|
+
} catch {
|
|
52
|
+
return fetch(event.request);
|
|
53
|
+
}
|
|
54
|
+
}).catch(() => fetch(event.request))
|
|
55
|
+
);
|
|
56
|
+
});
|
package/dist/sw.js
CHANGED
|
@@ -7,30 +7,48 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
// src/install-hook-script-string.ts
|
|
11
|
+
var INSTALL_HOOK_SCRIPT_STRING = "(()=>{try{var t=()=>{};const n=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:n,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){var e=++o;return n.set(e,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,e},_instrumentationIsActive:!1,_script:!0}}catch{}})()";
|
|
12
|
+
|
|
10
13
|
// src/sw.ts
|
|
11
|
-
(() =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
hasUnsupportedRendererAttached: false,
|
|
22
|
-
renderers,
|
|
23
|
-
onCommitFiberRoot: NO_OP,
|
|
24
|
-
onCommitFiberUnmount: NO_OP,
|
|
25
|
-
onPostCommitFiberRoot: NO_OP,
|
|
26
|
-
inject(renderer) {
|
|
27
|
-
const nextID = ++id;
|
|
28
|
-
renderers.set(nextID, renderer);
|
|
29
|
-
globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive = true;
|
|
30
|
-
return nextID;
|
|
31
|
-
},
|
|
32
|
-
_instrumentationIsActive: false
|
|
33
|
-
};
|
|
34
|
-
} catch {
|
|
14
|
+
self.addEventListener("install", () => self.skipWaiting());
|
|
15
|
+
self.addEventListener(
|
|
16
|
+
"activate",
|
|
17
|
+
(event) => event.waitUntil(self.clients.claim())
|
|
18
|
+
);
|
|
19
|
+
self.addEventListener("fetch", (event) => {
|
|
20
|
+
const url = event.request.url;
|
|
21
|
+
if (!url.endsWith(".js")) {
|
|
22
|
+
event.respondWith(fetch(event.request));
|
|
23
|
+
return;
|
|
35
24
|
}
|
|
36
|
-
|
|
25
|
+
event.respondWith(
|
|
26
|
+
fetch(event.request.clone(), {
|
|
27
|
+
mode: "cors",
|
|
28
|
+
credentials: "omit",
|
|
29
|
+
headers: { Accept: "*/*" }
|
|
30
|
+
}).then(async (response) => {
|
|
31
|
+
if (!response?.ok || response.type === "opaque") {
|
|
32
|
+
return fetch(event.request);
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const text = await response.clone().text();
|
|
36
|
+
const modifiedText = `${INSTALL_HOOK_SCRIPT_STRING}
|
|
37
|
+
${text}`;
|
|
38
|
+
const headers = new Headers(response.headers);
|
|
39
|
+
headers.set("Content-Type", "application/javascript");
|
|
40
|
+
headers.set(
|
|
41
|
+
"Content-Length",
|
|
42
|
+
new TextEncoder().encode(modifiedText).length.toString()
|
|
43
|
+
);
|
|
44
|
+
return new Response(modifiedText, {
|
|
45
|
+
status: response.status,
|
|
46
|
+
statusText: response.statusText,
|
|
47
|
+
headers
|
|
48
|
+
});
|
|
49
|
+
} catch {
|
|
50
|
+
return fetch(event.request);
|
|
51
|
+
}
|
|
52
|
+
}).catch(() => fetch(event.request))
|
|
53
|
+
);
|
|
54
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bippy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "hack into react internals",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -75,7 +75,13 @@
|
|
|
75
75
|
"module": "dist/index.js",
|
|
76
76
|
"browser": "dist/index.global.js",
|
|
77
77
|
"types": "dist/index.d.ts",
|
|
78
|
-
"files": [
|
|
78
|
+
"files": [
|
|
79
|
+
"dist",
|
|
80
|
+
"bin",
|
|
81
|
+
"package.json",
|
|
82
|
+
"README.md",
|
|
83
|
+
"LICENSE"
|
|
84
|
+
],
|
|
79
85
|
"scripts": {
|
|
80
86
|
"build": "NODE_ENV=production tsup",
|
|
81
87
|
"dev": "NODE_ENV=development tsup --watch",
|
package/dist/chunk-6TJRMCM3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/dist/chunk-YZYCWAB2.cjs
DELETED
package/dist/sw.d.cts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { FiberRoot, Fiber as Fiber$1, ReactContext, Lanes } from 'react-reconciler';
|
|
2
|
-
|
|
3
|
-
interface ReactDevToolsGlobalHook {
|
|
4
|
-
checkDCE: (fn: unknown) => void;
|
|
5
|
-
supportsFiber: boolean;
|
|
6
|
-
supportsFlight: boolean;
|
|
7
|
-
renderers: Map<number, ReactRenderer>;
|
|
8
|
-
hasUnsupportedRendererAttached: boolean;
|
|
9
|
-
onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: void | number) => void;
|
|
10
|
-
onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
|
|
11
|
-
onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
|
|
12
|
-
inject: (renderer: ReactRenderer) => number;
|
|
13
|
-
_instrumentationSource?: string;
|
|
14
|
-
_instrumentationIsActive?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Represents a react-internal Fiber node.
|
|
18
|
-
*/
|
|
19
|
-
type Fiber<T = any> = Omit<Fiber$1, 'stateNode' | 'dependencies' | 'child' | 'sibling' | 'return' | 'alternate' | 'memoizedProps' | 'pendingProps' | 'memoizedState' | 'updateQueue'> & {
|
|
20
|
-
stateNode: T;
|
|
21
|
-
dependencies: Dependencies | null;
|
|
22
|
-
child: Fiber | null;
|
|
23
|
-
sibling: Fiber | null;
|
|
24
|
-
return: Fiber | null;
|
|
25
|
-
alternate: Fiber | null;
|
|
26
|
-
memoizedProps: Props;
|
|
27
|
-
pendingProps: Props;
|
|
28
|
-
memoizedState: MemoizedState;
|
|
29
|
-
updateQueue: {
|
|
30
|
-
lastEffect: Effect | null;
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
interface ReactRenderer {
|
|
35
|
-
version: string;
|
|
36
|
-
bundleType: 0 | 1;
|
|
37
|
-
findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
|
|
38
|
-
}
|
|
39
|
-
interface ContextDependency<T> {
|
|
40
|
-
context: ReactContext<T>;
|
|
41
|
-
memoizedValue: T;
|
|
42
|
-
observedBits: number;
|
|
43
|
-
next: ContextDependency<unknown> | null;
|
|
44
|
-
}
|
|
45
|
-
interface Dependencies {
|
|
46
|
-
lanes: Lanes;
|
|
47
|
-
firstContext: ContextDependency<unknown> | null;
|
|
48
|
-
}
|
|
49
|
-
interface Effect {
|
|
50
|
-
next: Effect | null;
|
|
51
|
-
create: (...args: unknown[]) => unknown;
|
|
52
|
-
destroy: ((...args: unknown[]) => unknown) | null;
|
|
53
|
-
deps: unknown[] | null;
|
|
54
|
-
tag: number;
|
|
55
|
-
[key: string]: unknown;
|
|
56
|
-
}
|
|
57
|
-
interface MemoizedState {
|
|
58
|
-
memoizedState: unknown;
|
|
59
|
-
next: MemoizedState | null;
|
|
60
|
-
[key: string]: unknown;
|
|
61
|
-
}
|
|
62
|
-
interface Props {
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
}
|
|
65
|
-
declare global {
|
|
66
|
-
var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type { ContextDependency as C, Dependencies as D, Effect as E, Fiber as F, MemoizedState as M, Props as P, ReactDevToolsGlobalHook as R, ReactRenderer as a };
|
package/dist/sw.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { FiberRoot, Fiber as Fiber$1, ReactContext, Lanes } from 'react-reconciler';
|
|
2
|
-
|
|
3
|
-
interface ReactDevToolsGlobalHook {
|
|
4
|
-
checkDCE: (fn: unknown) => void;
|
|
5
|
-
supportsFiber: boolean;
|
|
6
|
-
supportsFlight: boolean;
|
|
7
|
-
renderers: Map<number, ReactRenderer>;
|
|
8
|
-
hasUnsupportedRendererAttached: boolean;
|
|
9
|
-
onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: void | number) => void;
|
|
10
|
-
onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
|
|
11
|
-
onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
|
|
12
|
-
inject: (renderer: ReactRenderer) => number;
|
|
13
|
-
_instrumentationSource?: string;
|
|
14
|
-
_instrumentationIsActive?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Represents a react-internal Fiber node.
|
|
18
|
-
*/
|
|
19
|
-
type Fiber<T = any> = Omit<Fiber$1, 'stateNode' | 'dependencies' | 'child' | 'sibling' | 'return' | 'alternate' | 'memoizedProps' | 'pendingProps' | 'memoizedState' | 'updateQueue'> & {
|
|
20
|
-
stateNode: T;
|
|
21
|
-
dependencies: Dependencies | null;
|
|
22
|
-
child: Fiber | null;
|
|
23
|
-
sibling: Fiber | null;
|
|
24
|
-
return: Fiber | null;
|
|
25
|
-
alternate: Fiber | null;
|
|
26
|
-
memoizedProps: Props;
|
|
27
|
-
pendingProps: Props;
|
|
28
|
-
memoizedState: MemoizedState;
|
|
29
|
-
updateQueue: {
|
|
30
|
-
lastEffect: Effect | null;
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
interface ReactRenderer {
|
|
35
|
-
version: string;
|
|
36
|
-
bundleType: 0 | 1;
|
|
37
|
-
findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
|
|
38
|
-
}
|
|
39
|
-
interface ContextDependency<T> {
|
|
40
|
-
context: ReactContext<T>;
|
|
41
|
-
memoizedValue: T;
|
|
42
|
-
observedBits: number;
|
|
43
|
-
next: ContextDependency<unknown> | null;
|
|
44
|
-
}
|
|
45
|
-
interface Dependencies {
|
|
46
|
-
lanes: Lanes;
|
|
47
|
-
firstContext: ContextDependency<unknown> | null;
|
|
48
|
-
}
|
|
49
|
-
interface Effect {
|
|
50
|
-
next: Effect | null;
|
|
51
|
-
create: (...args: unknown[]) => unknown;
|
|
52
|
-
destroy: ((...args: unknown[]) => unknown) | null;
|
|
53
|
-
deps: unknown[] | null;
|
|
54
|
-
tag: number;
|
|
55
|
-
[key: string]: unknown;
|
|
56
|
-
}
|
|
57
|
-
interface MemoizedState {
|
|
58
|
-
memoizedState: unknown;
|
|
59
|
-
next: MemoizedState | null;
|
|
60
|
-
[key: string]: unknown;
|
|
61
|
-
}
|
|
62
|
-
interface Props {
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
}
|
|
65
|
-
declare global {
|
|
66
|
-
var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type { ContextDependency as C, Dependencies as D, Effect as E, Fiber as F, MemoizedState as M, Props as P, ReactDevToolsGlobalHook as R, ReactRenderer as a };
|
package/dist/sw.global.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
!function(){"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license bippy
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Aiden Bai, Million Software, Inc.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/(()=>{try{const t=()=>{},e=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:e,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){const n=++o;return e.set(n,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,n},_instrumentationIsActive:!1}}catch{}})()}();
|