feat: add self-contained legacy timer viewer for old browsers

Adds timer-legacy.html — a zero-dependency static page that connects
to the Ontime WebSocket and displays the live countdown for browsers
that cannot parse the Vite-built React bundle (Safari < 14, Chrome < 85).

Also adds a synchronous pre-React guard in index.html that redirects
/timer visitors to the legacy page when Promise.any is unavailable,
matching the Vite build target floor of Safari 14 / Chrome 85.

https://claude.ai/code/session_013MfdwdjdDUnr3akpGSGXa4
This commit is contained in:
Claude
2026-05-03 16:50:03 +00:00
committed by Carlos Valente
parent 5a33ffad92
commit 0741f46aca
4 changed files with 233 additions and 1 deletions
+6 -1
View File
@@ -32,7 +32,7 @@ import { runtimeService } from './services/runtime-service/runtime.service.js';
import { timerConfig } from './setup/config.js';
import { environment, isProduction } from './setup/environment.js';
// import utils
import { publicDir, srcDir } from './setup/index.js';
import { publicDir, srcDir, srcFiles } from './setup/index.js';
import { populateDemo } from './setup/loadDemo.js';
import { populateStyles } from './setup/loadStyles.js';
import { populateTranslation } from './setup/loadTranslations.js';
@@ -113,6 +113,11 @@ app.use(`${prefix}/external`, (req, res) => {
});
app.use(`${prefix}/user`, express.static(publicDir.userDir, { etag: false, lastModified: true }));
// Serve legacy timer for old browsers that don't support modern JS
app.get(`${prefix}/timer-legacy`, authenticateAndRedirect, (_req, res) => {
res.sendFile(srcFiles.timerLegacy);
});
// Base route for static files
app.use(`${prefix}`, authenticateAndRedirect, compressedStatic);
app.use(`${prefix}/*splat`, authenticateAndRedirect, compressedStatic);