@player-tools/devtools-profiler-web-plugin 0.6.1--canary.125.2996

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.
Files changed (38) hide show
  1. package/dist/cjs/index.cjs +847 -0
  2. package/dist/cjs/index.cjs.map +1 -0
  3. package/dist/index.legacy-esm.js +812 -0
  4. package/dist/index.mjs +812 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/package.json +42 -0
  7. package/src/WrapperComponent.tsx +121 -0
  8. package/src/__tests__/__snapshots__/index.test.tsx.snap +90 -0
  9. package/src/__tests__/index.test.tsx +307 -0
  10. package/src/constants/index.ts +28 -0
  11. package/src/content/common/Screen.tsx +20 -0
  12. package/src/content/common/index.ts +1 -0
  13. package/src/content/index.ts +19 -0
  14. package/src/content/navigation/index.ts +27 -0
  15. package/src/content/schema/index.ts +22 -0
  16. package/src/content/views/ProfilerView.tsx +75 -0
  17. package/src/content/views/index.ts +3 -0
  18. package/src/helpers/__tests__/genDataChangeTransaction.test.ts +40 -0
  19. package/src/helpers/__tests__/profiler.test.ts +104 -0
  20. package/src/helpers/genDataChangeTransaction.ts +39 -0
  21. package/src/helpers/index.ts +2 -0
  22. package/src/helpers/profiler.ts +111 -0
  23. package/src/index.tsx +490 -0
  24. package/src/types.ts +26 -0
  25. package/types/WrapperComponent.d.ts +4 -0
  26. package/types/constants/index.d.ts +15 -0
  27. package/types/content/common/Screen.d.ts +8 -0
  28. package/types/content/common/index.d.ts +2 -0
  29. package/types/content/index.d.ts +31 -0
  30. package/types/content/navigation/index.d.ts +7 -0
  31. package/types/content/schema/index.d.ts +23 -0
  32. package/types/content/views/ProfilerView.d.ts +3 -0
  33. package/types/content/views/index.d.ts +3 -0
  34. package/types/helpers/genDataChangeTransaction.d.ts +16 -0
  35. package/types/helpers/index.d.ts +3 -0
  36. package/types/helpers/profiler.d.ts +18 -0
  37. package/types/index.d.ts +7 -0
  38. package/types/types.d.ts +29 -0
