fix: support node 16, feature detect performance API#19
Conversation
| if ( | ||
| perf && | ||
| perf.mark && | ||
| perf.getEntriesByName && |
There was a problem hiding this comment.
It's probably enough to stop after getEntriesByName. See https://developer.mozilla.org/en-US/docs/Web/API/Performance vs https://nodejs.org/api/perf_hooks.html
Another solution is to higher up and not try to bind to the performance global if the environment is Node.
There was a problem hiding this comment.
It's probably enough to stop after getEntriesByName. See https://developer.mozilla.org/en-US/docs/Web/API/Performance vs https://nodejs.org/api/perf_hooks.html
It's enough right now ;)
Another solution is to higher up and not try to bind to the performance global if the environment is Node.
Sure, I don't have a preference for how @nolanlawson would like to have it fixed so long as it is fixed :)
There was a problem hiding this comment.
It's enough right now ;)
It's a stable API on both sides, so there's no good reason it would change. But I can't say that checking for every method is wrong, either ;)
There was a problem hiding this comment.
I'm fine with checking for every single method. This ensure that some version of Node in the future or some other JS environment doesn't have a similar error. :)
|
Thanks a lot! |
|
Released in marky v1.2.2 |
|
Hurray! Thanks for the swift action and release here @nolanlawson :) |
fixes #18 or at least one possible solution :)