0
0
Fork 0

Use helpers to check environment in frontend (#27633)

This commit is contained in:
Renaud Chaput 2023-10-31 17:05:44 +01:00 committed by GitHub
parent 7ef56d6e50
commit 277e6968f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 9 deletions

View file

@ -5,7 +5,9 @@
import * as marky from 'marky';
if (process.env.NODE_ENV === 'development') {
import { isDevelopment } from './utils/environment';
if (isDevelopment()) {
if (typeof performance !== 'undefined' && performance.setResourceTimingBufferSize) {
// Increase Firefox's performance entry limit; otherwise it's capped to 150.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331135
@ -18,13 +20,13 @@ if (process.env.NODE_ENV === 'development') {
}
export function start(name) {
if (process.env.NODE_ENV === 'development') {
if (isDevelopment()) {
marky.mark(name);
}
}
export function stop(name) {
if (process.env.NODE_ENV === 'development') {
if (isDevelopment()) {
marky.stop(name);
}
}