Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Wasm

Flutter web Wasm: deferred loading để first paint nhẹ hơn

Wasm mở khóa đồ họa gần native trên web — kèm kỷ luật đóng gói mới. Flutter 3.47 thêm deferred loading experimental cho build Wasm để tách app lớn thành module lazy. Lệnh build flutter build web --release --wasm flutter build web --release --wasm --enable-wasm-deferred-loading Điều kiện tiên quyết Rời dart:html sang package:web và JS interop hiện đại. Update package còn giả định interop chỉ dart2js. Chiến lược tách module Giữ login/shell ở module chính. Defer màn nặng (admin, editor, map). Đo time to interactive , không chỉ dung lượng tải. Cạm bẫy Library deferred không được bắt buộc ở frame đầu. UI nặng canvas/Skottie vẫn cần ngân sách asset chặt. Không phải tổ hợp browser/flag nào cũng giống nhau — test Chrome, Safari, Firefox. Bài viết gốc đăng tại FlutterCook . Bản trên đó là bản được cập nhật mới nhất.

Flutter web Wasm: deferred loading for smaller first paint

Wasm unlocks near-native graphics on the web — and a new packaging discipline. Flutter 3.47 adds experimental deferred loading for Wasm builds so you can split a large app into lazy modules. Build commands flutter build web --release --wasm # experimental deferred modules (main channel flag in 3.47 era) flutter build web --release --wasm --enable-wasm-deferred-loading Prerequisites Migrate off dart:html to package:web and modern JS interop. Update packages that still assume dart2js-only interop. Splitting strategy Keep login/shell in the main module. Defer heavy feature screens (admin, editors, maps). Measure time to interactive , not just download size. Pitfalls Deferred libraries must not be required during first frame. Wasm + canvas/Skottie-heavy UIs still need careful asset budgets. Not every browser/flag combination is equal — test Chrome, Safari, Firefox. Originally published on FlutterCook . Read the latest version there — that copy is the one...