Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

chore(deps): change browser-process-hrtime to browser-hrtime #13

Closed
wants to merge 1 commit into from

Conversation

vltansky
Copy link

@vltansky vltansky commented Apr 30, 2020

When trying to use w3c-hr-time in Angular its crashes on process is not defined
image
This happens because of how browser-process-hrtime check if process.hrtime defined.

module.exports = process.hrtime || hrtime

I tried to make some tests and I guess it depends on which bundler you are using, as it did work for me in browserify (probably they are emulating process variable). But Angular+webpack crashes. Didn't test it in React, but I think it will crash there too.

browser-process-hrtime looks like not maintained anymore (last commit was 2 years ago and open pull request from December 2018).
So I created a similar package browser-hrtime that solves this problem (also add support for process.hrtime.bigint(), tests for browser, and in general made my best to make it good enough).

So I propose you to take a look, and of course here is a screenshot after fix:
image

I tried to google issues about it, actually didn't found much, but I think it still should be fixed :)

thenativeweb/measure-time#1
HubSpot/BuckyClient#23
jhuckaby/canvas-plus#5

@vltansky
Copy link
Author

@TimothyGu

@domenic domenic closed this Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants