Skip to content

Commit 967021d

Browse files
committed
solve conflict
1 parent f6b26d2 commit 967021d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Virtual module source for perf tracking of Qwik's `componentQrl`.
3+
*
4+
* This module is loaded via the devtools plugin virtual-module registry
5+
* (`virtualmodules/virtualModules.ts`) and is imported from:
6+
* - `virtual:qwik-component-proxy`
7+
*/
8+
import perfRuntime from './perfRuntime';
9+
10+
const qwikComponentProxy = `${perfRuntime}
11+
import { componentQrl as originalComponentQrl } from '@qwik.dev/core';
12+
13+
function componentQrl(qrl, options) {
14+
const phase = __qwik_perf_is_server__() ? 'ssr' : 'csr';
15+
const start = performance.now();
16+
let viteId = null;
17+
const component = qrl?.getSymbol?.() || qrl?.$symbol$ || 'unknown';
18+
if(qrl.dev){
19+
viteId = qrl.dev.file.replace(/[^/]*$/, qrl.dev.displayName);
20+
}
21+
const result = originalComponentQrl(qrl, options);
22+
const duration = performance.now() - start;
23+
__qwik_perf_commit_componentqrl__({
24+
component,
25+
phase,
26+
duration,
27+
start,
28+
viteId,
29+
end: start + duration,
30+
});
31+
return result;
32+
}
33+
34+
export { componentQrl };
35+
`;
36+
37+
export default qwikComponentProxy;
38+
39+

0 commit comments

Comments
 (0)