I want to set some performance marks and measures in my Angular components to measure how long selected components take to process and render. They work fine when running the app in "client mode", but as soon as I run the app in SSR mode, I get "performance" is undefined.
I tried importing it from nodes 'perf_hooks' internal module, but then I get unknown module 'perf_hooks' when called from app.component.ts.
https://github.com/buggy1985/angular-ssr-performance/blob/HEAD/src/app/app.component.ts#L17
If I use performance.now() in server.ts it seems to be working. https://github.com/buggy1985/angular-ssr-performance/blob/HEAD/server.ts#L13
Can I pass the performance class from server.ts to the component? And for browser to fall back to window.performance? Or what am I doing wrong?