perf: stream story assets by page

This commit is contained in:
2026-07-18 11:06:56 +09:00
parent af2f5dbf06
commit 1df324ecd2
6 changed files with 941 additions and 182 deletions

View File

@@ -1,6 +1,7 @@
import { spawnSync } from 'node:child_process';
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { desktopBrowserDeviceScaleFactor, desktopBrowserViewport } from './desktop-browser-viewport.mjs';
const qaVersion = process.env.PUBLIC_QA_VERSION ?? makeQaVersion();
const releaseCommit = gitValue(['rev-parse', 'HEAD'], 'unknown');
@@ -11,7 +12,7 @@ const releaseDashboardFile = 'release-dashboard.html';
const qaRepeatRuns = Number(process.env.PUBLIC_QA_REPEAT_RUNS ?? 2);
assertNoTrackedChanges();
runPnpmScript('verify:local-release');
runPnpmScript('verify:local-release', { MEASURE_RENDERER: 'webgl' });
runPnpmScript('qa:early', { QA_REPORT_PATH: join('dist', qaReportFile) });
if (qaRepeatRuns > 1) {
runPnpmScript('qa:early:repeat', {
@@ -37,7 +38,7 @@ writeReleaseManifest(
runPnpmScript('deploy:nas:dist');
runPnpmScript('verify:public-deploy', { PUBLIC_QA_VERSION: qaVersion, PUBLIC_QA_COMMIT: releaseCommit });
console.log(`Shipped and verified public deploy with PUBLIC_QA_VERSION=${qaVersion} at ${releaseShortCommit}`);
console.log(`Shipped and verified FHD DPR 1 WebGL public deploy with Canvas compatibility, PUBLIC_QA_VERSION=${qaVersion} at ${releaseShortCommit}`);
function makeQaVersion() {
const stamp = new Date().toISOString().replace(/[-:.TZ]/g, '').slice(0, 14);
@@ -70,7 +71,21 @@ function writeReleaseManifest(qaVersion, commit, shortCommit, qaReport, qaRepeat
qaReport,
qaRepeatReport,
releaseDashboard,
verification: ['verify:local-release', 'qa:early', ...(qaRepeatReport ? ['qa:early:repeat'] : []), 'verify:public-deploy']
renderingGate: {
requiredRenderer: 'webgl',
compatibilityRenderer: 'canvas',
viewport: {
...desktopBrowserViewport,
deviceScaleFactor: desktopBrowserDeviceScaleFactor
}
},
verification: [
'verify:local-release',
'verify:performance:webgl',
'qa:early',
...(qaRepeatReport ? ['qa:early:repeat'] : []),
'verify:public-deploy:webgl+canvas'
]
};
mkdirSync('dist', { recursive: true });