Files
pipelines/app/web/flutter_bootstrap.js
T
alan 3b1760fe8e Web: WebAssembly build served cross-origin isolated, immutable and precompressed
The web app is built with --wasm (skwasm, JS/CanvasKit fallback beside it).
The proxy serves it with COOP same-origin + COEP credentialless so skwasm
renders on a worker; an installed build loads from /_v/<buildId>/ cached as
immutable, other files revalidate by ETag, and the installer precompresses
.br/.gz variants the proxy sends by Accept-Encoding. The bootstrap no
longer registers Flutter's deprecated service worker (a reload per install).
Read aloud on the web uses the Web Speech API through package:web: the
flutter_tts web plugin's interop casts fail under wasm. Bench kit: isolation
and headed modes, renderer and memory reporting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:05:17 +00:00

19 lines
806 B
JavaScript

{{flutter_js}}
{{flutter_build_config}}
// The Pipelines web proxy (web/serve.mjs) names an installed build's
// versioned asset base, cached as immutable: the entrypoint, the renderer
// (skwasm or CanvasKit) and the app's assets all load from it. Without it (a
// development server) everything loads from the page's own base.
//
// No service worker is registered: Flutter's is deprecated and now only
// unregisters itself and reloads the page, which cost a second startup after
// every install. HTTP caching keeps repeat loads fast instead.
(() => {
const base = document.querySelector('meta[name="pipelines-asset-base"]')?.content;
const config = base
? { entrypointBaseUrl: base, assetBase: base, canvasKitBaseUrl: base + "canvaskit/" }
: {};
_flutter.loader.load({ config });
})();