@tracelog/lib 0.5.0 → 0.5.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/README.md +86 -26
- package/dist/browser/tracelog.esm.js +2737 -0
- package/dist/browser/tracelog.js +2 -2731
- package/dist/cjs/constants/performance.constants.d.ts +5 -5
- package/dist/cjs/constants/performance.constants.js +6 -6
- package/dist/esm/constants/performance.constants.d.ts +5 -5
- package/dist/esm/constants/performance.constants.js +6 -6
- package/package.json +3 -3
|
@@ -8,11 +8,11 @@ import { WebVitalType } from '../types';
|
|
|
8
8
|
* These define the minimum values required to report a web vital metric
|
|
9
9
|
*
|
|
10
10
|
* Based on Core Web Vitals standards:
|
|
11
|
-
* - LCP (Largest Contentful Paint): 4000ms threshold
|
|
12
|
-
* - FCP (First Contentful Paint): 1800ms threshold
|
|
13
|
-
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless)
|
|
14
|
-
* - INP (Interaction to Next Paint): 200ms threshold
|
|
15
|
-
* - TTFB (Time to First Byte):
|
|
11
|
+
* - LCP (Largest Contentful Paint): 4000ms threshold (poor threshold)
|
|
12
|
+
* - FCP (First Contentful Paint): 1800ms threshold (good threshold)
|
|
13
|
+
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless, needs improvement threshold)
|
|
14
|
+
* - INP (Interaction to Next Paint): 200ms threshold (good threshold)
|
|
15
|
+
* - TTFB (Time to First Byte): 800ms threshold (good/needs improvement boundary, aligned with Web Vitals standard)
|
|
16
16
|
* - LONG_TASK: 50ms threshold for long task detection
|
|
17
17
|
*/
|
|
18
18
|
export declare const WEB_VITALS_THRESHOLDS: Record<WebVitalType, number>;
|
|
@@ -13,11 +13,11 @@ exports.PERFORMANCE_PRECISION_DECIMALS = exports.LONG_TASK_THROTTLE_MS = exports
|
|
|
13
13
|
* These define the minimum values required to report a web vital metric
|
|
14
14
|
*
|
|
15
15
|
* Based on Core Web Vitals standards:
|
|
16
|
-
* - LCP (Largest Contentful Paint): 4000ms threshold
|
|
17
|
-
* - FCP (First Contentful Paint): 1800ms threshold
|
|
18
|
-
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless)
|
|
19
|
-
* - INP (Interaction to Next Paint): 200ms threshold
|
|
20
|
-
* - TTFB (Time to First Byte):
|
|
16
|
+
* - LCP (Largest Contentful Paint): 4000ms threshold (poor threshold)
|
|
17
|
+
* - FCP (First Contentful Paint): 1800ms threshold (good threshold)
|
|
18
|
+
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless, needs improvement threshold)
|
|
19
|
+
* - INP (Interaction to Next Paint): 200ms threshold (good threshold)
|
|
20
|
+
* - TTFB (Time to First Byte): 800ms threshold (good/needs improvement boundary, aligned with Web Vitals standard)
|
|
21
21
|
* - LONG_TASK: 50ms threshold for long task detection
|
|
22
22
|
*/
|
|
23
23
|
exports.WEB_VITALS_THRESHOLDS = {
|
|
@@ -25,7 +25,7 @@ exports.WEB_VITALS_THRESHOLDS = {
|
|
|
25
25
|
FCP: 1800,
|
|
26
26
|
CLS: 0.25,
|
|
27
27
|
INP: 200,
|
|
28
|
-
TTFB:
|
|
28
|
+
TTFB: 800,
|
|
29
29
|
LONG_TASK: 50,
|
|
30
30
|
};
|
|
31
31
|
// ============================================================================
|
|
@@ -8,11 +8,11 @@ import { WebVitalType } from '../types';
|
|
|
8
8
|
* These define the minimum values required to report a web vital metric
|
|
9
9
|
*
|
|
10
10
|
* Based on Core Web Vitals standards:
|
|
11
|
-
* - LCP (Largest Contentful Paint): 4000ms threshold
|
|
12
|
-
* - FCP (First Contentful Paint): 1800ms threshold
|
|
13
|
-
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless)
|
|
14
|
-
* - INP (Interaction to Next Paint): 200ms threshold
|
|
15
|
-
* - TTFB (Time to First Byte):
|
|
11
|
+
* - LCP (Largest Contentful Paint): 4000ms threshold (poor threshold)
|
|
12
|
+
* - FCP (First Contentful Paint): 1800ms threshold (good threshold)
|
|
13
|
+
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless, needs improvement threshold)
|
|
14
|
+
* - INP (Interaction to Next Paint): 200ms threshold (good threshold)
|
|
15
|
+
* - TTFB (Time to First Byte): 800ms threshold (good/needs improvement boundary, aligned with Web Vitals standard)
|
|
16
16
|
* - LONG_TASK: 50ms threshold for long task detection
|
|
17
17
|
*/
|
|
18
18
|
export declare const WEB_VITALS_THRESHOLDS: Record<WebVitalType, number>;
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* These define the minimum values required to report a web vital metric
|
|
11
11
|
*
|
|
12
12
|
* Based on Core Web Vitals standards:
|
|
13
|
-
* - LCP (Largest Contentful Paint): 4000ms threshold
|
|
14
|
-
* - FCP (First Contentful Paint): 1800ms threshold
|
|
15
|
-
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless)
|
|
16
|
-
* - INP (Interaction to Next Paint): 200ms threshold
|
|
17
|
-
* - TTFB (Time to First Byte):
|
|
13
|
+
* - LCP (Largest Contentful Paint): 4000ms threshold (poor threshold)
|
|
14
|
+
* - FCP (First Contentful Paint): 1800ms threshold (good threshold)
|
|
15
|
+
* - CLS (Cumulative Layout Shift): 0.25 threshold (unitless, needs improvement threshold)
|
|
16
|
+
* - INP (Interaction to Next Paint): 200ms threshold (good threshold)
|
|
17
|
+
* - TTFB (Time to First Byte): 800ms threshold (good/needs improvement boundary, aligned with Web Vitals standard)
|
|
18
18
|
* - LONG_TASK: 50ms threshold for long task detection
|
|
19
19
|
*/
|
|
20
20
|
export const WEB_VITALS_THRESHOLDS = {
|
|
@@ -22,7 +22,7 @@ export const WEB_VITALS_THRESHOLDS = {
|
|
|
22
22
|
FCP: 1800,
|
|
23
23
|
CLS: 0.25,
|
|
24
24
|
INP: 200,
|
|
25
|
-
TTFB:
|
|
25
|
+
TTFB: 800,
|
|
26
26
|
LONG_TASK: 50,
|
|
27
27
|
};
|
|
28
28
|
// ============================================================================
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tracelog/lib",
|
|
3
3
|
"description": "JavaScript library for web analytics and real-time event tracking",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.2",
|
|
6
6
|
"main": "./dist/cjs/public-api.js",
|
|
7
7
|
"module": "./dist/esm/public-api.js",
|
|
8
8
|
"types": "./dist/esm/public-api.d.ts",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"test:coverage": "vitest run --coverage",
|
|
42
42
|
"test:integration": "vitest run --config vitest.integration.config.mjs",
|
|
43
43
|
"serve": "http-server playground -p 3000 --cors",
|
|
44
|
-
"playground:setup": "npm run build:browser:dev && cp dist/browser/tracelog.js playground/tracelog.js",
|
|
44
|
+
"playground:setup": "npm run build:browser:dev && cp dist/browser/tracelog.esm.js playground/tracelog.js",
|
|
45
45
|
"playground:dev": "npm run playground:setup && npm run serve",
|
|
46
|
-
"test:e2e": "npm run build:browser:dev && cp dist/browser/tracelog.js playground/tracelog.js && NODE_ENV=dev playwright test",
|
|
46
|
+
"test:e2e": "npm run build:browser:dev && cp dist/browser/tracelog.esm.js playground/tracelog.js && NODE_ENV=dev playwright test",
|
|
47
47
|
"ci:build": "npm run build:all",
|
|
48
48
|
"prepare": "husky",
|
|
49
49
|
"release": "node scripts/release.js",
|