@player-ui/metrics-plugin-react 0.8.0--canary.307.9621 → 0.8.0-next.0

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.
@@ -0,0 +1,68 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/metrics/react/src/index.tsx
32
+ var src_exports = {};
33
+ __export(src_exports, {
34
+ MetricsPlugin: () => MetricsPlugin
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+ var import_react = __toESM(require("react"));
38
+ var import_metrics_plugin = require("@player-ui/metrics-plugin");
39
+ __reExport(src_exports, require("@player-ui/metrics-plugin"), module.exports);
40
+ var MetricsPlugin = class extends import_metrics_plugin.MetricsCorePlugin {
41
+ constructor(options) {
42
+ super({
43
+ trackRenderTime: options?.trackRenderTime ?? true,
44
+ trackUpdateTime: options?.trackUpdateTime ?? true,
45
+ ...options ?? {}
46
+ });
47
+ }
48
+ applyReact(reactPlayer) {
49
+ if (!this.trackRender) {
50
+ return;
51
+ }
52
+ const endRender = () => {
53
+ this.renderEnd();
54
+ };
55
+ reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {
56
+ return function MetricsWrapper(props) {
57
+ import_react.default.useEffect(endRender);
58
+ return /* @__PURE__ */ import_react.default.createElement(Comp, { ...props });
59
+ };
60
+ });
61
+ }
62
+ };
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ MetricsPlugin,
66
+ ...require("@player-ui/metrics-plugin")
67
+ });
68
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/metrics/react/src/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ReactPlayer, ReactPlayerPlugin } from \"@player-ui/react\";\nimport type { MetricsWebPluginOptions } from \"@player-ui/metrics-plugin\";\nimport { MetricsCorePlugin } from \"@player-ui/metrics-plugin\";\n\nexport * from \"@player-ui/metrics-plugin\";\n\n/** A plugin to add render metrics to Player */\nexport class MetricsPlugin\n extends MetricsCorePlugin\n implements ReactPlayerPlugin\n{\n constructor(options?: MetricsWebPluginOptions) {\n // Default to `true` for tracking metrics\n super({\n trackRenderTime: options?.trackRenderTime ?? true,\n trackUpdateTime: options?.trackUpdateTime ?? true,\n ...(options ?? {}),\n });\n }\n\n applyReact(reactPlayer: ReactPlayer) {\n if (!this.trackRender) {\n return;\n }\n\n /** Callback to complete the render lifecycle */\n const endRender = () => {\n this.renderEnd();\n };\n\n reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {\n return function MetricsWrapper(props) {\n React.useEffect(endRender);\n\n return <Comp {...props} />;\n };\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGlB,4BAAkC;AAElC,wBAAc,sCALd;AAQO,IAAM,gBAAN,cACG,wCAEV;AAAA,EACE,YAAY,SAAmC;AAE7C,UAAM;AAAA,MACJ,iBAAiB,SAAS,mBAAmB;AAAA,MAC7C,iBAAiB,SAAS,mBAAmB;AAAA,MAC7C,GAAI,WAAW,CAAC;AAAA,IAClB,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,aAA0B;AACnC,QAAI,CAAC,KAAK,aAAa;AACrB;AAAA,IACF;AAGA,UAAM,YAAY,MAAM;AACtB,WAAK,UAAU;AAAA,IACjB;AAEA,gBAAY,MAAM,gBAAgB,IAAI,KAAK,MAAM,CAAC,SAAS;AACzD,aAAO,SAAS,eAAe,OAAO;AACpC,qBAAAA,QAAM,UAAU,SAAS;AAEzB,eAAO,6BAAAA,QAAA,cAAC,QAAM,GAAG,OAAO;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":["React"]}
@@ -0,0 +1,31 @@
1
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/metrics/react/src/index.tsx
2
+ import React from "react";
3
+ import { MetricsCorePlugin } from "@player-ui/metrics-plugin";
4
+ export * from "@player-ui/metrics-plugin";
5
+ var MetricsPlugin = class extends MetricsCorePlugin {
6
+ constructor(options) {
7
+ super({
8
+ trackRenderTime: options?.trackRenderTime ?? true,
9
+ trackUpdateTime: options?.trackUpdateTime ?? true,
10
+ ...options ?? {}
11
+ });
12
+ }
13
+ applyReact(reactPlayer) {
14
+ if (!this.trackRender) {
15
+ return;
16
+ }
17
+ const endRender = () => {
18
+ this.renderEnd();
19
+ };
20
+ reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {
21
+ return function MetricsWrapper(props) {
22
+ React.useEffect(endRender);
23
+ return /* @__PURE__ */ React.createElement(Comp, { ...props });
24
+ };
25
+ });
26
+ }
27
+ };
28
+ export {
29
+ MetricsPlugin
30
+ };
31
+ //# sourceMappingURL=index.mjs.map
package/dist/index.mjs ADDED
@@ -0,0 +1,31 @@
1
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/metrics/react/src/index.tsx
2
+ import React from "react";
3
+ import { MetricsCorePlugin } from "@player-ui/metrics-plugin";
4
+ export * from "@player-ui/metrics-plugin";
5
+ var MetricsPlugin = class extends MetricsCorePlugin {
6
+ constructor(options) {
7
+ super({
8
+ trackRenderTime: options?.trackRenderTime ?? true,
9
+ trackUpdateTime: options?.trackUpdateTime ?? true,
10
+ ...options ?? {}
11
+ });
12
+ }
13
+ applyReact(reactPlayer) {
14
+ if (!this.trackRender) {
15
+ return;
16
+ }
17
+ const endRender = () => {
18
+ this.renderEnd();
19
+ };
20
+ reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {
21
+ return function MetricsWrapper(props) {
22
+ React.useEffect(endRender);
23
+ return /* @__PURE__ */ React.createElement(Comp, { ...props });
24
+ };
25
+ });
26
+ }
27
+ };
28
+ export {
29
+ MetricsPlugin
30
+ };
31
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/metrics/react/src/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ReactPlayer, ReactPlayerPlugin } from \"@player-ui/react\";\nimport type { MetricsWebPluginOptions } from \"@player-ui/metrics-plugin\";\nimport { MetricsCorePlugin } from \"@player-ui/metrics-plugin\";\n\nexport * from \"@player-ui/metrics-plugin\";\n\n/** A plugin to add render metrics to Player */\nexport class MetricsPlugin\n extends MetricsCorePlugin\n implements ReactPlayerPlugin\n{\n constructor(options?: MetricsWebPluginOptions) {\n // Default to `true` for tracking metrics\n super({\n trackRenderTime: options?.trackRenderTime ?? true,\n trackUpdateTime: options?.trackUpdateTime ?? true,\n ...(options ?? {}),\n });\n }\n\n applyReact(reactPlayer: ReactPlayer) {\n if (!this.trackRender) {\n return;\n }\n\n /** Callback to complete the render lifecycle */\n const endRender = () => {\n this.renderEnd();\n };\n\n reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {\n return function MetricsWrapper(props) {\n React.useEffect(endRender);\n\n return <Comp {...props} />;\n };\n });\n }\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAGlB,SAAS,yBAAyB;AAElC,cAAc;AAGP,IAAM,gBAAN,cACG,kBAEV;AAAA,EACE,YAAY,SAAmC;AAE7C,UAAM;AAAA,MACJ,iBAAiB,SAAS,mBAAmB;AAAA,MAC7C,iBAAiB,SAAS,mBAAmB;AAAA,MAC7C,GAAI,WAAW,CAAC;AAAA,IAClB,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,aAA0B;AACnC,QAAI,CAAC,KAAK,aAAa;AACrB;AAAA,IACF;AAGA,UAAM,YAAY,MAAM;AACtB,WAAK,UAAU;AAAA,IACjB;AAEA,gBAAY,MAAM,gBAAgB,IAAI,KAAK,MAAM,CAAC,SAAS;AACzD,aAAO,SAAS,eAAe,OAAO;AACpC,cAAM,UAAU,SAAS;AAEzB,eAAO,oCAAC,QAAM,GAAG,OAAO;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
package/package.json CHANGED
@@ -1,68 +1,32 @@
1
1
  {
2
2
  "name": "@player-ui/metrics-plugin-react",
3
- "version": "0.8.0--canary.307.9621",
4
- "private": false,
5
- "publishConfig": {
6
- "registry": "https://registry.npmjs.org"
3
+ "version": "0.8.0-next.0",
4
+ "main": "dist/cjs/index.cjs",
5
+ "dependencies": {
6
+ "@player-ui/metrics-plugin": "0.8.0-next.0",
7
+ "tslib": "^2.6.2"
7
8
  },
8
9
  "peerDependencies": {
9
- "react": "^17.0.2",
10
- "@player-ui/player": "0.8.0--canary.307.9621",
11
- "@player-ui/react": "0.8.0--canary.307.9621"
12
- },
13
- "dependencies": {
14
- "@player-ui/metrics-plugin": "0.8.0--canary.307.9621",
15
- "@babel/runtime": "7.15.4"
10
+ "@player-ui/player": "0.8.0-next.0",
11
+ "@player-ui/react": "0.8.0-next.0",
12
+ "react": "^18.2.0",
13
+ "@types/react": "^18.2.39"
16
14
  },
17
- "main": "dist/index.cjs.js",
18
- "module": "dist/index.esm.js",
19
- "typings": "dist/index.d.ts",
15
+ "module": "dist/index.legacy-esm.js",
16
+ "types": "types/index.d.ts",
20
17
  "sideEffects": false,
21
- "license": "MIT",
22
- "repository": {
23
- "type": "git",
24
- "url": "https://github.com/player-ui/player-ui"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/player-ui/player-ui/issues"
28
- },
29
- "homepage": "https://player-ui.github.io",
30
- "contributors": [
31
- {
32
- "name": "Adam Dierkens",
33
- "url": "https://github.com/adierkens"
34
- },
35
- {
36
- "name": "Spencer Hamm",
37
- "url": "https://github.com/spentacular"
38
- },
39
- {
40
- "name": "Harris Borawski",
41
- "url": "https://github.com/hborawski"
42
- },
43
- {
44
- "name": "Jeremiah Zucker",
45
- "url": "https://github.com/sugarmanz"
46
- },
47
- {
48
- "name": "Ketan Reddy",
49
- "url": "https://github.com/KetanReddy"
50
- },
51
- {
52
- "name": "Brocollie08",
53
- "url": "https://github.com/brocollie08"
54
- },
55
- {
56
- "name": "Kelly Harrop",
57
- "url": "https://github.com/kharrop"
58
- },
59
- {
60
- "name": "Alejandro Fimbres",
61
- "url": "https://github.com/lexfm"
62
- },
63
- {
64
- "name": "Rafael Campos",
65
- "url": "https://github.com/rafbcampos"
18
+ "exports": {
19
+ "./package.json": "./package.json",
20
+ "./dist/index.css": "./dist/index.css",
21
+ ".": {
22
+ "types": "./types/index.d.ts",
23
+ "import": "./dist/index.mjs",
24
+ "default": "./dist/cjs/index.cjs"
66
25
  }
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "src",
30
+ "types"
67
31
  ]
68
32
  }
package/src/index.tsx CHANGED
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
- import type { ReactPlayer, ReactPlayerPlugin } from '@player-ui/react';
3
- import type { MetricsWebPluginOptions } from '@player-ui/metrics-plugin';
4
- import { MetricsCorePlugin } from '@player-ui/metrics-plugin';
1
+ import React from "react";
2
+ import type { ReactPlayer, ReactPlayerPlugin } from "@player-ui/react";
3
+ import type { MetricsWebPluginOptions } from "@player-ui/metrics-plugin";
4
+ import { MetricsCorePlugin } from "@player-ui/metrics-plugin";
5
5
 
6
- export * from '@player-ui/metrics-plugin';
6
+ export * from "@player-ui/metrics-plugin";
7
7
 
8
8
  /** A plugin to add render metrics to Player */
9
9
  export class MetricsPlugin
@@ -30,7 +30,7 @@ export class MetricsPlugin
30
30
  };
31
31
 
32
32
  reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {
33
- return (props) => {
33
+ return function MetricsWrapper(props) {
34
34
  React.useEffect(endRender);
35
35
 
36
36
  return <Comp {...props} />;
@@ -0,0 +1,10 @@
1
+ import type { ReactPlayer, ReactPlayerPlugin } from "@player-ui/react";
2
+ import type { MetricsWebPluginOptions } from "@player-ui/metrics-plugin";
3
+ import { MetricsCorePlugin } from "@player-ui/metrics-plugin";
4
+ export * from "@player-ui/metrics-plugin";
5
+ /** A plugin to add render metrics to Player */
6
+ export declare class MetricsPlugin extends MetricsCorePlugin implements ReactPlayerPlugin {
7
+ constructor(options?: MetricsWebPluginOptions);
8
+ applyReact(reactPlayer: ReactPlayer): void;
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.cjs.js DELETED
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var metricsPlugin = require('@player-ui/metrics-plugin');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
-
12
- var __defProp = Object.defineProperty;
13
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
- var __spreadValues = (a, b) => {
18
- for (var prop in b || (b = {}))
19
- if (__hasOwnProp.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- if (__getOwnPropSymbols)
22
- for (var prop of __getOwnPropSymbols(b)) {
23
- if (__propIsEnum.call(b, prop))
24
- __defNormalProp(a, prop, b[prop]);
25
- }
26
- return a;
27
- };
28
- class MetricsPlugin extends metricsPlugin.MetricsCorePlugin {
29
- constructor(options) {
30
- super(__spreadValues({
31
- trackRenderTime: (_a = options == null ? void 0 : options.trackRenderTime) != null ? _a : true,
32
- trackUpdateTime: (_b = options == null ? void 0 : options.trackUpdateTime) != null ? _b : true
33
- }, options != null ? options : {}));
34
- var _a, _b;
35
- }
36
- applyReact(reactPlayer) {
37
- if (!this.trackRender) {
38
- return;
39
- }
40
- const endRender = () => {
41
- this.renderEnd();
42
- };
43
- reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {
44
- return (props) => {
45
- React__default["default"].useEffect(endRender);
46
- return /* @__PURE__ */ React__default["default"].createElement(Comp, __spreadValues({}, props));
47
- };
48
- });
49
- }
50
- }
51
-
52
- exports.MetricsPlugin = MetricsPlugin;
53
- Object.keys(metricsPlugin).forEach(function (k) {
54
- if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
55
- enumerable: true,
56
- get: function () { return metricsPlugin[k]; }
57
- });
58
- });
59
- //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { ReactPlayerPlugin, ReactPlayer } from '@player-ui/react';
2
- import { MetricsCorePlugin, MetricsWebPluginOptions } from '@player-ui/metrics-plugin';
3
- export * from '@player-ui/metrics-plugin';
4
-
5
- /** A plugin to add render metrics to Player */
6
- declare class MetricsPlugin extends MetricsCorePlugin implements ReactPlayerPlugin {
7
- constructor(options?: MetricsWebPluginOptions);
8
- applyReact(reactPlayer: ReactPlayer): void;
9
- }
10
-
11
- export { MetricsPlugin };
package/dist/index.esm.js DELETED
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import { MetricsCorePlugin } from '@player-ui/metrics-plugin';
3
- export * from '@player-ui/metrics-plugin';
4
-
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- class MetricsPlugin extends MetricsCorePlugin {
22
- constructor(options) {
23
- super(__spreadValues({
24
- trackRenderTime: (_a = options == null ? void 0 : options.trackRenderTime) != null ? _a : true,
25
- trackUpdateTime: (_b = options == null ? void 0 : options.trackUpdateTime) != null ? _b : true
26
- }, options != null ? options : {}));
27
- var _a, _b;
28
- }
29
- applyReact(reactPlayer) {
30
- if (!this.trackRender) {
31
- return;
32
- }
33
- const endRender = () => {
34
- this.renderEnd();
35
- };
36
- reactPlayer.hooks.playerComponent.tap(this.name, (Comp) => {
37
- return (props) => {
38
- React.useEffect(endRender);
39
- return /* @__PURE__ */ React.createElement(Comp, __spreadValues({}, props));
40
- };
41
- });
42
- }
43
- }
44
-
45
- export { MetricsPlugin };
46
- //# sourceMappingURL=index.esm.js.map