@xbg.solutions/bpsk-utils-performance 1.2.3

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/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './utils/performance';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,4 @@
1
+ // Performance package barrel exports
2
+ // Utils
3
+ export * from './utils/performance';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,QAAQ;AACR,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Performance monitoring utilities
3
+ */
4
+ export declare class PerformanceMonitor {
5
+ private metrics;
6
+ private observers;
7
+ constructor();
8
+ private initializeObservers;
9
+ /**
10
+ * Record a performance metric
11
+ */
12
+ recordMetric(name: string, value: number): void;
13
+ /**
14
+ * Get metrics summary
15
+ */
16
+ getMetrics(name?: string): Record<string, any>;
17
+ /**
18
+ * Measure function execution time
19
+ */
20
+ measure<T>(name: string, fn: () => T): T;
21
+ /**
22
+ * Measure async function execution time
23
+ */
24
+ measureAsync<T>(name: string, fn: () => Promise<T>): Promise<T>;
25
+ /**
26
+ * Clear all metrics
27
+ */
28
+ clear(): void;
29
+ /**
30
+ * Cleanup observers
31
+ */
32
+ cleanup(): void;
33
+ }
34
+ export declare const performanceMonitor: PerformanceMonitor;
35
+ /**
36
+ * Debounce function for performance optimization
37
+ */
38
+ export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
39
+ /**
40
+ * Throttle function for performance optimization
41
+ */
42
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
43
+ /**
44
+ * Lazy loading utility for images
45
+ */
46
+ export declare function lazyLoadImages(selector?: string): void;
47
+ /**
48
+ * Critical resource preloader
49
+ */
50
+ export declare function preloadResource(href: string, as?: string): void;
51
+ /**
52
+ * Bundle analyzer data collector
53
+ */
54
+ export declare function getBundleAnalytics(): {
55
+ pageLoad: {
56
+ domContentLoaded: number;
57
+ loadComplete: number;
58
+ firstByte: number;
59
+ domInteractive: number;
60
+ };
61
+ resources: {
62
+ scripts: number;
63
+ stylesheets: number;
64
+ images: number;
65
+ total: number;
66
+ };
67
+ timing: {
68
+ dns: number;
69
+ tcp: number;
70
+ ssl: number;
71
+ request: number;
72
+ response: number;
73
+ };
74
+ } | null;
75
+ /**
76
+ * Web Vitals monitoring
77
+ */
78
+ export interface WebVital {
79
+ name: string;
80
+ value: number;
81
+ rating: 'good' | 'needs-improvement' | 'poor';
82
+ }
83
+ export declare function getWebVitals(): Promise<WebVital[]>;
84
+ /**
85
+ * Performance audit for production readiness
86
+ */
87
+ export declare function performanceAudit(): Promise<{
88
+ score: number;
89
+ vitals: WebVital[];
90
+ recommendations: string[];
91
+ metrics: any;
92
+ }>;
93
+ //# sourceMappingURL=performance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/utils/performance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,SAAS,CAA6B;;IAQ9C,OAAO,CAAC,mBAAmB;IAoB3B;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAOxC;;OAEG;IACH,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM;IAoBxB;;OAEG;IACH,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAQxC;;OA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,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,GAAG,CAAC;CACd,CAAC,CAoCD"}
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Performance monitoring utilities
3
+ */
4
+ // Performance metrics tracking
5
+ export class PerformanceMonitor {
6
+ constructor() {
7
+ this.metrics = new Map();
8
+ this.observers = [];
9
+ if (typeof window !== 'undefined') {
10
+ this.initializeObservers();
11
+ }
12
+ }
13
+ initializeObservers() {
14
+ // Web Vitals observer
15
+ if ('PerformanceObserver' in window) {
16
+ const vitalsObserver = new PerformanceObserver((list) => {
17
+ for (const entry of list.getEntries()) {
18
+ this.recordMetric(`web-vital-${entry.name}`, entry.value || 0);
19
+ }
20
+ });
21
+ try {
22
+ vitalsObserver.observe({ type: 'largest-contentful-paint', buffered: true });
23
+ vitalsObserver.observe({ type: 'first-input', buffered: true });
24
+ vitalsObserver.observe({ type: 'layout-shift', buffered: true });
25
+ this.observers.push(vitalsObserver);
26
+ }
27
+ catch (e) {
28
+ console.warn('Some performance observers not supported:', e);
29
+ }
30
+ }
31
+ }
32
+ /**
33
+ * Record a performance metric
34
+ */
35
+ recordMetric(name, value) {
36
+ if (!this.metrics.has(name)) {
37
+ this.metrics.set(name, []);
38
+ }
39
+ this.metrics.get(name).push(value);
40
+ }
41
+ /**
42
+ * Get metrics summary
43
+ */
44
+ getMetrics(name) {
45
+ if (name) {
46
+ const values = this.metrics.get(name) || [];
47
+ return {
48
+ name,
49
+ count: values.length,
50
+ min: Math.min(...values),
51
+ max: Math.max(...values),
52
+ avg: values.reduce((a, b) => a + b, 0) / values.length || 0,
53
+ values
54
+ };
55
+ }
56
+ const summary = {};
57
+ for (const [metricName] of this.metrics) {
58
+ summary[metricName] = this.getMetrics(metricName);
59
+ }
60
+ return summary;
61
+ }
62
+ /**
63
+ * Measure function execution time
64
+ */
65
+ measure(name, fn) {
66
+ const start = performance.now();
67
+ const result = fn();
68
+ const end = performance.now();
69
+ this.recordMetric(name, end - start);
70
+ return result;
71
+ }
72
+ /**
73
+ * Measure async function execution time
74
+ */
75
+ async measureAsync(name, fn) {
76
+ const start = performance.now();
77
+ const result = await fn();
78
+ const end = performance.now();
79
+ this.recordMetric(name, end - start);
80
+ return result;
81
+ }
82
+ /**
83
+ * Clear all metrics
84
+ */
85
+ clear() {
86
+ this.metrics.clear();
87
+ }
88
+ /**
89
+ * Cleanup observers
90
+ */
91
+ cleanup() {
92
+ this.observers.forEach(observer => observer.disconnect());
93
+ this.observers = [];
94
+ }
95
+ }
96
+ // Singleton instance
97
+ export const performanceMonitor = new PerformanceMonitor();
98
+ /**
99
+ * Debounce function for performance optimization
100
+ */
101
+ export function debounce(func, wait) {
102
+ let timeout;
103
+ return (...args) => {
104
+ clearTimeout(timeout);
105
+ timeout = setTimeout(() => func.apply(null, args), wait);
106
+ };
107
+ }
108
+ /**
109
+ * Throttle function for performance optimization
110
+ */
111
+ export function throttle(func, limit) {
112
+ let inThrottle;
113
+ return (...args) => {
114
+ if (!inThrottle) {
115
+ func.apply(null, args);
116
+ inThrottle = true;
117
+ setTimeout(() => inThrottle = false, limit);
118
+ }
119
+ };
120
+ }
121
+ /**
122
+ * Lazy loading utility for images
123
+ */
124
+ export function lazyLoadImages(selector = 'img[data-src]') {
125
+ if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
126
+ return;
127
+ }
128
+ const imageObserver = new IntersectionObserver((entries, observer) => {
129
+ entries.forEach(entry => {
130
+ if (entry.isIntersecting) {
131
+ const img = entry.target;
132
+ img.src = img.dataset.src;
133
+ img.classList.remove('lazy');
134
+ observer.unobserve(img);
135
+ }
136
+ });
137
+ });
138
+ document.querySelectorAll(selector).forEach(img => {
139
+ imageObserver.observe(img);
140
+ });
141
+ }
142
+ /**
143
+ * Critical resource preloader
144
+ */
145
+ export function preloadResource(href, as = 'fetch') {
146
+ if (typeof window === 'undefined')
147
+ return;
148
+ const link = document.createElement('link');
149
+ link.rel = 'preload';
150
+ link.href = href;
151
+ link.as = as;
152
+ document.head.appendChild(link);
153
+ }
154
+ /**
155
+ * Bundle analyzer data collector
156
+ */
157
+ export function getBundleAnalytics() {
158
+ if (typeof window === 'undefined')
159
+ return null;
160
+ const navigation = performance.getEntriesByType('navigation')[0];
161
+ const resources = performance.getEntriesByType('resource');
162
+ return {
163
+ pageLoad: {
164
+ domContentLoaded: navigation.domContentLoadedEventEnd - navigation.domContentLoadedEventStart,
165
+ loadComplete: navigation.loadEventEnd - navigation.loadEventStart,
166
+ firstByte: navigation.responseStart - navigation.requestStart,
167
+ domInteractive: navigation.domInteractive - navigation.fetchStart,
168
+ },
169
+ resources: {
170
+ scripts: resources.filter(r => r.initiatorType === 'script').length,
171
+ stylesheets: resources.filter(r => r.initiatorType === 'css').length,
172
+ images: resources.filter(r => r.initiatorType === 'img').length,
173
+ total: resources.length
174
+ },
175
+ timing: {
176
+ dns: navigation.domainLookupEnd - navigation.domainLookupStart,
177
+ tcp: navigation.connectEnd - navigation.connectStart,
178
+ ssl: navigation.secureConnectionStart ? navigation.connectEnd - navigation.secureConnectionStart : 0,
179
+ request: navigation.responseStart - navigation.requestStart,
180
+ response: navigation.responseEnd - navigation.responseStart,
181
+ }
182
+ };
183
+ }
184
+ export function getWebVitals() {
185
+ return new Promise((resolve) => {
186
+ const vitals = [];
187
+ if (typeof window === 'undefined') {
188
+ resolve(vitals);
189
+ return;
190
+ }
191
+ // LCP (Largest Contentful Paint)
192
+ try {
193
+ const lcpObserver = new PerformanceObserver((list) => {
194
+ const entries = list.getEntries();
195
+ const lastEntry = entries[entries.length - 1];
196
+ if (lastEntry) {
197
+ const value = lastEntry.startTime;
198
+ vitals.push({
199
+ name: 'LCP',
200
+ value: Math.round(value),
201
+ rating: value <= 2500 ? 'good' : value <= 4000 ? 'needs-improvement' : 'poor'
202
+ });
203
+ }
204
+ });
205
+ lcpObserver.observe({ type: 'largest-contentful-paint', buffered: true });
206
+ }
207
+ catch (e) {
208
+ console.debug('LCP not supported');
209
+ }
210
+ // FID (First Input Delay)
211
+ try {
212
+ const fidObserver = new PerformanceObserver((list) => {
213
+ const entries = list.getEntries();
214
+ entries.forEach((entry) => {
215
+ const value = entry.processingStart - entry.startTime;
216
+ vitals.push({
217
+ name: 'FID',
218
+ value: Math.round(value),
219
+ rating: value <= 100 ? 'good' : value <= 300 ? 'needs-improvement' : 'poor'
220
+ });
221
+ });
222
+ });
223
+ fidObserver.observe({ type: 'first-input', buffered: true });
224
+ }
225
+ catch (e) {
226
+ console.debug('FID not supported');
227
+ }
228
+ // CLS (Cumulative Layout Shift)
229
+ try {
230
+ let clsValue = 0;
231
+ const clsObserver = new PerformanceObserver((list) => {
232
+ const entries = list.getEntries();
233
+ entries.forEach((entry) => {
234
+ if (!entry.hadRecentInput) {
235
+ clsValue += entry.value;
236
+ }
237
+ });
238
+ vitals.push({
239
+ name: 'CLS',
240
+ value: Math.round(clsValue * 1000) / 1000,
241
+ rating: clsValue <= 0.1 ? 'good' : clsValue <= 0.25 ? 'needs-improvement' : 'poor'
242
+ });
243
+ });
244
+ clsObserver.observe({ type: 'layout-shift', buffered: true });
245
+ }
246
+ catch (e) {
247
+ console.debug('CLS not supported');
248
+ }
249
+ // Return vitals after 2 seconds
250
+ setTimeout(() => resolve(vitals), 2000);
251
+ });
252
+ }
253
+ /**
254
+ * Performance audit for production readiness
255
+ */
256
+ export async function performanceAudit() {
257
+ const vitals = await getWebVitals();
258
+ const metrics = getBundleAnalytics();
259
+ const recommendations = [];
260
+ let score = 100;
261
+ // Check Web Vitals
262
+ vitals.forEach(vital => {
263
+ if (vital.rating === 'poor') {
264
+ score -= 30;
265
+ recommendations.push(`Improve ${vital.name}: ${vital.value}ms is in poor range`);
266
+ }
267
+ else if (vital.rating === 'needs-improvement') {
268
+ score -= 15;
269
+ recommendations.push(`Optimize ${vital.name}: ${vital.value}ms needs improvement`);
270
+ }
271
+ });
272
+ // Check bundle size
273
+ if (metrics) {
274
+ const { resources } = metrics;
275
+ if (resources.scripts > 10) {
276
+ score -= 10;
277
+ recommendations.push('Consider reducing number of JavaScript files');
278
+ }
279
+ if (resources.stylesheets > 5) {
280
+ score -= 5;
281
+ recommendations.push('Consider consolidating CSS files');
282
+ }
283
+ }
284
+ return {
285
+ score: Math.max(0, score),
286
+ vitals,
287
+ recommendations,
288
+ metrics
289
+ };
290
+ }
291
+ // Initialize performance monitoring in development
292
+ if (import.meta.env.DEV && typeof window !== 'undefined') {
293
+ window.addEventListener('load', () => {
294
+ setTimeout(async () => {
295
+ const audit = await performanceAudit();
296
+ console.group('🚀 Performance Audit');
297
+ console.log(`Score: ${audit.score}/100`);
298
+ console.log('Web Vitals:', audit.vitals);
299
+ if (audit.recommendations.length > 0) {
300
+ console.log('Recommendations:', audit.recommendations);
301
+ }
302
+ console.groupEnd();
303
+ }, 2000);
304
+ });
305
+ }
306
+ //# sourceMappingURL=performance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../src/utils/performance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+BAA+B;AAC/B,MAAM,OAAO,kBAAkB;IAI7B;QAHQ,YAAO,GAA0B,IAAI,GAAG,EAAE,CAAC;QAC3C,cAAS,GAA0B,EAAE,CAAC;QAG5C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAEO,mBAAmB;QACzB,sBAAsB;QACtB,IAAI,qBAAqB,IAAI,MAAM,EAAE,CAAC;YACpC,MAAM,cAAc,GAAG,IAAI,mBAAmB,CAAC,CAAC,IAAI,EAAE,EAAE;gBACtD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;oBACtC,IAAI,CAAC,YAAY,CAAC,aAAa,KAAK,CAAC,IAAI,EAAE,EAAG,KAAa,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;gBAC1E,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC;gBACH,cAAc,CAAC,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K,CAAC;QACzB,MAAM;QACN,eAAe;QACf,OAAO;KACR,CAAC;AACJ,CAAC;AAED,mDAAmD;AACnD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACzD,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;QACnC,UAAU,CAAC,KAAK,IAAI,EAAE;YACpB,MAAM,KAAK,GAAG,MAAM,gBAAgB,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,KAAK,MAAM,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACzC,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACrC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;YACzD,CAAC;YACD,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@xbg.solutions/bpsk-utils-performance",
3
+ "version": "1.2.3",
4
+ "description": "XBG Performance - Metrics and monitoring",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "type": "module",
8
+ "files": ["lib"],
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "build:watch": "tsc --watch",
12
+ "clean": "rm -rf lib",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "dependencies": {
19
+ "@xbg.solutions/bpsk-core": "^1.0.0"
20
+ }
21
+ }