@gjsify/perf_hooks 0.4.35 → 0.4.37
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/globals.mjs +23 -0
- package/package.json +26 -9
package/globals.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports native Performance API globals for browser builds.
|
|
3
|
+
*
|
|
4
|
+
* On browsers, `performance` is a global instance of `Performance` exposing
|
|
5
|
+
* `now()`, `mark()`, `measure()`, `clearMarks()`, `clearMeasures()`, plus
|
|
6
|
+
* `PerformanceObserver`. Universal since Chrome 6 / Firefox 7 / Safari 8.
|
|
7
|
+
*
|
|
8
|
+
* The dynamic resolver in `@gjsify/resolve-npm/runtime-aliases.mjs` routes
|
|
9
|
+
* `@gjsify/perf_hooks` here when `package.json#gjsify.runtimes.browser === "native"`.
|
|
10
|
+
*
|
|
11
|
+
* NOT used on Node — Node's `node:perf_hooks` exposes a much richer
|
|
12
|
+
* surface (`PerformanceObserver`, `monitorEventLoopDelay`, `createHistogram`,
|
|
13
|
+
* `eventLoopUtilization`, etc.) that has no browser pendant. Node target
|
|
14
|
+
* keeps the polyfill (`runtimes.node === "polyfill"`).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const performance = globalThis.performance;
|
|
18
|
+
export const PerformanceObserver = globalThis.PerformanceObserver;
|
|
19
|
+
export const PerformanceEntry = globalThis.PerformanceEntry;
|
|
20
|
+
export const PerformanceMark = globalThis.PerformanceMark;
|
|
21
|
+
export const PerformanceMeasure = globalThis.PerformanceMeasure;
|
|
22
|
+
export const PerformanceResourceTiming = globalThis.PerformanceResourceTiming;
|
|
23
|
+
export default { performance, PerformanceObserver, PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceResourceTiming };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/perf_hooks",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "Node.js perf_hooks module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -9,10 +9,15 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./lib/types/index.d.ts",
|
|
11
11
|
"default": "./lib/esm/index.js"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"./globals": "./globals.mjs"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
|
-
"lib"
|
|
16
|
+
"lib",
|
|
17
|
+
"globals.mjs"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"./globals.mjs"
|
|
16
21
|
],
|
|
17
22
|
"scripts": {
|
|
18
23
|
"clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
|
|
@@ -23,6 +28,7 @@
|
|
|
23
28
|
"build:test": "gjsify run build:test:gjs && gjsify run build:test:node",
|
|
24
29
|
"build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
|
|
25
30
|
"build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
|
|
31
|
+
"build:test:browser": "gjsify build src/test.browser.mts --app browser --outfile dist/test.browser.mjs",
|
|
26
32
|
"test": "gjsify run build:gjsify && gjsify run build:test && gjsify run test:node && gjsify run test:gjs",
|
|
27
33
|
"test:gjs": "gjsify run test.gjs.mjs",
|
|
28
34
|
"test:node": "node test.node.mjs"
|
|
@@ -33,16 +39,27 @@
|
|
|
33
39
|
"perf_hooks"
|
|
34
40
|
],
|
|
35
41
|
"devDependencies": {
|
|
36
|
-
"@gjsify/cli": "^0.4.
|
|
37
|
-
"@gjsify/unit": "^0.4.
|
|
42
|
+
"@gjsify/cli": "^0.4.37",
|
|
43
|
+
"@gjsify/unit": "^0.4.37",
|
|
38
44
|
"@types/node": "^25.9.1",
|
|
39
|
-
"typescript": "^
|
|
45
|
+
"typescript": "^5.9.3"
|
|
40
46
|
},
|
|
41
47
|
"gjsify": {
|
|
42
48
|
"runtimes": {
|
|
43
49
|
"gjs": "polyfill",
|
|
44
|
-
"node": "
|
|
45
|
-
"browser": "
|
|
50
|
+
"node": "native",
|
|
51
|
+
"browser": "native",
|
|
52
|
+
"nativescript": "none"
|
|
46
53
|
}
|
|
47
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/gjsify/gjsify.git",
|
|
59
|
+
"directory": "packages/node/perf_hooks"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/gjsify/gjsify/issues"
|
|
63
|
+
},
|
|
64
|
+
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/node/perf_hooks#readme"
|
|
48
65
|
}
|