@whnz/frontend-experience-react 1.0.0 → 1.0.1
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 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ErrorBoundary.ts","../src/Profiler.tsx"],"names":["report"],"mappings":";;;;;AAGO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM,SAAA,CAEtC;AAAA,EACD,iBAAA,CAAkB,OAAc,IAAA,EAAW;AACzC,IAAA,MAAA,CAAO;AAAA,MACL,IAAA,EAAM,aAAA;AAAA,MACN,SAAA,EAAW,KAAK,GAAA,EAAI;AAAA,MACpB,KAAA,EAAO;AAAA,QACL,SAAS,KAAA,CAAM,OAAA;AAAA,QACf,OAAO,KAAA,CAAM,KAAA;AAAA,QACb,gBAAgB,IAAA,CAAK;AAAA;AACvB,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAA,GAAS;AACP,IAAA,OAAO,KAAK,KAAA,CAAM,QAAA;AAAA,EACpB;AACF;AClBO,SAAS,YAAA,CACd,WACA,EAAA,EACA;AAGA,EAAA,OAAO,SAAS,kBAAkB,KAAA,EAAc;AAC9C,IAAA,uBACE,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,QAAA,EAAU,CAAC,CAAA,EAAG,KAAA,EAAO,cAAA,KAAmB;AACtC,UAAA,IAAI,iBAAiB,EAAA,EAAI;AACvB,YAAAA,MAAAA,CAAO;AAAA,cACL,IAAA,EAAM,cAAA;AAAA,cACN,QAAA,EAAU,cAAA;AAAA,cACV,SAAA,EAAW,KAAK,GAAA,EAAI;AAAA,cACpB,KAAA,EAAO,EAAE,EAAA,EAAI,KAAA;AAAM,aACpB,CAAA;AAAA,UACH;AAAA,QACF,CAAA;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO;AAAA;AAAA,KACxB;AAAA,EAEJ,CAAA;AACF","file":"index.js","sourcesContent":["import React from 'react';\nimport { report } from '@whnz/frontend-experience-core';\n\nexport class ErrorBoundary extends React.Component<{\n children: React.ReactNode;\n}> {\n componentDidCatch(error: Error, info: any) {\n report({\n type: 'react-error',\n timestamp: Date.now(),\n extra: {\n message: error.message,\n stack: error.stack,\n componentStack: info.componentStack,\n },\n });\n }\n\n render() {\n return this.props.children;\n }\n}\n","import React, { Profiler } from 'react';\nimport { report } from '@whnz/frontend-experience-core';\n\nexport function withProfiler<T extends React.ComponentType<any>>(\n Component: T,\n id: string\n) {\n type Props = React.ComponentProps<T>;\n\n return function ProfiledComponent(props: Props) {\n return (\n <Profiler\n id={id}\n onRender={(_, phase, actualDuration) => {\n if (actualDuration > 30) {\n report({\n type: 'react-render',\n duration: actualDuration,\n timestamp: Date.now(),\n extra: { id, phase }\n });\n }\n }}\n >\n <Component {...props} />\n </Profiler>\n );\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whnz/frontend-experience-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"types": "dist/index.d.ts",
|
|
6
7
|
"sideEffects": false,
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"react": "^18.3.1",
|
|
12
13
|
"@types/react": "^18.3.3",
|
|
13
|
-
"@whnz/frontend-experience-core": "1.0.
|
|
14
|
+
"@whnz/frontend-experience-core": "1.0.1"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "tsup"
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ErrorBoundary.ts","../src/Profiler.tsx"],"names":["report"],"mappings":";;;;;AAGO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM,SAAA,CAEtC;AAAA,EACD,iBAAA,CAAkB,OAAc,IAAA,EAAW;AACzC,IAAA,MAAA,CAAO;AAAA,MACL,IAAA,EAAM,aAAA;AAAA,MACN,SAAA,EAAW,KAAK,GAAA,EAAI;AAAA,MACpB,KAAA,EAAO;AAAA,QACL,SAAS,KAAA,CAAM,OAAA;AAAA,QACf,OAAO,KAAA,CAAM,KAAA;AAAA,QACb,gBAAgB,IAAA,CAAK;AAAA;AACvB,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAA,GAAS;AACP,IAAA,OAAO,KAAK,KAAA,CAAM,QAAA;AAAA,EACpB;AACF;AClBO,SAAS,YAAA,CACd,WACA,EAAA,EACA;AAGA,EAAA,OAAO,SAAS,kBAAkB,KAAA,EAAc;AAC9C,IAAA,uBACE,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,QAAA,EAAU,CAAC,CAAA,EAAG,KAAA,EAAO,cAAA,KAAmB;AACtC,UAAA,IAAI,iBAAiB,EAAA,EAAI;AACvB,YAAAA,MAAAA,CAAO;AAAA,cACL,IAAA,EAAM,cAAA;AAAA,cACN,QAAA,EAAU,cAAA;AAAA,cACV,SAAA,EAAW,KAAK,GAAA,EAAI;AAAA,cACpB,KAAA,EAAO,EAAE,EAAA,EAAI,KAAA;AAAM,aACpB,CAAA;AAAA,UACH;AAAA,QACF,CAAA;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO;AAAA;AAAA,KACxB;AAAA,EAEJ,CAAA;AACF","file":"index.mjs","sourcesContent":["import React from 'react';\nimport { report } from '@whnz/frontend-experience-core';\n\nexport class ErrorBoundary extends React.Component<{\n children: React.ReactNode;\n}> {\n componentDidCatch(error: Error, info: any) {\n report({\n type: 'react-error',\n timestamp: Date.now(),\n extra: {\n message: error.message,\n stack: error.stack,\n componentStack: info.componentStack,\n },\n });\n }\n\n render() {\n return this.props.children;\n }\n}\n","import React, { Profiler } from 'react';\nimport { report } from '@whnz/frontend-experience-core';\n\nexport function withProfiler<T extends React.ComponentType<any>>(\n Component: T,\n id: string\n) {\n type Props = React.ComponentProps<T>;\n\n return function ProfiledComponent(props: Props) {\n return (\n <Profiler\n id={id}\n onRender={(_, phase, actualDuration) => {\n if (actualDuration > 30) {\n report({\n type: 'react-render',\n duration: actualDuration,\n timestamp: Date.now(),\n extra: { id, phase }\n });\n }\n }}\n >\n <Component {...props} />\n </Profiler>\n );\n };\n}\n"]}
|
|
File without changes
|