From ae00b2c4069b2f7940039de8f6a369cc00472ae0 Mon Sep 17 00:00:00 2001 From: Ecraindrop <156232876+Ecraindrop@users.noreply.github.com> Date: Mon, 17 Nov 2025 21:51:48 -0800 Subject: [PATCH 1/3] Add forceSingleThreadedSkwasm option to Flutter web loader (#178406) Update initialization.md --- .../web/initialization.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/content/platform-integration/web/initialization.md b/src/content/platform-integration/web/initialization.md index ab1d7f0f2cf..ab2d526ce4d 100644 --- a/src/content/platform-integration/web/initialization.md +++ b/src/content/platform-integration/web/initialization.md @@ -126,11 +126,31 @@ The `config` argument is an object that can have the following optional fields: |`entrypointBaseUrl`| The base URL of your Flutter app's entrypoint. Defaults to "/". |`String`| |`hostElement`| HTML Element into which Flutter renders the app. When not set, Flutter web takes over the whole page. |`HtmlElement`| |`renderer`| Specifies the [web renderer][web-renderers] for the current Flutter application, either `"canvaskit"` or `"skwasm"`. |`String`| +|`forceSingleThreadedSkwasm`| Forces the Skia WASM renderer to run in single-threaded mode for compatibility. |`bool`| {:.table} [web-renderers]: /platform-integration/web/renderers +## forceSingleThreadedSkwasm + +A boolean flag to force the Skia WebAssembly (skwasm) renderer to run in **single-threaded mode**. This is useful if: + +- Your environment does not support multi-threaded WASM (e.g., SharedArrayBuffer not available or required security headers missing). +- You want maximum browser compatibility. +- Use `false` (default) to allow multi-threaded rendering when supported, which improves performance. + +## Example usage + +```js +_flutter.loader.load({ + config: { + renderer: 'skwasm', + forceSingleThreadedSkwasm: true, + }, +}); +``` + ## Example: Customizing Flutter configuration based on URL query parameters The following example shows a custom `flutter_bootstrap.js` that allows From f93285ccea40190af26dbb30e45608d66e14f20d Mon Sep 17 00:00:00 2001 From: Ecraindrop <156232876+Ecraindrop@users.noreply.github.com> Date: Mon, 17 Nov 2025 22:25:57 -0800 Subject: [PATCH 2/3] Fix line exceeding 80-character limit for semantic line breaks --- src/content/platform-integration/web/initialization.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/content/platform-integration/web/initialization.md b/src/content/platform-integration/web/initialization.md index ab2d526ce4d..5165a957391 100644 --- a/src/content/platform-integration/web/initialization.md +++ b/src/content/platform-integration/web/initialization.md @@ -134,11 +134,12 @@ The `config` argument is an object that can have the following optional fields: ## forceSingleThreadedSkwasm -A boolean flag to force the Skia WebAssembly (skwasm) renderer to run in **single-threaded mode**. This is useful if: +A boolean flag to force the Skia WebAssembly (skwasm) renderer to run in +**single-threaded mode**. This is useful if: -- Your environment does not support multi-threaded WASM (e.g., SharedArrayBuffer not available or required security headers missing). -- You want maximum browser compatibility. -- Use `false` (default) to allow multi-threaded rendering when supported, which improves performance. +- Your environment does not support multi-threaded WASM (for example, `SharedArrayBuffer` is not available or required security headers are missing). +- You want maximum browser compatibility. +- - Use `false` (default) to allow multi-threaded rendering when supported, which improves performance. ## Example usage From fc1a5c32f557cff3716420e7c8c297166924b688 Mon Sep 17 00:00:00 2001 From: Ecraindrop <156232876+Ecraindrop@users.noreply.github.com> Date: Tue, 18 Nov 2025 22:40:56 -0800 Subject: [PATCH 3/3] Fix doc comment line length and address prior style issues from previous unapproved commits. --- .../platform-integration/web/initialization.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/content/platform-integration/web/initialization.md b/src/content/platform-integration/web/initialization.md index 5165a957391..4b16b95fcf7 100644 --- a/src/content/platform-integration/web/initialization.md +++ b/src/content/platform-integration/web/initialization.md @@ -134,12 +134,15 @@ The `config` argument is an object that can have the following optional fields: ## forceSingleThreadedSkwasm -A boolean flag to force the Skia WebAssembly (skwasm) renderer to run in -**single-threaded mode**. This is useful if: +A boolean flag to force the Skia WebAssembly (skwasm) renderer +to run in **single-threaded mode**. This is useful if: -- Your environment does not support multi-threaded WASM (for example, `SharedArrayBuffer` is not available or required security headers are missing). +- Your environment does not support multi-threaded WASM (for example, + `SharedArrayBuffer` is not available or required security + headers are missing). - You want maximum browser compatibility. -- - Use `false` (default) to allow multi-threaded rendering when supported, which improves performance. +- Use `false` (default) to allow multi-threaded rendering when + supported, which improves performance. ## Example usage