feat(studio): enable timeline virtualization by default (#2926)

* feat(studio): enable timeline virtualization by default

* fix(ci): measure timeline performance in production React
This commit is contained in:
Miguel Ángel
2026-07-31 19:43:47 +02:00
committed by GitHub
parent 723d3381c4
commit c6925e471a
13 changed files with 202 additions and 68 deletions
@@ -0,0 +1,23 @@
export type StudioRuntimeMode = "development" | "production";
function readStudioImportMetaEnv(): ImportMetaEnv | undefined {
try {
return import.meta.env;
} catch {
return undefined;
}
}
const studioImportMetaEnv = readStudioImportMetaEnv();
/**
* Test hooks belong to Vite's development server, even when that server uses
* production React for performance measurement. A production build has neither
* DEV nor the development server mode, so the API stays out of shipped assets.
*/
export const STUDIO_RUNTIME_MODE: StudioRuntimeMode = studioImportMetaEnv?.DEV
? "development"
: "production";
export const STUDIO_TEST_HOOKS_ENABLED =
studioImportMetaEnv?.DEV === true || studioImportMetaEnv?.MODE === "development";