mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[stable] Cherry-pick change to CanvasKit build flags to fix double download (#164341)
## Stable Cherry Pick Cherry-picks https://github.com/flutter/flutter/pull/162198 to stable to fix issue with double-downloading CanvasKit. Fixes https://github.com/flutter/flutter/issues/163250 Impacted Users: All Flutter Web users Impact Description: `canvaskit.wasm` (a roughly 5 MB download) is double-downloaded. While some browsers may retrieve the second request from the cache, not all do. Workaround: None Risk: Low (a small change to the BUILD flags for CanvasKit that prevents `canvaskit.wasm` from being downloaded twice) Test Coverage: We don't have a test that checks how many requests there are for `canvaskit.wasm` Validation Steps: Build and run any Flutter Web app and check the network requests to see that `canvaskit.wasm` is only requested once.
This commit is contained in:
parent
09de023485
commit
bfcf486a89
@ -24,8 +24,11 @@ docs/releases/Hotfix-Documentation-Best-Practices.md
|
||||
|
||||
INTERNAL NOTE
|
||||
-->
|
||||
## Flutter 3.29 Changes
|
||||
|
||||
## Flutter 3.29.1 Changes
|
||||
### [3.29.2](https://github.com/flutter/flutter/releases/tag/3.29.2)
|
||||
|
||||
- [flutter/162198](https://github.com/flutter/flutter/issues/162198) Fixes double-download of canvaskit.wasm
|
||||
|
||||
### [3.29.1](https://github.com/flutter/flutter/releases/tag/3.29.1)
|
||||
|
||||
@ -49,8 +52,6 @@ glyphs.
|
||||
- [flutter/163261](https://github.com/flutter/flutter/pull/163261) - Fixes for Impeller DrawVertices issues involving snapshots with empty sizes
|
||||
- [flutter/163672](https://github.com/flutter/flutter/pull/163672) - Check for tracked engine.version before overriding
|
||||
|
||||
## Flutter 3.29 Changes
|
||||
|
||||
### [3.29.0](https://github.com/flutter/flutter/releases/tag/3.29.0)
|
||||
Initial stable release.
|
||||
|
||||
|
||||
@ -930,6 +930,14 @@ config("no_optimize") {
|
||||
cflags += [ "-fomit-frame-pointer" ]
|
||||
}
|
||||
ldflags = common_optimize_on_ldflags
|
||||
} else if (is_wasm) {
|
||||
# On WASM we don't want to fully deoptimize the debug build because the
|
||||
# compiled binary will have some functions with too many local variables
|
||||
# and Chrome will reject it.
|
||||
cflags = [
|
||||
"-O1",
|
||||
]
|
||||
ldflags = common_optimize_on_ldflags
|
||||
} else {
|
||||
cflags = [ "-O0" ]
|
||||
}
|
||||
|
||||
@ -62,8 +62,7 @@ canvaskit_wasm_lib("canvaskit") {
|
||||
ldflags = []
|
||||
if (is_debug) {
|
||||
ldflags += [
|
||||
"-O0",
|
||||
"-sDEMANGLE_SUPPORT=1",
|
||||
"-O1",
|
||||
"-sASSERTIONS=1",
|
||||
"-sGL_ASSERTIONS=1",
|
||||
"-g3",
|
||||
@ -111,14 +110,14 @@ canvaskit_wasm_lib("canvaskit") {
|
||||
"--bind",
|
||||
"--no-entry",
|
||||
"--pre-js",
|
||||
rebase_path("$_skia_root/modules/canvaskit/util.js"),
|
||||
"--pre-js",
|
||||
rebase_path("$_skia_root/modules/canvaskit/preamble.js"),
|
||||
"--pre-js",
|
||||
rebase_path("$_skia_root/modules/canvaskit/color.js"),
|
||||
"--pre-js",
|
||||
rebase_path("$_skia_root/modules/canvaskit/memory.js"),
|
||||
"--pre-js",
|
||||
rebase_path("$_skia_root/modules/canvaskit/util.js"),
|
||||
"--pre-js",
|
||||
rebase_path("$_skia_root/modules/canvaskit/interface.js"),
|
||||
]
|
||||
|
||||
@ -165,7 +164,7 @@ canvaskit_wasm_lib("canvaskit") {
|
||||
"-sEXPORT_NAME=CanvasKitInit",
|
||||
"-sEXPORTED_FUNCTIONS=[_malloc,_free]",
|
||||
"-sEXPORTED_RUNTIME_METHODS=HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPF32,HEAPU32,HEAPF64",
|
||||
"-sINCOMING_MODULE_JS_API=onRuntimeInitialized",
|
||||
"-sINCOMING_MODULE_JS_API=[instantiateWasm,onRuntimeInitialized,noExitRuntime]",
|
||||
"-sFORCE_FILESYSTEM=0",
|
||||
"-sFILESYSTEM=0",
|
||||
"-sMODULARIZE",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user