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>
This commit is contained in:
2026-12-01 21:05:17 +00:00
parent 23d8658e80
commit 3b1760fe8e
17 changed files with 737 additions and 17 deletions
@@ -2,7 +2,8 @@ import 'dart:async';
import 'package:flutter/widgets.dart';
import 'flutter_tts_speech_engine.dart';
import 'flutter_tts_speech_engine.dart'
if (dart.library.js_interop) 'web_speech_engine.dart';
import 'speech_document.dart';
import 'speech_engine.dart';
import 'speech_preferences.dart';
@@ -13,7 +14,7 @@ enum SpeechState { idle, speaking, paused }
/// changes; the spoken word moves on the separate, frequent [word].
class SpeechController extends ChangeNotifier with WidgetsBindingObserver {
SpeechController({SpeechEngine? engine, SpeechPreferencesStore? store})
: engine = engine ?? FlutterTtsSpeechEngine(),
: engine = engine ?? createSpeechEngine(),
_store = store ?? const SharedSpeechPreferencesStore() {
WidgetsBinding.instance.addObserver(this);
this.engine