Skip to content

ref: Restore node 6 support due to yarn engine checks, add performance.now fallback #2460

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

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek requested a review from HazAT February 28, 2020 15:39
@getsentry-bot
Copy link
Contributor

Warnings
⚠️ Please add a changelog entry for your changes.
Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES5: 16.6973 kB) (ES6: 15.7109 kB)

📖 ✅ TSLint passed

Generated by 🚫 dangerJS against d268f5f

@kamilogorek kamilogorek merged commit 5b78cbc into master Feb 28, 2020
@kamilogorek kamilogorek deleted the perf-fallback branch February 28, 2020 15:45
@Turbo87
Copy link
Contributor

Turbo87 commented Feb 28, 2020

awesome, thanks @kamilogorek :)


const performanceFallback: Pick<Performance, 'now'> = {
now(): number {
return INITIAL_TIME - Date.now();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think storing the initial time is unnecessary.
The point of using performance.now is to compute durations t1-t0; it doesn't matter to subtract yet INITIAL_TIME. And as a fallback it is limited anyway, since it is has no guarantee on being monotonic, unlike the real performance.now.

Copy link
Contributor Author

@kamilogorek kamilogorek Feb 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

performance.now returns a delta from start till now. We need a fallback to do the same, in behavior sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants