-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add perfomance from perf_hooks (Node v8.5.0+) #251
Conversation
Let's push 247 first and then merge this one |
src/endpoints/Endpoint.js
Outdated
@@ -3,6 +3,8 @@ | |||
import { Readable } from "stream"; | |||
import "cross-fetch/polyfill"; | |||
import { spawn } from "child_process"; | |||
// $FlowFixMe | |||
import { performance } from "perf_hooks"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't ran this, but how does it handle running in the browser? It seems like you're swapping problems in one environment for another. I'd suggest creating a small wrapper and only requiring
"perf_hooks" if you're not in a browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See question about browser compat
Looking back on this I think the mistake I made was putting the perf timings in the code unconditionally. I wish that I had put them inside the analytics callback check and checked for the existence of Since this isn't a documented feature, the only reason people are seeing this is because the calls to |
Fixes the error from
8.0.0-beta.20
regarding: