@ashokreddydev/react-performance-monitor 0.1.0 → 0.1.2
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/CHANGELOG.md +15 -0
- package/README.md +87 -46
- package/dist/{PerformancePanel-U3KTU2BT.cjs → PerformancePanel-7AYCIEG6.cjs} +10 -10
- package/dist/{PerformancePanel-6LHWD52Q.js → PerformancePanel-TNVY6W3W.js} +7 -7
- package/dist/axios.cjs +3 -3
- package/dist/axios.js +2 -2
- package/dist/{chunk-UPMG6KIA.cjs → chunk-5AT7Z32E.cjs} +11 -11
- package/dist/{chunk-YUN5C27A.js → chunk-B5MOQKKB.js} +5 -5
- package/dist/{chunk-VVPPYDOB.js → chunk-EMWBXP4Q.js} +5 -5
- package/dist/{chunk-LY4JO6PL.js → chunk-ICEGTP6M.js} +3 -3
- package/dist/{chunk-K4P4CBNG.cjs → chunk-MQZLO62L.cjs} +12 -12
- package/dist/{chunk-VAQESCDW.cjs → chunk-MYCOS5WD.cjs} +4 -4
- package/dist/{chunk-Q55RPWQK.cjs → chunk-QUF75EA3.cjs} +2 -2
- package/dist/{chunk-AETFDOCD.js → chunk-UGDPZ343.js} +2 -2
- package/dist/{chunk-5TDZ2PFD.js → chunk-XKYIKK6C.js} +2 -2
- package/dist/{chunk-DOY37SMY.cjs → chunk-ZY43XLHK.cjs} +2 -2
- package/dist/index.cjs +45 -45
- package/dist/index.js +8 -8
- package/dist/redux.cjs +5 -5
- package/dist/redux.js +3 -3
- package/dist/trackora.cjs +2 -2
- package/dist/trackora.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @ashokreddydev/react-performance-monitor
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Clearer README: a numbered quick start (install, get your keys, set up, check it works), a step-by-step guide to
|
|
8
|
+
creating the app and ingestion keys in the Trackora dashboard, and tidier option tables. Type comments use neutral
|
|
9
|
+
examples.
|
|
10
|
+
|
|
11
|
+
## 0.1.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 8e870e2: npm page: the Homepage link now opens the SDK documentation on the Trackora website, and the README starts with a
|
|
16
|
+
link to it.
|
|
17
|
+
|
|
3
18
|
## 0.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,69 +1,66 @@
|
|
|
1
|
-
# react-performance-monitor
|
|
1
|
+
# @ashokreddydev/react-performance-monitor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> See what makes a React app slow — component render times, API latency and Core Web Vitals from real sessions, with
|
|
4
|
+
> a floating developer panel.
|
|
4
5
|
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
- **long tasks, navigation and resource timing**, plus memory where the browser supports it
|
|
10
|
-
- **uncaught errors**
|
|
6
|
+
[](https://www.npmjs.com/package/@ashokreddydev/react-performance-monitor)
|
|
7
|
+
[](https://www.npmjs.com/package/@ashokreddydev/react-performance-monitor)
|
|
8
|
+

|
|
9
|
+

|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
**[Website & docs](https://www.trackora.testforge.co.in/docs#react-performance-monitor)** ·
|
|
12
|
+
[All three Trackora SDKs](https://www.trackora.testforge.co.in/docs) ·
|
|
13
|
+
[Changelog](./CHANGELOG.md)
|
|
14
14
|
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
-
- **
|
|
18
|
-
|
|
19
|
-
- **
|
|
20
|
-
|
|
15
|
+
- ⚛️ **Components** — Render times from React's Profiler, per boundary you choose
|
|
16
|
+
- 🌐 **API latency** — `fetch`, XHR and Axios — p50 / p95 / p99 per endpoint template
|
|
17
|
+
- 📊 **Web Vitals** — LCP, INP, CLS, FCP and TTFB
|
|
18
|
+
- 🧩 **More** — Redux action timing, long tasks, navigation and resource timing, memory (where supported), uncaught errors
|
|
19
|
+
- 🛟 **Safe** — Never throws into your app; bounded memory and retries; unsampled sessions do no work
|
|
20
|
+
- 🔒 **Private** — Never reads headers, cookies, bodies or Redux state; URLs become templates (`/users/:id`)
|
|
21
|
+
- 🎯 **No extra re-renders** — The provider's context never changes; live metrics update at most twice a second
|
|
22
|
+
|
|
23
|
+
Sends to **Trackora** with `trackoraTransport()`, or to **any backend** — give it an HTTP endpoint or your own
|
|
24
|
+
transport.
|
|
21
25
|
|
|
22
26
|
> Status: 0.x — the API may still change in minor versions.
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
---
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
[Developer panel](#developer-panel) · [Redux](#redux) · [Axios](#axios) · [Hooks](#hooks) · [Delivery](#delivery) ·
|
|
28
|
-
[Privacy](#privacy) · [Performance overhead](#performance-overhead) · [Production checklist](#production-checklist) ·
|
|
29
|
-
[Troubleshooting](#troubleshooting) · [Custom collectors](#custom-collectors)
|
|
30
|
+
## Quick start
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
**1. Install** — needs React 18 or newer (`web-vitals` comes with it):
|
|
32
33
|
|
|
33
34
|
```bash
|
|
34
35
|
npm install @ashokreddydev/react-performance-monitor
|
|
35
|
-
# optional
|
|
36
|
-
npm install echarts
|
|
36
|
+
npm install echarts # optional: charts in the developer panel
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
**2. Get your key** — the same ingestion key as the Analytics SDK
|
|
40
|
+
([Get your keys](#get-your-keys-in-the-trackora-dashboard) below), in one `.env` file per environment:
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| `…/axios` | `instrumentAxios(instance, monitor)` |
|
|
47
|
-
| `…/charts` | ECharts charts for the panel (needs `echarts`) |
|
|
48
|
-
| `…/trackora` | `trackoraTransport()` for a Trackora server |
|
|
49
|
-
|
|
50
|
-
ESM and CommonJS builds ship with TypeScript declarations. The package works in JavaScript and TypeScript apps and
|
|
51
|
-
is tree-shakeable (`sideEffects: false`).
|
|
42
|
+
```ini
|
|
43
|
+
VITE_TRACKORA_ENDPOINT=https://trackora.example.com
|
|
44
|
+
VITE_TRACKORA_KEY=trk_dev_… # trk_live_… in production
|
|
45
|
+
```
|
|
52
46
|
|
|
53
|
-
|
|
47
|
+
**3. Wrap your app:**
|
|
54
48
|
|
|
55
49
|
```tsx
|
|
56
50
|
import { PerformanceButton, PerformanceProvider, ProfiledBoundary } from '@ashokreddydev/react-performance-monitor';
|
|
51
|
+
import { trackoraTransport } from '@ashokreddydev/react-performance-monitor/trackora';
|
|
57
52
|
|
|
58
53
|
export function Root() {
|
|
59
54
|
return (
|
|
60
55
|
<PerformanceProvider
|
|
61
56
|
config={{
|
|
62
57
|
applicationId: 'my-app',
|
|
63
|
-
environment: import.meta.env.MODE,
|
|
64
|
-
sampleRate: 0.2, // 20 % of sessions send telemetry
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
environment: import.meta.env.MODE, // 'production' turns off the dev-only features
|
|
59
|
+
sampleRate: 0.2, // 20 % of sessions send telemetry (use 1 while testing)
|
|
60
|
+
transport: trackoraTransport({
|
|
61
|
+
apiUrl: import.meta.env.VITE_TRACKORA_ENDPOINT,
|
|
62
|
+
apiKey: import.meta.env.VITE_TRACKORA_KEY,
|
|
63
|
+
}),
|
|
67
64
|
}}
|
|
68
65
|
>
|
|
69
66
|
<ProfiledBoundary id="App">
|
|
@@ -75,8 +72,40 @@ export function Root() {
|
|
|
75
72
|
}
|
|
76
73
|
```
|
|
77
74
|
|
|
78
|
-
The provider reads `config` once, on the first render
|
|
79
|
-
|
|
75
|
+
The provider reads `config` once, on the first render (remount it with a new `key` to change it). The API, Web
|
|
76
|
+
Vitals, browser and error collectors start automatically, and each one can be switched off.
|
|
77
|
+
|
|
78
|
+
**4. Check it works** — in development, click the floating performance button in your app to see live numbers. In
|
|
79
|
+
the Trackora dashboard, open **React performance**: sampled sessions appear within a minute.
|
|
80
|
+
|
|
81
|
+
**Not using Trackora?** Use `transport: { endpoint: '/api/performance/batch' }` with your own backend — see
|
|
82
|
+
[Delivery](#delivery) for the request format.
|
|
83
|
+
|
|
84
|
+
### Get your keys in the Trackora dashboard
|
|
85
|
+
|
|
86
|
+
1. **Sign in** to the Trackora dashboard as an admin. Each environment (dev, QA, production) has its own dashboard
|
|
87
|
+
and keys.
|
|
88
|
+
2. Open **Administration › Manage applications**.
|
|
89
|
+
3. Click **Register application** and fill in:
|
|
90
|
+
- **Name** — what people see, e.g. `My App`
|
|
91
|
+
- **App key** — lowercase letters, digits and dashes, e.g. `my-app`
|
|
92
|
+
- **Allowed origins** — the web addresses your app runs on, e.g. `https://app.example.com` (empty = any)
|
|
93
|
+
4. Click **Register**. The **New ingestion key** window shows your **key** (`trk_dev_…` in dev, `trk_live_…` in
|
|
94
|
+
production) and **appId** (`app_…`). **The key is shown only once** — copy both, then click **I have saved it**.
|
|
95
|
+
5. Repeat in each environment's dashboard; each gives its own appId and key.
|
|
96
|
+
|
|
97
|
+
Later, on the app's row: **New key** adds a key, **Rotate** replaces it (the old one keeps working for 7 days),
|
|
98
|
+
**Revoke** turns it off at once. After signing in, **Developers › Integration guide** shows the snippets with your
|
|
99
|
+
appId filled in.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Contents
|
|
104
|
+
|
|
105
|
+
[Configuration](#configuration) · [Entry points](#entry-points) · [Collectors](#collectors) ·
|
|
106
|
+
[Developer panel](#developer-panel) · [Redux](#redux) · [Axios](#axios) · [Hooks](#hooks) · [Delivery](#delivery) ·
|
|
107
|
+
[Privacy](#privacy) · [Performance overhead](#performance-overhead) · [Production checklist](#production-checklist) ·
|
|
108
|
+
[Troubleshooting](#troubleshooting) · [Custom collectors](#custom-collectors)
|
|
80
109
|
|
|
81
110
|
## Configuration
|
|
82
111
|
|
|
@@ -102,6 +131,20 @@ The provider reads `config` once, on the first render. To change it, remount the
|
|
|
102
131
|
|
|
103
132
|
An invalid config never throws. The monitor disables itself and warns once.
|
|
104
133
|
|
|
134
|
+
## Entry points
|
|
135
|
+
|
|
136
|
+
| Import | What it adds |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `@ashokreddydev/react-performance-monitor` | provider, monitor, built-in collectors, `<ProfiledBoundary>`, hooks, `<PerformanceButton>` |
|
|
139
|
+
| `…/redux` | `createPerformanceMiddleware()` |
|
|
140
|
+
| `…/axios` | `instrumentAxios(instance, monitor)` |
|
|
141
|
+
| `…/charts` | ECharts charts for the panel (needs `echarts`) |
|
|
142
|
+
| `…/trackora` | `trackoraTransport()` for a Trackora server |
|
|
143
|
+
|
|
144
|
+
ESM and CommonJS builds ship with TypeScript declarations. The package works in JavaScript and TypeScript apps and
|
|
145
|
+
is tree-shakeable (`sideEffects: false`). Redux Toolkit, Axios, ECharts and React Scan are optional — only their own
|
|
146
|
+
entry points use them.
|
|
147
|
+
|
|
105
148
|
## Collectors
|
|
106
149
|
|
|
107
150
|
Each collector is independent and has its own switch in `collectors`.
|
|
@@ -305,6 +348,4 @@ export const longTasks: Collector = {
|
|
|
305
348
|
Pass collectors with `<PerformanceProvider collectors={[longTasks]} builtInCollectors={false} />`. A collector that
|
|
306
349
|
throws is contained, and reported when `debug` is on. It never stops the other collectors or your app.
|
|
307
350
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
MIT
|
|
351
|
+
**License:** MIT · **Changes:** [CHANGELOG.md](./CHANGELOG.md)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
3
|
+
var chunk5AT7Z32E_cjs = require('./chunk-5AT7Z32E.cjs');
|
|
4
|
+
var chunkMQZLO62L_cjs = require('./chunk-MQZLO62L.cjs');
|
|
5
|
+
require('./chunk-MYCOS5WD.cjs');
|
|
6
|
+
require('./chunk-QUF75EA3.cjs');
|
|
7
|
+
require('./chunk-ZY43XLHK.cjs');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
@@ -563,8 +563,8 @@ function PerformancePanel({
|
|
|
563
563
|
initialTab = "overview"
|
|
564
564
|
}) {
|
|
565
565
|
var _a, _b, _c, _d, _e;
|
|
566
|
-
const monitor =
|
|
567
|
-
const snapshot =
|
|
566
|
+
const monitor = chunk5AT7Z32E_cjs.usePerformance();
|
|
567
|
+
const snapshot = chunk5AT7Z32E_cjs.usePerformanceMetrics();
|
|
568
568
|
const [tab, setTab] = react.useState(initialTab);
|
|
569
569
|
const [charts, setCharts] = react.useState(null);
|
|
570
570
|
const [chartsError, setChartsError] = react.useState(false);
|
|
@@ -587,7 +587,7 @@ function PerformancePanel({
|
|
|
587
587
|
var _a2;
|
|
588
588
|
(_a2 = dialogRef.current) == null ? void 0 : _a2.focus();
|
|
589
589
|
}, []);
|
|
590
|
-
const thresholds = (_b = (_a = monitor.config) == null ? void 0 : _a.thresholds) != null ? _b :
|
|
590
|
+
const thresholds = (_b = (_a = monitor.config) == null ? void 0 : _a.thresholds) != null ? _b : chunkMQZLO62L_cjs.DEFAULT_THRESHOLDS;
|
|
591
591
|
const current = (_c = TABS.find((t) => t.id === tab)) != null ? _c : TABS[0];
|
|
592
592
|
const onTabKey = (e, i) => {
|
|
593
593
|
var _a2;
|
|
@@ -676,5 +676,5 @@ function PerformancePanel({
|
|
|
676
676
|
}
|
|
677
677
|
|
|
678
678
|
module.exports = PerformancePanel;
|
|
679
|
-
//# sourceMappingURL=PerformancePanel-
|
|
680
|
-
//# sourceMappingURL=PerformancePanel-
|
|
679
|
+
//# sourceMappingURL=PerformancePanel-7AYCIEG6.cjs.map
|
|
680
|
+
//# sourceMappingURL=PerformancePanel-7AYCIEG6.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { usePerformance, usePerformanceMetrics } from './chunk-
|
|
2
|
-
import { DEFAULT_THRESHOLDS } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { usePerformance, usePerformanceMetrics } from './chunk-EMWBXP4Q.js';
|
|
2
|
+
import { DEFAULT_THRESHOLDS } from './chunk-B5MOQKKB.js';
|
|
3
|
+
import './chunk-ICEGTP6M.js';
|
|
4
|
+
import './chunk-UGDPZ343.js';
|
|
5
|
+
import './chunk-XKYIKK6C.js';
|
|
6
6
|
import { useState, useRef, useEffect } from 'react';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
@@ -674,5 +674,5 @@ function PerformancePanel({
|
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
export { PerformancePanel as default };
|
|
677
|
-
//# sourceMappingURL=PerformancePanel-
|
|
678
|
-
//# sourceMappingURL=PerformancePanel-
|
|
677
|
+
//# sourceMappingURL=PerformancePanel-TNVY6W3W.js.map
|
|
678
|
+
//# sourceMappingURL=PerformancePanel-TNVY6W3W.js.map
|
package/dist/axios.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkMYCOS5WD_cjs = require('./chunk-MYCOS5WD.cjs');
|
|
4
|
+
require('./chunk-QUF75EA3.cjs');
|
|
5
5
|
|
|
6
6
|
// src/collectors/axios.ts
|
|
7
7
|
var START = /* @__PURE__ */ Symbol.for("rpm.start");
|
|
@@ -20,7 +20,7 @@ function instrumentAxios(axios, monitor) {
|
|
|
20
20
|
const start = c == null ? void 0 : c[START];
|
|
21
21
|
if (!c || start === void 0 || !ctx.config) return;
|
|
22
22
|
const t = { method: ((_a = c.method) != null ? _a : "get").toUpperCase(), url: fullUrl(c), start };
|
|
23
|
-
|
|
23
|
+
chunkMYCOS5WD_cjs.recordApiCall({ config: ctx.config, record: ctx.record }, t, status, "axios");
|
|
24
24
|
} catch {
|
|
25
25
|
}
|
|
26
26
|
};
|
package/dist/axios.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkMQZLO62L_cjs = require('./chunk-MQZLO62L.cjs');
|
|
4
|
+
var chunkMYCOS5WD_cjs = require('./chunk-MYCOS5WD.cjs');
|
|
5
|
+
var chunkQUF75EA3_cjs = require('./chunk-QUF75EA3.cjs');
|
|
6
6
|
var webVitals = require('web-vitals');
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -122,7 +122,7 @@ function observeResources(ctx) {
|
|
|
122
122
|
if (!slow && !failed) continue;
|
|
123
123
|
if (sent >= MAX_SENT_RESOURCES) continue;
|
|
124
124
|
sent++;
|
|
125
|
-
const { endpoint, host } =
|
|
125
|
+
const { endpoint, host } = chunkQUF75EA3_cjs.sanitizeUrl(e.name);
|
|
126
126
|
ctx.record({
|
|
127
127
|
eventType: "resource",
|
|
128
128
|
duration: Math.round(e.duration),
|
|
@@ -222,7 +222,7 @@ function errorCollector() {
|
|
|
222
222
|
ctx.record(
|
|
223
223
|
{
|
|
224
224
|
eventType: "js_error",
|
|
225
|
-
data: { kind, name:
|
|
225
|
+
data: { kind, name: chunkQUF75EA3_cjs.sanitizeName(d.name), message: chunkQUF75EA3_cjs.sanitizeText(d.message), fingerprint }
|
|
226
226
|
},
|
|
227
227
|
void 0,
|
|
228
228
|
{ localOnly: n > MAX_SENT_PER_ERROR }
|
|
@@ -271,7 +271,7 @@ function webVitalsCollector() {
|
|
|
271
271
|
ctx.record({
|
|
272
272
|
eventType: "web_vital",
|
|
273
273
|
...name === "CLS" ? {} : { duration: value },
|
|
274
|
-
data: { name, value, rating:
|
|
274
|
+
data: { name, value, rating: chunkMQZLO62L_cjs.rateVital(name, value, ctx.config.thresholds), id: m.id }
|
|
275
275
|
});
|
|
276
276
|
};
|
|
277
277
|
sink = mine;
|
|
@@ -299,7 +299,7 @@ function webVitalsCollector() {
|
|
|
299
299
|
|
|
300
300
|
// src/collectors/index.ts
|
|
301
301
|
function defaultCollectors() {
|
|
302
|
-
return [
|
|
302
|
+
return [chunkMYCOS5WD_cjs.apiCollector(), webVitalsCollector(), browserCollector(), errorCollector()];
|
|
303
303
|
}
|
|
304
304
|
var PerformanceContext = react.createContext(null);
|
|
305
305
|
function PerformanceProvider({
|
|
@@ -310,7 +310,7 @@ function PerformanceProvider({
|
|
|
310
310
|
children
|
|
311
311
|
}) {
|
|
312
312
|
const [state] = react.useState(() => {
|
|
313
|
-
const monitor = external != null ? external : config ? new
|
|
313
|
+
const monitor = external != null ? external : config ? new chunkMQZLO62L_cjs.PerformanceMonitor(config) : chunkMQZLO62L_cjs.PerformanceMonitor.disabled();
|
|
314
314
|
for (const c of collectors != null ? collectors : []) monitor.use(c);
|
|
315
315
|
if (builtInCollectors) for (const c of defaultCollectors()) monitor.use(c);
|
|
316
316
|
return { monitor, owned: !external };
|
|
@@ -327,7 +327,7 @@ var fallback = null;
|
|
|
327
327
|
function usePerformance() {
|
|
328
328
|
const monitor = react.useContext(PerformanceContext);
|
|
329
329
|
if (monitor) return monitor;
|
|
330
|
-
fallback != null ? fallback : fallback =
|
|
330
|
+
fallback != null ? fallback : fallback = chunkMQZLO62L_cjs.PerformanceMonitor.disabled();
|
|
331
331
|
return fallback;
|
|
332
332
|
}
|
|
333
333
|
function usePerformanceMetrics() {
|
|
@@ -343,5 +343,5 @@ exports.errorCollector = errorCollector;
|
|
|
343
343
|
exports.usePerformance = usePerformance;
|
|
344
344
|
exports.usePerformanceMetrics = usePerformanceMetrics;
|
|
345
345
|
exports.webVitalsCollector = webVitalsCollector;
|
|
346
|
-
//# sourceMappingURL=chunk-
|
|
347
|
-
//# sourceMappingURL=chunk-
|
|
346
|
+
//# sourceMappingURL=chunk-5AT7Z32E.cjs.map
|
|
347
|
+
//# sourceMappingURL=chunk-5AT7Z32E.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { templatePath, sanitizeMetadata } from './chunk-
|
|
2
|
-
import { createHttpTransport, RetryableTransportError, PermanentTransportError, backoffDelay } from './chunk-
|
|
1
|
+
import { templatePath, sanitizeMetadata } from './chunk-UGDPZ343.js';
|
|
2
|
+
import { createHttpTransport, RetryableTransportError, PermanentTransportError, backoffDelay } from './chunk-XKYIKK6C.js';
|
|
3
3
|
|
|
4
4
|
// src/utils/sampling.ts
|
|
5
5
|
function clampRate(rate, fallback = 1) {
|
|
@@ -549,7 +549,7 @@ function uuidv4() {
|
|
|
549
549
|
|
|
550
550
|
// src/core/PerformanceMonitor.ts
|
|
551
551
|
var SDK_NAME = "react-performance-monitor";
|
|
552
|
-
var SDK_VERSION = "0.1.
|
|
552
|
+
var SDK_VERSION = "0.1.2";
|
|
553
553
|
var activeMonitor = null;
|
|
554
554
|
function getActiveMonitor() {
|
|
555
555
|
return activeMonitor;
|
|
@@ -989,5 +989,5 @@ var PerformanceMonitor = class _PerformanceMonitor {
|
|
|
989
989
|
};
|
|
990
990
|
|
|
991
991
|
export { COLLECTOR_NAMES, DEFAULT_THRESHOLDS, EventBuffer, EventCollector, OTHER, PerformanceConfigError, PerformanceMonitor, Reservoir, SDK_NAME, SDK_VERSION, getActiveMonitor, quantile, rateVital, resolveConfig, resolveThresholds, shouldSample };
|
|
992
|
-
//# sourceMappingURL=chunk-
|
|
993
|
-
//# sourceMappingURL=chunk-
|
|
992
|
+
//# sourceMappingURL=chunk-B5MOQKKB.js.map
|
|
993
|
+
//# sourceMappingURL=chunk-B5MOQKKB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PerformanceMonitor, rateVital } from './chunk-
|
|
2
|
-
import { apiCollector } from './chunk-
|
|
3
|
-
import { sanitizeUrl, sanitizeText, sanitizeName } from './chunk-
|
|
1
|
+
import { PerformanceMonitor, rateVital } from './chunk-B5MOQKKB.js';
|
|
2
|
+
import { apiCollector } from './chunk-ICEGTP6M.js';
|
|
3
|
+
import { sanitizeUrl, sanitizeText, sanitizeName } from './chunk-UGDPZ343.js';
|
|
4
4
|
import { onLCP, onINP, onCLS, onFCP, onTTFB } from 'web-vitals';
|
|
5
5
|
import { createContext, useState, useEffect, useContext, useSyncExternalStore } from 'react';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -334,5 +334,5 @@ function usePerformanceMetrics() {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
export { PerformanceContext, PerformanceProvider, browserCollector, defaultCollectors, errorCollector, usePerformance, usePerformanceMetrics, webVitalsCollector };
|
|
337
|
-
//# sourceMappingURL=chunk-
|
|
338
|
-
//# sourceMappingURL=chunk-
|
|
337
|
+
//# sourceMappingURL=chunk-EMWBXP4Q.js.map
|
|
338
|
+
//# sourceMappingURL=chunk-EMWBXP4Q.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sanitizeUrl } from './chunk-
|
|
1
|
+
import { sanitizeUrl } from './chunk-UGDPZ343.js';
|
|
2
2
|
|
|
3
3
|
// src/collectors/apiPerformance.ts
|
|
4
4
|
var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
@@ -118,5 +118,5 @@ function apiCollector(options = {}) {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
export { apiCollector, recordApiCall };
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
//# sourceMappingURL=chunk-ICEGTP6M.js.map
|
|
122
|
+
//# sourceMappingURL=chunk-ICEGTP6M.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkQUF75EA3_cjs = require('./chunk-QUF75EA3.cjs');
|
|
4
|
+
var chunkZY43XLHK_cjs = require('./chunk-ZY43XLHK.cjs');
|
|
5
5
|
|
|
6
6
|
// src/utils/sampling.ts
|
|
7
7
|
function clampRate(rate, fallback = 1) {
|
|
@@ -551,7 +551,7 @@ function uuidv4() {
|
|
|
551
551
|
|
|
552
552
|
// src/core/PerformanceMonitor.ts
|
|
553
553
|
var SDK_NAME = "react-performance-monitor";
|
|
554
|
-
var SDK_VERSION = "0.1.
|
|
554
|
+
var SDK_VERSION = "0.1.2";
|
|
555
555
|
var activeMonitor = null;
|
|
556
556
|
function getActiveMonitor() {
|
|
557
557
|
return activeMonitor;
|
|
@@ -629,7 +629,7 @@ var PerformanceMonitor = class _PerformanceMonitor {
|
|
|
629
629
|
if (live) writeSession(appId, { id: this.sessionId, sampled: this.sampled, rate, seenAt: t });
|
|
630
630
|
let transport = (_e = deps.transport) != null ? _e : null;
|
|
631
631
|
if (!transport && (resolved == null ? void 0 : resolved.transport))
|
|
632
|
-
transport = isTransport(resolved.transport) ? resolved.transport :
|
|
632
|
+
transport = isTransport(resolved.transport) ? resolved.transport : chunkZY43XLHK_cjs.createHttpTransport(resolved.transport);
|
|
633
633
|
this.transport = transport;
|
|
634
634
|
this.ownUrls = (_f = transport == null ? void 0 : transport.ownUrls) != null ? _f : [];
|
|
635
635
|
this.buffer = new EventBuffer((_g = resolved == null ? void 0 : resolved.maxBufferedEvents) != null ? _g : 10);
|
|
@@ -749,11 +749,11 @@ var PerformanceMonitor = class _PerformanceMonitor {
|
|
|
749
749
|
}
|
|
750
750
|
/** The route attached to new events. Routers call this on navigation; default is the templated `location.pathname`. */
|
|
751
751
|
setRoute(route) {
|
|
752
|
-
this.route =
|
|
752
|
+
this.route = chunkQUF75EA3_cjs.templatePath(String(route)).slice(0, 200);
|
|
753
753
|
}
|
|
754
754
|
getRoute() {
|
|
755
755
|
if (this.route) return this.route;
|
|
756
|
-
return hasWindow() ?
|
|
756
|
+
return hasWindow() ? chunkQUF75EA3_cjs.templatePath(location.pathname).slice(0, 200) : "/";
|
|
757
757
|
}
|
|
758
758
|
/**
|
|
759
759
|
* Add one event. Never throws. Accepted from construction on (React Profiler callbacks fire before the provider's
|
|
@@ -764,7 +764,7 @@ var PerformanceMonitor = class _PerformanceMonitor {
|
|
|
764
764
|
if (this.stopped || !this.collecting || this.recordingDepth > 0) return;
|
|
765
765
|
this.recordingDepth++;
|
|
766
766
|
try {
|
|
767
|
-
const meta =
|
|
767
|
+
const meta = chunkQUF75EA3_cjs.sanitizeMetadata(metadata != null ? metadata : input.metadata);
|
|
768
768
|
const event = {
|
|
769
769
|
...input,
|
|
770
770
|
timestamp: (_a = input.timestamp) != null ? _a : this.now(),
|
|
@@ -879,19 +879,19 @@ var PerformanceMonitor = class _PerformanceMonitor {
|
|
|
879
879
|
() => this.transportOrThrow().send(this.batch(pending.events, pending.dropped), { unloading: false })
|
|
880
880
|
),
|
|
881
881
|
new Promise((_, reject) => {
|
|
882
|
-
timer = setTimeout(() => reject(new
|
|
882
|
+
timer = setTimeout(() => reject(new chunkZY43XLHK_cjs.RetryableTransportError("send timed out")), this.sendTimeoutMs);
|
|
883
883
|
})
|
|
884
884
|
]);
|
|
885
885
|
} catch (err) {
|
|
886
886
|
const attempt = pending.attempt + 1;
|
|
887
|
-
if (err instanceof
|
|
887
|
+
if (err instanceof chunkZY43XLHK_cjs.PermanentTransportError || attempt > this.settings.maxRetries) {
|
|
888
888
|
this.warnOnce("transport", err);
|
|
889
889
|
this.returnDropped(pending.dropped);
|
|
890
890
|
this.countDropped("failed", pending.events.length);
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
893
893
|
this.retry = { ...pending, attempt };
|
|
894
|
-
const delay = err instanceof
|
|
894
|
+
const delay = err instanceof chunkZY43XLHK_cjs.RetryableTransportError && err.retryAfterMs !== void 0 ? err.retryAfterMs : chunkZY43XLHK_cjs.backoffDelay(attempt, this.random);
|
|
895
895
|
if (this.running)
|
|
896
896
|
this.retryTimer = setTimeout(() => {
|
|
897
897
|
this.retryTimer = void 0;
|
|
@@ -1006,5 +1006,5 @@ exports.rateVital = rateVital;
|
|
|
1006
1006
|
exports.resolveConfig = resolveConfig;
|
|
1007
1007
|
exports.resolveThresholds = resolveThresholds;
|
|
1008
1008
|
exports.shouldSample = shouldSample;
|
|
1009
|
-
//# sourceMappingURL=chunk-
|
|
1010
|
-
//# sourceMappingURL=chunk-
|
|
1009
|
+
//# sourceMappingURL=chunk-MQZLO62L.cjs.map
|
|
1010
|
+
//# sourceMappingURL=chunk-MQZLO62L.cjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQUF75EA3_cjs = require('./chunk-QUF75EA3.cjs');
|
|
4
4
|
|
|
5
5
|
// src/collectors/apiPerformance.ts
|
|
6
6
|
var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
7
7
|
function recordApiCall(ctx, t, status, client) {
|
|
8
|
-
const { endpoint, host } =
|
|
8
|
+
const { endpoint, host } = chunkQUF75EA3_cjs.sanitizeUrl(t.url, {
|
|
9
9
|
allowedQueryParams: ctx.config.api.allowedQueryParams,
|
|
10
10
|
groupEndpoint: ctx.config.api.groupEndpoint
|
|
11
11
|
});
|
|
@@ -121,5 +121,5 @@ function apiCollector(options = {}) {
|
|
|
121
121
|
|
|
122
122
|
exports.apiCollector = apiCollector;
|
|
123
123
|
exports.recordApiCall = recordApiCall;
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-MYCOS5WD.cjs.map
|
|
125
|
+
//# sourceMappingURL=chunk-MYCOS5WD.cjs.map
|
|
@@ -179,5 +179,5 @@ exports.sanitizeName = sanitizeName;
|
|
|
179
179
|
exports.sanitizeText = sanitizeText;
|
|
180
180
|
exports.sanitizeUrl = sanitizeUrl;
|
|
181
181
|
exports.templatePath = templatePath;
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-QUF75EA3.cjs.map
|
|
183
|
+
//# sourceMappingURL=chunk-QUF75EA3.cjs.map
|
|
@@ -173,5 +173,5 @@ function sanitizeMetadata(input) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
export { sanitizeMetadata, sanitizeName, sanitizeText, sanitizeUrl, templatePath };
|
|
176
|
-
//# sourceMappingURL=chunk-
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-UGDPZ343.js.map
|
|
177
|
+
//# sourceMappingURL=chunk-UGDPZ343.js.map
|
|
@@ -70,5 +70,5 @@ function backoffDelay(attempt, random = Math.random, baseMs = 1e3, capMs = 6e4)
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export { PermanentTransportError, RetryableTransportError, backoffDelay, createHttpTransport };
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-XKYIKK6C.js.map
|
|
74
|
+
//# sourceMappingURL=chunk-XKYIKK6C.js.map
|
|
@@ -75,5 +75,5 @@ exports.PermanentTransportError = PermanentTransportError;
|
|
|
75
75
|
exports.RetryableTransportError = RetryableTransportError;
|
|
76
76
|
exports.backoffDelay = backoffDelay;
|
|
77
77
|
exports.createHttpTransport = createHttpTransport;
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-ZY43XLHK.cjs.map
|
|
79
|
+
//# sourceMappingURL=chunk-ZY43XLHK.cjs.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunk5AT7Z32E_cjs = require('./chunk-5AT7Z32E.cjs');
|
|
4
|
+
var chunkMQZLO62L_cjs = require('./chunk-MQZLO62L.cjs');
|
|
5
|
+
var chunkMYCOS5WD_cjs = require('./chunk-MYCOS5WD.cjs');
|
|
6
|
+
var chunkQUF75EA3_cjs = require('./chunk-QUF75EA3.cjs');
|
|
7
|
+
var chunkZY43XLHK_cjs = require('./chunk-ZY43XLHK.cjs');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
11
11
|
function ProfiledBoundary({ id, children }) {
|
|
12
|
-
const monitor =
|
|
12
|
+
const monitor = chunk5AT7Z32E_cjs.usePerformance();
|
|
13
13
|
const onRender = react.useCallback(
|
|
14
14
|
(_id, phase, actualDuration, baseDuration) => {
|
|
15
15
|
var _a, _b;
|
|
@@ -20,7 +20,7 @@ function ProfiledBoundary({ id, children }) {
|
|
|
20
20
|
eventType: "component_render",
|
|
21
21
|
duration: actual,
|
|
22
22
|
data: {
|
|
23
|
-
component:
|
|
23
|
+
component: chunkQUF75EA3_cjs.sanitizeName(id),
|
|
24
24
|
phase: phase === "mount" ? "mount" : phase === "update" ? "update" : "nested-update",
|
|
25
25
|
actualDuration: actual,
|
|
26
26
|
baseDuration: Math.round(baseDuration * 100) / 100,
|
|
@@ -170,10 +170,10 @@ function themeVars(t) {
|
|
|
170
170
|
"--rpm-font": t.fontFamily
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
var PerformancePanel = react.lazy(() => import('./PerformancePanel-
|
|
173
|
+
var PerformancePanel = react.lazy(() => import('./PerformancePanel-7AYCIEG6.cjs'));
|
|
174
174
|
function PerformanceButton(props) {
|
|
175
175
|
var _a;
|
|
176
|
-
const monitor =
|
|
176
|
+
const monitor = chunk5AT7Z32E_cjs.usePerformance();
|
|
177
177
|
if (!props.force && !((_a = monitor.config) == null ? void 0 : _a.devtools)) return null;
|
|
178
178
|
if (!monitor.config) return null;
|
|
179
179
|
return /* @__PURE__ */ jsxRuntime.jsx(ButtonInner, { ...props });
|
|
@@ -189,7 +189,7 @@ function ButtonInner({
|
|
|
189
189
|
}) {
|
|
190
190
|
injectStyles();
|
|
191
191
|
const [open, setOpen] = react.useState(defaultOpen);
|
|
192
|
-
const { errors } =
|
|
192
|
+
const { errors } = chunk5AT7Z32E_cjs.usePerformanceMetrics().totals;
|
|
193
193
|
const { theme, dark } = useResolvedTheme(mode, themeOverrides);
|
|
194
194
|
const buttonRef = react.useRef(null);
|
|
195
195
|
const id = react.useId();
|
|
@@ -252,7 +252,7 @@ function ButtonInner({
|
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
function useApiPerformance(match) {
|
|
255
|
-
const { apis } =
|
|
255
|
+
const { apis } = chunk5AT7Z32E_cjs.usePerformanceMetrics();
|
|
256
256
|
const key = match instanceof RegExp ? match.source + match.flags : match;
|
|
257
257
|
return react.useMemo(() => {
|
|
258
258
|
if (!match) return apis;
|
|
@@ -264,139 +264,139 @@ function useApiPerformance(match) {
|
|
|
264
264
|
|
|
265
265
|
Object.defineProperty(exports, "PerformanceContext", {
|
|
266
266
|
enumerable: true,
|
|
267
|
-
get: function () { return
|
|
267
|
+
get: function () { return chunk5AT7Z32E_cjs.PerformanceContext; }
|
|
268
268
|
});
|
|
269
269
|
Object.defineProperty(exports, "PerformanceProvider", {
|
|
270
270
|
enumerable: true,
|
|
271
|
-
get: function () { return
|
|
271
|
+
get: function () { return chunk5AT7Z32E_cjs.PerformanceProvider; }
|
|
272
272
|
});
|
|
273
273
|
Object.defineProperty(exports, "browserCollector", {
|
|
274
274
|
enumerable: true,
|
|
275
|
-
get: function () { return
|
|
275
|
+
get: function () { return chunk5AT7Z32E_cjs.browserCollector; }
|
|
276
276
|
});
|
|
277
277
|
Object.defineProperty(exports, "defaultCollectors", {
|
|
278
278
|
enumerable: true,
|
|
279
|
-
get: function () { return
|
|
279
|
+
get: function () { return chunk5AT7Z32E_cjs.defaultCollectors; }
|
|
280
280
|
});
|
|
281
281
|
Object.defineProperty(exports, "errorCollector", {
|
|
282
282
|
enumerable: true,
|
|
283
|
-
get: function () { return
|
|
283
|
+
get: function () { return chunk5AT7Z32E_cjs.errorCollector; }
|
|
284
284
|
});
|
|
285
285
|
Object.defineProperty(exports, "usePerformance", {
|
|
286
286
|
enumerable: true,
|
|
287
|
-
get: function () { return
|
|
287
|
+
get: function () { return chunk5AT7Z32E_cjs.usePerformance; }
|
|
288
288
|
});
|
|
289
289
|
Object.defineProperty(exports, "usePerformanceMetrics", {
|
|
290
290
|
enumerable: true,
|
|
291
|
-
get: function () { return
|
|
291
|
+
get: function () { return chunk5AT7Z32E_cjs.usePerformanceMetrics; }
|
|
292
292
|
});
|
|
293
293
|
Object.defineProperty(exports, "webVitalsCollector", {
|
|
294
294
|
enumerable: true,
|
|
295
|
-
get: function () { return
|
|
295
|
+
get: function () { return chunk5AT7Z32E_cjs.webVitalsCollector; }
|
|
296
296
|
});
|
|
297
297
|
Object.defineProperty(exports, "COLLECTOR_NAMES", {
|
|
298
298
|
enumerable: true,
|
|
299
|
-
get: function () { return
|
|
299
|
+
get: function () { return chunkMQZLO62L_cjs.COLLECTOR_NAMES; }
|
|
300
300
|
});
|
|
301
301
|
Object.defineProperty(exports, "DEFAULT_THRESHOLDS", {
|
|
302
302
|
enumerable: true,
|
|
303
|
-
get: function () { return
|
|
303
|
+
get: function () { return chunkMQZLO62L_cjs.DEFAULT_THRESHOLDS; }
|
|
304
304
|
});
|
|
305
305
|
Object.defineProperty(exports, "EventBuffer", {
|
|
306
306
|
enumerable: true,
|
|
307
|
-
get: function () { return
|
|
307
|
+
get: function () { return chunkMQZLO62L_cjs.EventBuffer; }
|
|
308
308
|
});
|
|
309
309
|
Object.defineProperty(exports, "EventCollector", {
|
|
310
310
|
enumerable: true,
|
|
311
|
-
get: function () { return
|
|
311
|
+
get: function () { return chunkMQZLO62L_cjs.EventCollector; }
|
|
312
312
|
});
|
|
313
313
|
Object.defineProperty(exports, "OTHER", {
|
|
314
314
|
enumerable: true,
|
|
315
|
-
get: function () { return
|
|
315
|
+
get: function () { return chunkMQZLO62L_cjs.OTHER; }
|
|
316
316
|
});
|
|
317
317
|
Object.defineProperty(exports, "PerformanceConfigError", {
|
|
318
318
|
enumerable: true,
|
|
319
|
-
get: function () { return
|
|
319
|
+
get: function () { return chunkMQZLO62L_cjs.PerformanceConfigError; }
|
|
320
320
|
});
|
|
321
321
|
Object.defineProperty(exports, "PerformanceMonitor", {
|
|
322
322
|
enumerable: true,
|
|
323
|
-
get: function () { return
|
|
323
|
+
get: function () { return chunkMQZLO62L_cjs.PerformanceMonitor; }
|
|
324
324
|
});
|
|
325
325
|
Object.defineProperty(exports, "Reservoir", {
|
|
326
326
|
enumerable: true,
|
|
327
|
-
get: function () { return
|
|
327
|
+
get: function () { return chunkMQZLO62L_cjs.Reservoir; }
|
|
328
328
|
});
|
|
329
329
|
Object.defineProperty(exports, "SDK_NAME", {
|
|
330
330
|
enumerable: true,
|
|
331
|
-
get: function () { return
|
|
331
|
+
get: function () { return chunkMQZLO62L_cjs.SDK_NAME; }
|
|
332
332
|
});
|
|
333
333
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
334
334
|
enumerable: true,
|
|
335
|
-
get: function () { return
|
|
335
|
+
get: function () { return chunkMQZLO62L_cjs.SDK_VERSION; }
|
|
336
336
|
});
|
|
337
337
|
Object.defineProperty(exports, "getActiveMonitor", {
|
|
338
338
|
enumerable: true,
|
|
339
|
-
get: function () { return
|
|
339
|
+
get: function () { return chunkMQZLO62L_cjs.getActiveMonitor; }
|
|
340
340
|
});
|
|
341
341
|
Object.defineProperty(exports, "quantile", {
|
|
342
342
|
enumerable: true,
|
|
343
|
-
get: function () { return
|
|
343
|
+
get: function () { return chunkMQZLO62L_cjs.quantile; }
|
|
344
344
|
});
|
|
345
345
|
Object.defineProperty(exports, "rateVital", {
|
|
346
346
|
enumerable: true,
|
|
347
|
-
get: function () { return
|
|
347
|
+
get: function () { return chunkMQZLO62L_cjs.rateVital; }
|
|
348
348
|
});
|
|
349
349
|
Object.defineProperty(exports, "resolveConfig", {
|
|
350
350
|
enumerable: true,
|
|
351
|
-
get: function () { return
|
|
351
|
+
get: function () { return chunkMQZLO62L_cjs.resolveConfig; }
|
|
352
352
|
});
|
|
353
353
|
Object.defineProperty(exports, "resolveThresholds", {
|
|
354
354
|
enumerable: true,
|
|
355
|
-
get: function () { return
|
|
355
|
+
get: function () { return chunkMQZLO62L_cjs.resolveThresholds; }
|
|
356
356
|
});
|
|
357
357
|
Object.defineProperty(exports, "shouldSample", {
|
|
358
358
|
enumerable: true,
|
|
359
|
-
get: function () { return
|
|
359
|
+
get: function () { return chunkMQZLO62L_cjs.shouldSample; }
|
|
360
360
|
});
|
|
361
361
|
Object.defineProperty(exports, "apiCollector", {
|
|
362
362
|
enumerable: true,
|
|
363
|
-
get: function () { return
|
|
363
|
+
get: function () { return chunkMYCOS5WD_cjs.apiCollector; }
|
|
364
364
|
});
|
|
365
365
|
Object.defineProperty(exports, "sanitizeMetadata", {
|
|
366
366
|
enumerable: true,
|
|
367
|
-
get: function () { return
|
|
367
|
+
get: function () { return chunkQUF75EA3_cjs.sanitizeMetadata; }
|
|
368
368
|
});
|
|
369
369
|
Object.defineProperty(exports, "sanitizeName", {
|
|
370
370
|
enumerable: true,
|
|
371
|
-
get: function () { return
|
|
371
|
+
get: function () { return chunkQUF75EA3_cjs.sanitizeName; }
|
|
372
372
|
});
|
|
373
373
|
Object.defineProperty(exports, "sanitizeText", {
|
|
374
374
|
enumerable: true,
|
|
375
|
-
get: function () { return
|
|
375
|
+
get: function () { return chunkQUF75EA3_cjs.sanitizeText; }
|
|
376
376
|
});
|
|
377
377
|
Object.defineProperty(exports, "sanitizeUrl", {
|
|
378
378
|
enumerable: true,
|
|
379
|
-
get: function () { return
|
|
379
|
+
get: function () { return chunkQUF75EA3_cjs.sanitizeUrl; }
|
|
380
380
|
});
|
|
381
381
|
Object.defineProperty(exports, "templatePath", {
|
|
382
382
|
enumerable: true,
|
|
383
|
-
get: function () { return
|
|
383
|
+
get: function () { return chunkQUF75EA3_cjs.templatePath; }
|
|
384
384
|
});
|
|
385
385
|
Object.defineProperty(exports, "PermanentTransportError", {
|
|
386
386
|
enumerable: true,
|
|
387
|
-
get: function () { return
|
|
387
|
+
get: function () { return chunkZY43XLHK_cjs.PermanentTransportError; }
|
|
388
388
|
});
|
|
389
389
|
Object.defineProperty(exports, "RetryableTransportError", {
|
|
390
390
|
enumerable: true,
|
|
391
|
-
get: function () { return
|
|
391
|
+
get: function () { return chunkZY43XLHK_cjs.RetryableTransportError; }
|
|
392
392
|
});
|
|
393
393
|
Object.defineProperty(exports, "backoffDelay", {
|
|
394
394
|
enumerable: true,
|
|
395
|
-
get: function () { return
|
|
395
|
+
get: function () { return chunkZY43XLHK_cjs.backoffDelay; }
|
|
396
396
|
});
|
|
397
397
|
Object.defineProperty(exports, "createHttpTransport", {
|
|
398
398
|
enumerable: true,
|
|
399
|
-
get: function () { return
|
|
399
|
+
get: function () { return chunkZY43XLHK_cjs.createHttpTransport; }
|
|
400
400
|
});
|
|
401
401
|
exports.DARK_THEME = DARK_THEME;
|
|
402
402
|
exports.LIGHT_THEME = LIGHT_THEME;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { usePerformance, usePerformanceMetrics } from './chunk-
|
|
2
|
-
export { PerformanceContext, PerformanceProvider, browserCollector, defaultCollectors, errorCollector, usePerformance, usePerformanceMetrics, webVitalsCollector } from './chunk-
|
|
3
|
-
export { COLLECTOR_NAMES, DEFAULT_THRESHOLDS, EventBuffer, EventCollector, OTHER, PerformanceConfigError, PerformanceMonitor, Reservoir, SDK_NAME, SDK_VERSION, getActiveMonitor, quantile, rateVital, resolveConfig, resolveThresholds, shouldSample } from './chunk-
|
|
4
|
-
export { apiCollector } from './chunk-
|
|
5
|
-
import { sanitizeName } from './chunk-
|
|
6
|
-
export { sanitizeMetadata, sanitizeName, sanitizeText, sanitizeUrl, templatePath } from './chunk-
|
|
7
|
-
export { PermanentTransportError, RetryableTransportError, backoffDelay, createHttpTransport } from './chunk-
|
|
1
|
+
import { usePerformance, usePerformanceMetrics } from './chunk-EMWBXP4Q.js';
|
|
2
|
+
export { PerformanceContext, PerformanceProvider, browserCollector, defaultCollectors, errorCollector, usePerformance, usePerformanceMetrics, webVitalsCollector } from './chunk-EMWBXP4Q.js';
|
|
3
|
+
export { COLLECTOR_NAMES, DEFAULT_THRESHOLDS, EventBuffer, EventCollector, OTHER, PerformanceConfigError, PerformanceMonitor, Reservoir, SDK_NAME, SDK_VERSION, getActiveMonitor, quantile, rateVital, resolveConfig, resolveThresholds, shouldSample } from './chunk-B5MOQKKB.js';
|
|
4
|
+
export { apiCollector } from './chunk-ICEGTP6M.js';
|
|
5
|
+
import { sanitizeName } from './chunk-UGDPZ343.js';
|
|
6
|
+
export { sanitizeMetadata, sanitizeName, sanitizeText, sanitizeUrl, templatePath } from './chunk-UGDPZ343.js';
|
|
7
|
+
export { PermanentTransportError, RetryableTransportError, backoffDelay, createHttpTransport } from './chunk-XKYIKK6C.js';
|
|
8
8
|
import { lazy, useCallback, Profiler, useState, useRef, useId, Suspense, useMemo, useSyncExternalStore } from 'react';
|
|
9
9
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
|
|
@@ -170,7 +170,7 @@ function themeVars(t) {
|
|
|
170
170
|
"--rpm-font": t.fontFamily
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
var PerformancePanel = lazy(() => import('./PerformancePanel-
|
|
173
|
+
var PerformancePanel = lazy(() => import('./PerformancePanel-TNVY6W3W.js'));
|
|
174
174
|
function PerformanceButton(props) {
|
|
175
175
|
var _a;
|
|
176
176
|
const monitor = usePerformance();
|
package/dist/redux.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkMQZLO62L_cjs = require('./chunk-MQZLO62L.cjs');
|
|
4
|
+
var chunkQUF75EA3_cjs = require('./chunk-QUF75EA3.cjs');
|
|
5
|
+
require('./chunk-ZY43XLHK.cjs');
|
|
6
6
|
|
|
7
7
|
// src/collectors/reduxPerformance.ts
|
|
8
8
|
var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
@@ -10,7 +10,7 @@ function createPerformanceMiddleware(options = {}) {
|
|
|
10
10
|
var _a;
|
|
11
11
|
const resolve = () => {
|
|
12
12
|
const m = options.monitor;
|
|
13
|
-
if (!m) return
|
|
13
|
+
if (!m) return chunkMQZLO62L_cjs.getActiveMonitor();
|
|
14
14
|
return typeof m === "function" ? m() : m;
|
|
15
15
|
};
|
|
16
16
|
const ignore = (_a = options.ignore) != null ? _a : [];
|
|
@@ -39,7 +39,7 @@ function createPerformanceMiddleware(options = {}) {
|
|
|
39
39
|
{
|
|
40
40
|
eventType: "redux_action",
|
|
41
41
|
duration,
|
|
42
|
-
data: { actionType:
|
|
42
|
+
data: { actionType: chunkQUF75EA3_cjs.sanitizeName(type), slow }
|
|
43
43
|
},
|
|
44
44
|
{ stateChanged: api.getState() !== before },
|
|
45
45
|
{ localOnly: !slow && !((_c = monitor.config) == null ? void 0 : _c.recordActions) }
|
package/dist/redux.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getActiveMonitor } from './chunk-
|
|
2
|
-
import { sanitizeName } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { getActiveMonitor } from './chunk-B5MOQKKB.js';
|
|
2
|
+
import { sanitizeName } from './chunk-UGDPZ343.js';
|
|
3
|
+
import './chunk-XKYIKK6C.js';
|
|
4
4
|
|
|
5
5
|
// src/collectors/reduxPerformance.ts
|
|
6
6
|
var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
|
package/dist/trackora.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZY43XLHK_cjs = require('./chunk-ZY43XLHK.cjs');
|
|
4
4
|
|
|
5
5
|
// src/trackora.ts
|
|
6
6
|
var TRACKORA_BATCH_PATH = "/api/v1/performance/batch";
|
|
7
7
|
function trackoraTransport({ apiUrl, apiKey }) {
|
|
8
|
-
return
|
|
8
|
+
return chunkZY43XLHK_cjs.createHttpTransport({
|
|
9
9
|
endpoint: `${apiUrl.replace(/\/+$/, "")}${TRACKORA_BATCH_PATH}`,
|
|
10
10
|
headers: { "x-trackora-key": apiKey }
|
|
11
11
|
});
|
package/dist/trackora.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashokreddydev/react-performance-monitor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Performance monitoring for React apps — renders, API latency, Web Vitals and errors, with any backend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"url": "git+https://github.com/ashokreddydev/trackora.git",
|
|
18
18
|
"directory": "packages/react-performance-monitor"
|
|
19
19
|
},
|
|
20
|
-
"homepage": "https://
|
|
20
|
+
"homepage": "https://www.trackora.testforge.co.in/docs#react-performance-monitor",
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/ashokreddydev/trackora/issues"
|
|
23
23
|
},
|