@@ -0,0 +1,847 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/index.tsx
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ ProfilerPlugin: () => ProfilerPlugin
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var import_react2 = __toESM(require("react"));
37
+
38
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/constants/index.ts
39
+ var PLUGIN_ID = "player-ui-profiler-plugin";
40
+ var PLUGIN_NAME = "Player UI Profiler";
41
+ var PLUGIN_DESCRIPTION = "Standard Player UI Profiler";
42
+ var PLUGIN_VERSION = "0.0.1";
43
+ var INTERACTIONS = {
44
+ START_PROFILING: "start-profiling",
45
+ STOP_PROFILING: "stop-profiling"
46
+ };
47
+ var BASE_PLUGIN_DATA = {
48
+ id: PLUGIN_ID,
49
+ name: PLUGIN_NAME,
50
+ description: PLUGIN_DESCRIPTION,
51
+ version: PLUGIN_VERSION
52
+ };
53
+
54
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/WrapperComponent.tsx
55
+ var import_devtools_desktop_plugins_common = require("@player-tools/devtools-desktop-plugins-common");
56
+ var import_merge = require("dset/merge");
57
+ var import_immer = require("immer");
58
+ var import_react = __toESM(require("react"));
59
+
60
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/helpers/genDataChangeTransaction.ts
61
+ var NOOP_ID = -1;
62
+ var genDataChangeTransaction = ({
63
+ playerID,
64
+ data,
65
+ pluginID
66
+ }) => {
67
+ return {
68
+ id: NOOP_ID,
69
+ type: "PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE",
70
+ payload: {
71
+ pluginID,
72
+ data
73
+ },
74
+ sender: playerID,
75
+ context: "player",
76
+ target: "player",
77
+ timestamp: Date.now(),
78
+ _messenger_: true
79
+ };
80
+ };
81
+
82
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/helpers/profiler.ts
83
+ var profiler = () => {
84
+ let rootNode = {
85
+ name: "root",
86
+ children: []
87
+ };
88
+ let record = {};
89
+ let durations = [];
90
+ const start = () => {
91
+ rootNode = {
92
+ name: "root",
93
+ startTime: performance.now(),
94
+ children: []
95
+ };
96
+ record = {};
97
+ durations = [];
98
+ };
99
+ const addNodeToTree = (newNode, parentNode) => {
100
+ parentNode.children.push(newNode);
101
+ return newNode;
102
+ };
103
+ const startTimer = (hookName) => {
104
+ const startTime = performance.now();
105
+ if (!record[hookName] || record[hookName].length === 2) {
106
+ record[hookName] = [];
107
+ record[hookName].push(startTime);
108
+ }
109
+ };
110
+ const endTimer = ({
111
+ hookName,
112
+ parentNode = rootNode,
113
+ children
114
+ }) => {
115
+ let startTime;
116
+ let duration;
117
+ const endTime = performance.now();
118
+ for (const key in record) {
119
+ if (key === hookName && record[key].length === 1) {
120
+ [startTime] = record[key];
121
+ duration = endTime - startTime;
122
+ record[key].push(endTime);
123
+ }
124
+ }
125
+ const value = Math.ceil((duration || 0.01) * 1e3);
126
+ const newNode = {
127
+ name: hookName,
128
+ startTime,
129
+ endTime,
130
+ value,
131
+ tooltip: `${hookName}, ${(duration || 0.01).toFixed(4)} (ms)`,
132
+ children: children ?? []
133
+ };
134
+ addNodeToTree(newNode, parentNode);
135
+ durations.push({ hookName, duration: duration ? duration : 0.01 });
136
+ return newNode;
137
+ };
138
+ const stopProfiler = () => {
139
+ const endTime = performance.now();
140
+ const totalTime = endTime - (rootNode.startTime ?? 0);
141
+ rootNode.endTime = endTime;
142
+ rootNode.value = rootNode.children.reduce((acc, { value }) => acc += value ?? 0, 0) || Math.ceil((totalTime || 0.01) * 1e3);
143
+ rootNode.tooltip = `Profiler total time span ${totalTime.toFixed(4)} (ms)`;
144
+ durations.sort((a, b) => b.duration - a.duration);
145
+ return {
146
+ rootNode,
147
+ durations: durations.map(({ hookName, duration }) => ({
148
+ name: hookName,
149
+ duration: `${duration.toFixed(4)} ms`
150
+ }))
151
+ };
152
+ };
153
+ return {
154
+ start,
155
+ startTimer,
156
+ endTimer,
157
+ stopProfiler
158
+ };
159
+ };
160
+
161
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/_generated/index.json
162
+ var generated_default = {
163
+ id: "player-ui-profiler-plugin",
164
+ views: [
165
+ {
166
+ id: "Profiler",
167
+ type: "stacked-view",
168
+ header: {
169
+ asset: {
170
+ id: "Profiler-header",
171
+ type: "collection",
172
+ values: [
173
+ {
174
+ asset: {
175
+ id: "Profiler-header-values-0",
176
+ type: "action",
177
+ applicability: " {{profiling}} === true ",
178
+ exp: "@[ publish('stop-profiling') ]@",
179
+ label: {
180
+ asset: {
181
+ id: "Profiler-header-values-0-label",
182
+ type: "text",
183
+ value: "Stop"
184
+ }
185
+ }
186
+ }
187
+ },
188
+ {
189
+ asset: {
190
+ id: "Profiler-header-values-1",
191
+ type: "action",
192
+ applicability: " {{profiling}} === false ",
193
+ exp: "@[ publish('start-profiling') ]@",
194
+ label: {
195
+ asset: {
196
+ id: "Profiler-header-values-1-label",
197
+ type: "text",
198
+ value: "Start"
199
+ }
200
+ }
201
+ }
202
+ }
203
+ ]
204
+ }
205
+ },
206
+ main: {
207
+ asset: {
208
+ id: "Profiler-main",
209
+ type: "collection",
210
+ values: [
211
+ {
212
+ asset: {
213
+ id: "Profiler-main-values-0",
214
+ type: "table",
215
+ applicability: " {{displayFlameGraph}} === true ",
216
+ binding: "durations"
217
+ }
218
+ },
219
+ {
220
+ asset: {
221
+ id: "Profiler-main-values-1",
222
+ type: "flame-graph",
223
+ applicability: " {{displayFlameGraph}} === true ",
224
+ height: 200,
225
+ binding: "rootNode"
226
+ }
227
+ },
228
+ {
229
+ asset: {
230
+ id: "Profiler-main-values-2",
231
+ type: "text",
232
+ applicability: " {{displayFlameGraph}} === false && {{profiling}} === true",
233
+ value: "Profiling..."
234
+ }
235
+ },
236
+ {
237
+ asset: {
238
+ id: "Profiler-main-values-3",
239
+ type: "text",
240
+ applicability: " {{displayFlameGraph}} === false && {{profiling}} === false ",
241
+ value: "Start the profiler to generate the flame graph."
242
+ }
243
+ }
244
+ ]
245
+ }
246
+ }
247
+ }
248
+ ],
249
+ navigation: {
250
+ BEGIN: "Plugin",
251
+ Plugin: {
252
+ startState: "PROFILER",
253
+ PROFILER: {
254
+ state_type: "VIEW",
255
+ ref: "Profiler",
256
+ transitions: {
257
+ Profiler: "PROFILER"
258
+ }
259
+ }
260
+ }
261
+ },
262
+ schema: {
263
+ ROOT: {
264
+ playerConfig: {
265
+ type: "RecordType"
266
+ },
267
+ rootNode: {
268
+ type: "RecordType"
269
+ },
270
+ profiling: {
271
+ type: "BooleanType",
272
+ default: false,
273
+ validation: [
274
+ {
275
+ type: "oneOf",
276
+ message: "Value must be true or false",
277
+ options: [
278
+ true,
279
+ false
280
+ ]
281
+ }
282
+ ]
283
+ },
284
+ displayFlameGraph: {
285
+ type: "BooleanType",
286
+ default: false,
287
+ validation: [
288
+ {
289
+ type: "oneOf",
290
+ message: "Value must be true or false",
291
+ options: [
292
+ true,
293
+ false
294
+ ]
295
+ }
296
+ ]
297
+ },
298
+ durations: {
299
+ type: "durationsType",
300
+ isArray: true
301
+ }
302
+ },
303
+ durationsType: {
304
+ name: {
305
+ type: "StringType",
306
+ default: "",
307
+ validation: [
308
+ {
309
+ type: "string"
310
+ }
311
+ ],
312
+ format: {
313
+ type: "string"
314
+ }
315
+ },
316
+ duration: {
317
+ type: "StringType",
318
+ default: "",
319
+ validation: [
320
+ {
321
+ type: "string"
322
+ }
323
+ ],
324
+ format: {
325
+ type: "string"
326
+ }
327
+ }
328
+ }
329
+ },
330
+ data: {
331
+ rootNode: {
332
+ name: "profiler time span",
333
+ value: 0
334
+ },
335
+ displayFlameGraph: false,
336
+ profiling: false
337
+ }
338
+ };
339
+
340
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/WrapperComponent.tsx
341
+ var pluginData = {
342
+ ...BASE_PLUGIN_DATA,
343
+ flow: generated_default
344
+ };
345
+ var WrapperComponent = ({
346
+ children,
347
+ startProfiler,
348
+ stopProfiler
349
+ }) => {
350
+ const [state, playerID, dispatch] = (0, import_devtools_desktop_plugins_common.usePluginState)();
351
+ const lastProcessedInteraction = import_react.default.useRef(0);
352
+ const id = pluginData.id;
353
+ (0, import_react.useEffect)(() => {
354
+ const transaction = {
355
+ id: -1,
356
+ type: "PLAYER_DEVTOOLS_PLAYER_INIT",
357
+ payload: {
358
+ plugins: {
359
+ [id]: pluginData
360
+ }
361
+ },
362
+ sender: playerID,
363
+ context: "player",
364
+ target: "player",
365
+ timestamp: Date.now(),
366
+ _messenger_: true
367
+ };
368
+ dispatch(transaction);
369
+ }, []);
370
+ const processInteraction = (0, import_react.useCallback)(
371
+ (interaction) => {
372
+ const {
373
+ payload: { type }
374
+ } = interaction;
375
+ if (type === INTERACTIONS.START_PROFILING) {
376
+ startProfiler();
377
+ lastProcessedInteraction.current += 1;
378
+ const newState = (0, import_immer.produce)(state, (draft) => {
379
+ (0, import_merge.dset)(draft, ["plugins", id, "flow", "data", "rootNode"], {
380
+ name: "root",
381
+ children: []
382
+ });
383
+ (0, import_merge.dset)(draft, ["plugins", id, "flow", "data", "durations"], []);
384
+ (0, import_merge.dset)(draft, ["plugins", id, "flow", "data", "profiling"], true);
385
+ (0, import_merge.dset)(
386
+ draft,
387
+ ["plugins", id, "flow", "data", "displayFlameGraph"],
388
+ false
389
+ );
390
+ });
391
+ const transaction = genDataChangeTransaction({
392
+ playerID,
393
+ data: newState.plugins[id].flow.data,
394
+ pluginID: id
395
+ });
396
+ dispatch(transaction);
397
+ }
398
+ if (type === INTERACTIONS.STOP_PROFILING) {
399
+ const { rootNode, durations } = stopProfiler();
400
+ lastProcessedInteraction.current += 1;
401
+ const newState = (0, import_immer.produce)(state, (draft) => {
402
+ (0, import_merge.dset)(draft, ["plugins", id, "flow", "data", "rootNode"], rootNode);
403
+ (0, import_merge.dset)(draft, ["plugins", id, "flow", "data", "durations"], durations);
404
+ (0, import_merge.dset)(draft, ["plugins", id, "flow", "data", "profiling"], false);
405
+ (0, import_merge.dset)(
406
+ draft,
407
+ ["plugins", id, "flow", "data", "displayFlameGraph"],
408
+ true
409
+ );
410
+ });
411
+ const transaction = genDataChangeTransaction({
412
+ playerID,
413
+ data: newState.plugins[id].flow.data,
414
+ pluginID: id
415
+ });
416
+ dispatch(transaction);
417
+ }
418
+ },
419
+ [dispatch, id, state]
420
+ );
421
+ (0, import_react.useEffect)(() => {
422
+ if (lastProcessedInteraction.current < (state.interactions.length ?? 0)) {
423
+ state.interactions.slice(lastProcessedInteraction.current).forEach(processInteraction);
424
+ }
425
+ }, [state.interactions.length]);
426
+ return children;
427
+ };
428
+
429
+ // ../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/plugins/desktop/profiler/src/index.tsx
430
+ var ProfilerPlugin = class {
431
+ name = PLUGIN_ID;
432
+ checkIfDevtoolsIsActive() {
433
+ return localStorage.getItem("player-ui-devtools-active") === "true";
434
+ }
435
+ applyReact({ player, hooks: { webComponent } }) {
436
+ if (!this.checkIfDevtoolsIsActive()) {
437
+ return;
438
+ }
439
+ const { start, startTimer, endTimer, stopProfiler } = profiler();
440
+ const startProfiler = () => {
441
+ start();
442
+ player.hooks.onStart.intercept({
443
+ call: () => {
444
+ startTimer("onStart");
445
+ }
446
+ });
447
+ player.hooks.onStart.tap(this.name, () => {
448
+ endTimer({ hookName: "onStart" });
449
+ });
450
+ player.hooks.flowController.intercept({
451
+ call: (fc) => {
452
+ startTimer("flowController");
453
+ fc.hooks.flow.intercept({
454
+ call: () => {
455
+ startTimer("flow");
456
+ }
457
+ });
458
+ }
459
+ });
460
+ player.hooks.flowController.tap(this.name, (fc) => {
461
+ let flowControllerNode = {
462
+ name: "flowController",
463
+ children: []
464
+ };
465
+ fc.hooks.flow.tap(this.name, () => {
466
+ endTimer({ hookName: "flow", parentNode: flowControllerNode });
467
+ });
468
+ flowControllerNode = endTimer({
469
+ hookName: flowControllerNode.name,
470
+ children: flowControllerNode.children
471
+ });
472
+ });
473
+ player.hooks.viewController.intercept({
474
+ call: (vc) => {
475
+ startTimer("viewController");
476
+ vc.hooks.resolveView.intercept({
477
+ call: () => {
478
+ startTimer("resolveView");
479
+ }
480
+ });
481
+ vc.hooks.view.intercept({
482
+ call: () => {
483
+ startTimer("view");
484
+ }
485
+ });
486
+ }
487
+ });
488
+ player.hooks.viewController.tap(this.name, (vc) => {
489
+ let viewControllerNode = {
490
+ name: "viewController",
491
+ children: []
492
+ };
493
+ vc.hooks.resolveView.tap(this.name, (asset) => {
494
+ endTimer({ hookName: "resolveView", parentNode: viewControllerNode });
495
+ return asset;
496
+ });
497
+ viewControllerNode = endTimer({
498
+ hookName: viewControllerNode.name,
499
+ children: viewControllerNode.children
500
+ });
501
+ });
502
+ player.hooks.view.intercept({
503
+ call: (view) => {
504
+ startTimer("view");
505
+ view.hooks.onUpdate.intercept({
506
+ call: () => {
507
+ startTimer("onUpdate");
508
+ }
509
+ });
510
+ view.hooks.parser.intercept({
511
+ call: () => {
512
+ startTimer("parser");
513
+ }
514
+ });
515
+ view.hooks.resolver.intercept({
516
+ call: () => {
517
+ startTimer("resolver");
518
+ }
519
+ });
520
+ view.hooks.templatePlugin.intercept({
521
+ call: () => {
522
+ startTimer("templatePlugin");
523
+ }
524
+ });
525
+ }
526
+ });
527
+ player.hooks.view.tap(this.name, (view) => {
528
+ let viewNode = {
529
+ name: "view",
530
+ children: []
531
+ };
532
+ view.hooks.onUpdate.tap(this.name, () => {
533
+ endTimer({ hookName: "onUpdate", parentNode: viewNode });
534
+ });
535
+ view.hooks.parser.tap(this.name, () => {
536
+ endTimer({ hookName: "parser", parentNode: viewNode });
537
+ });
538
+ view.hooks.resolver.tap(this.name, () => {
539
+ endTimer({ hookName: "resolver", parentNode: viewNode });
540
+ });
541
+ view.hooks.templatePlugin.tap(this.name, () => {
542
+ endTimer({ hookName: "templatePlugin", parentNode: viewNode });
543
+ });
544
+ viewNode = endTimer({
545
+ hookName: viewNode.name,
546
+ children: viewNode.children
547
+ });
548
+ });
549
+ player.hooks.expressionEvaluator.intercept({
550
+ call: (ev) => {
551
+ startTimer("expressionEvaluator");
552
+ ev.hooks.resolve.intercept({
553
+ call: () => {
554
+ startTimer("resolve");
555
+ }
556
+ });
557
+ ev.hooks.onError.intercept({
558
+ call: () => {
559
+ startTimer("onError");
560
+ }
561
+ });
562
+ }
563
+ });
564
+ player.hooks.expressionEvaluator.tap(this.name, (ev) => {
565
+ let expressionEvaluatorNode = {
566
+ name: "expressionEvaluator",
567
+ children: []
568
+ };
569
+ ev.hooks.resolve.tap(this.name, () => {
570
+ endTimer({
571
+ hookName: "resolve",
572
+ parentNode: expressionEvaluatorNode
573
+ });
574
+ });
575
+ ev.hooks.onError.tap(this.name, () => {
576
+ endTimer({
577
+ hookName: "onError",
578
+ parentNode: expressionEvaluatorNode
579
+ });
580
+ return void 0;
581
+ });
582
+ expressionEvaluatorNode = endTimer({
583
+ hookName: expressionEvaluatorNode.name,
584
+ children: expressionEvaluatorNode.children
585
+ });
586
+ });
587
+ player.hooks.dataController.intercept({
588
+ call: (dc) => {
589
+ startTimer("dataController");
590
+ dc.hooks.resolve.intercept({
591
+ call: () => {
592
+ startTimer("resolve");
593
+ }
594
+ });
595
+ dc.hooks.resolveDataStages.intercept({
596
+ call: () => {
597
+ startTimer("resolveDataStages");
598
+ }
599
+ });
600
+ dc.hooks.resolveDefaultValue.intercept({
601
+ call: () => {
602
+ startTimer("resolveDefaultValue");
603
+ }
604
+ });
605
+ dc.hooks.onDelete.intercept({
606
+ call: () => {
607
+ startTimer("onDelete");
608
+ }
609
+ });
610
+ dc.hooks.onSet.intercept({
611
+ call: () => {
612
+ startTimer("onSet");
613
+ }
614
+ });
615
+ dc.hooks.onGet.intercept({
616
+ call: () => {
617
+ startTimer("onGet");
618
+ }
619
+ });
620
+ dc.hooks.onUpdate.intercept({
621
+ call: () => {
622
+ startTimer("onUpdate");
623
+ }
624
+ });
625
+ dc.hooks.format.intercept({
626
+ call: () => {
627
+ startTimer("resolve");
628
+ }
629
+ });
630
+ dc.hooks.deformat.intercept({
631
+ call: () => {
632
+ startTimer("deformat");
633
+ }
634
+ });
635
+ dc.hooks.serialize.intercept({
636
+ call: () => {
637
+ startTimer("serialize");
638
+ }
639
+ });
640
+ }
641
+ });
642
+ player.hooks.dataController.tap(this.name, (dc) => {
643
+ let dataControllerNode = {
644
+ name: "dataController",
645
+ children: []
646
+ };
647
+ dc.hooks.resolve.tap(this.name, () => {
648
+ endTimer({ hookName: "resolve", parentNode: dataControllerNode });
649
+ });
650
+ dc.hooks.resolveDataStages.tap(this.name, (dataPipeline) => {
651
+ endTimer({
652
+ hookName: "resolveDataStages",
653
+ parentNode: dataControllerNode
654
+ });
655
+ return dataPipeline;
656
+ });
657
+ dc.hooks.resolveDefaultValue.tap(this.name, () => {
658
+ endTimer({
659
+ hookName: "resolveDefaultValue",
660
+ parentNode: dataControllerNode
661
+ });
662
+ });
663
+ dc.hooks.onDelete.tap(this.name, () => {
664
+ endTimer({ hookName: "onDelete", parentNode: dataControllerNode });
665
+ });
666
+ dc.hooks.onSet.tap(this.name, () => {
667
+ endTimer({ hookName: "onSet", parentNode: dataControllerNode });
668
+ });
669
+ dc.hooks.onGet.tap(this.name, () => {
670
+ endTimer({ hookName: "onGet", parentNode: dataControllerNode });
671
+ });
672
+ dc.hooks.onUpdate.tap(this.name, () => {
673
+ endTimer({ hookName: "onUpdate", parentNode: dataControllerNode });
674
+ });
675
+ dc.hooks.format.tap(this.name, () => {
676
+ endTimer({ hookName: "format", parentNode: dataControllerNode });
677
+ });
678
+ dc.hooks.deformat.tap(this.name, () => {
679
+ endTimer({ hookName: "deformat", parentNode: dataControllerNode });
680
+ });
681
+ dc.hooks.serialize.tap(this.name, () => {
682
+ endTimer({ hookName: "serialize", parentNode: dataControllerNode });
683
+ });
684
+ dataControllerNode = endTimer({
685
+ hookName: dataControllerNode.name,
686
+ children: dataControllerNode.children
687
+ });
688
+ });
689
+ player.hooks.schema.intercept({
690
+ call: (sc) => {
691
+ startTimer("schema");
692
+ sc.hooks.resolveTypeForBinding.intercept({
693
+ call: () => {
694
+ startTimer("resolveTypeForBinding");
695
+ }
696
+ });
697
+ }
698
+ });
699
+ player.hooks.schema.tap(this.name, (sc) => {
700
+ let schemaNode = {
701
+ name: "schema",
702
+ children: []
703
+ };
704
+ sc.hooks.resolveTypeForBinding.tap(this.name, (dataType) => {
705
+ endTimer({
706
+ hookName: "resolveTypeForBinding",
707
+ parentNode: schemaNode
708
+ });
709
+ return dataType;
710
+ });
711
+ schemaNode = endTimer({
712
+ hookName: schemaNode.name,
713
+ children: schemaNode.children
714
+ });
715
+ });
716
+ player.hooks.validationController.intercept({
717
+ call: (vc) => {
718
+ startTimer("validationController");
719
+ vc.hooks.createValidatorRegistry.intercept({
720
+ call: () => {
721
+ startTimer("createValidatorRegistry");
722
+ }
723
+ });
724
+ vc.hooks.onAddValidation.intercept({
725
+ call: () => {
726
+ startTimer("onAddValidation");
727
+ }
728
+ });
729
+ vc.hooks.onRemoveValidation.intercept({
730
+ call: () => {
731
+ startTimer("onRemoveValidation");
732
+ }
733
+ });
734
+ }
735
+ });
736
+ player.hooks.validationController.tap(this.name, (vc) => {
737
+ let validationControllerNode = {
738
+ name: "validationController",
739
+ children: []
740
+ };
741
+ vc.hooks.createValidatorRegistry.tap(this.name, () => {
742
+ endTimer({
743
+ hookName: "createValidatorRegistry",
744
+ parentNode: validationControllerNode
745
+ });
746
+ });
747
+ vc.hooks.onAddValidation.tap(this.name, (validationResponse) => {
748
+ endTimer({
749
+ hookName: "onAddValidation",
750
+ parentNode: validationControllerNode
751
+ });
752
+ return validationResponse;
753
+ });
754
+ vc.hooks.onRemoveValidation.tap(this.name, (validationResponse) => {
755
+ endTimer({
756
+ hookName: "onRemoveValidation",
757
+ parentNode: validationControllerNode
758
+ });
759
+ return validationResponse;
760
+ });
761
+ validationControllerNode = endTimer({
762
+ hookName: validationControllerNode.name,
763
+ children: validationControllerNode.children
764
+ });
765
+ });
766
+ player.hooks.bindingParser.intercept({
767
+ call: (bp) => {
768
+ startTimer("bindingParser");
769
+ bp.hooks.skipOptimization.intercept({
770
+ call: () => {
771
+ startTimer("skipOptimization");
772
+ }
773
+ });
774
+ bp.hooks.beforeResolveNode.intercept({
775
+ call: () => {
776
+ startTimer("beforeResolveNode");
777
+ }
778
+ });
779
+ }
780
+ });
781
+ player.hooks.bindingParser.tap(this.name, (bp) => {
782
+ let bindingParserNode = {
783
+ name: "bindingParser",
784
+ children: []
785
+ };
786
+ bp.hooks.skipOptimization.tap(this.name, () => {
787
+ endTimer({
788
+ hookName: "skipOptimization",
789
+ parentNode: bindingParserNode
790
+ });
791
+ return void 0;
792
+ });
793
+ bp.hooks.beforeResolveNode.tap(this.name, (node) => {
794
+ endTimer({
795
+ hookName: "beforeResolveNode",
796
+ parentNode: bindingParserNode
797
+ });
798
+ return node;
799
+ });
800
+ bindingParserNode = endTimer({
801
+ hookName: bindingParserNode.name,
802
+ children: bindingParserNode.children
803
+ });
804
+ });
805
+ player.hooks.state.intercept({
806
+ call: () => {
807
+ startTimer("state");
808
+ }
809
+ });
810
+ player.hooks.state.tap(this.name, () => {
811
+ endTimer({ hookName: "state" });
812
+ });
813
+ player.hooks.onEnd.intercept({
814
+ call: () => {
815
+ startTimer("onEnd");
816
+ }
817
+ });
818
+ player.hooks.onEnd.tap(this.name, () => {
819
+ endTimer({ hookName: "onEnd" });
820
+ });
821
+ player.hooks.resolveFlowContent.intercept({
822
+ call: () => {
823
+ startTimer("resolveFlowContent");
824
+ }
825
+ });
826
+ player.hooks.resolveFlowContent.tap(this.name, (flow) => {
827
+ endTimer({ hookName: "resolveFlowContent" });
828
+ return flow;
829
+ });
830
+ };
831
+ webComponent.tap(this.name, (Comp) => () => {
832
+ return /* @__PURE__ */ import_react2.default.createElement(
833
+ WrapperComponent,
834
+ {
835
+ startProfiler,
836
+ stopProfiler
837
+ },
838
+ /* @__PURE__ */ import_react2.default.createElement(Comp, null)
839
+ );
840
+ });
841
+ }
842
+ };
843
+ // Annotate the CommonJS export names for ESM import in node:
844
+ 0 && (module.exports = {
845
+ ProfilerPlugin
846
+ });
847
+ //# sourceMappingURL=index.cjs.map