Skip to content

Add documentation for experimental WebParagraph text layout - #13997

Draft
mdebbar wants to merge 3 commits into
flutter:mainfrom
mdebbar:add-web-paragraph-docs
Draft

mdebbar wants to merge 3 commits into
flutter:mainfrom
mdebbar:add-web-paragraph-docs

Conversation

@mdebbar

@mdebbar mdebbar commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Adds a page for WebParagraph, the experimental text layout implementation for Flutter web that uses the browser's Enhanced Canvas TextMetrics API instead of the text stack bundled in CanvasKit.

The page covers what WebParagraph is, the requirements (CanvasKit renderer, Chromium with the experimental web platform features flag), how to enable it with preferWebParagraph: true in flutter_bootstrap.js, and how to verify that it's active. I also added preferWebParagraph to the config table in the initialization page and a sidenav entry.

Keeping this as a draft until the next stable release that contains all the necessary bits.

Part of flutter/flutter#172561

@flutter-website-bot

flutter-website-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Staged preview of the updated docs.flutter.dev site (updated for commit 3003bc0):

https://flutter-docs-prod--docs-pr13997-add-web-paragraph-docs-nw657zr8.web.app

@sfshaza2

Copy link
Copy Markdown
Contributor

/gcbrun

@sfshaza2

Copy link
Copy Markdown
Contributor

Can you resolve the conflicts, @mdebbar?

@sfshaza2

Copy link
Copy Markdown
Contributor

@mdebbar, now that the 3.50 release is live, can we address this?

@kevmoo

kevmoo commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

I just linked the video bits to the open issue. Until this has shipped as stable, I don't think we should document it.

@mdebbar
mdebbar marked this pull request as ready for review November 14, 2026 04:00
@mdebbar
mdebbar requested review from a team and sfshaza2 as code owners November 14, 2026 04:00
@mdebbar
mdebbar marked this pull request as draft November 14, 2026 04:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces documentation for WebParagraph, an experimental browser-native text layout engine for Flutter web. It adds a new guide explaining WebParagraph's benefits, requirements, and setup, and updates the initialization table and sidebar navigation accordingly. The review feedback suggests a correction in the requirements section to clarify that setting 'renderer: canvaskit' forces the CanvasKit renderer rather than specifically selecting the JavaScript build, as WebAssembly builds can also use CanvasKit.

Comment on lines +60 to +65
Renderer
: WebParagraph runs on the CanvasKit renderer, which is used by
JavaScript builds of your app.
The Skwasm renderer used by WebAssembly builds doesn't support WebParagraph.
If you build with `--wasm`, set `renderer: 'canvaskit'` in your
Flutter configuration so the loader picks the JavaScript build.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Setting renderer: 'canvaskit' forces the loader to use the CanvasKit renderer, but it does not force the loader to fall back to the JavaScript build (dart2js). WebAssembly builds (dart2wasm) can also run using the CanvasKit renderer.

To avoid confusing readers about how the loader selects the compilation target versus the renderer, we should clarify that this flag forces the CanvasKit renderer rather than picking the JavaScript build.

Suggested change
Renderer
: WebParagraph runs on the CanvasKit renderer, which is used by
JavaScript builds of your app.
The Skwasm renderer used by WebAssembly builds doesn't support WebParagraph.
If you build with `--wasm`, set `renderer: 'canvaskit'` in your
Flutter configuration so the loader picks the JavaScript build.
Renderer
: WebParagraph runs on the CanvasKit renderer.
The Skwasm renderer (the default for WebAssembly builds) doesn't support WebParagraph.
If you build with `--wasm`, set `renderer: 'canvaskit'` in your
Flutter configuration to use the CanvasKit renderer instead of Skwasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants