Skip to content

[web/skwasm] Remove name-based export of function - #188256

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
mkustermann:remove-export-pragma
Jun 26, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
mkustermann:remove-export-pragma

Conversation

@mkustermann

@mkustermann mkustermann commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

The @pragma('wasm:export') is intended to be used on functions that are called by-name
from JS or imported by-name by other wasm modules.

Though the callbackHandler seems to be not called by name, instead a wasm funcref
is taken from the function and passed to an imported skwasmWrapper.addFunction function.

Removing the annotation can improve scenarios where flutter is loaded via deferred loading.
It allows deferring this function and anything it depends on (including ffi things).

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 19, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team labels Jun 19, 2026

@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 removes the @pragma('wasm:export') annotation from the callbackHandler function in surface.dart. I have no feedback to provide.

@mkustermann

Copy link
Copy Markdown
Member Author

/cc @schultek

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@mkustermann
mkustermann force-pushed the remove-export-pragma branch from d49de07 to 32582a7 Compare June 23, 2026 12:29
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 23, 2026
The `@pragma('wasm:export')` is intended to be used on functions that
are called by-name from JS or by imported by-name by other wasm modules.

Though the `callbackHandler` seems to be not called by name, instead a
wasm funcref is taken from the function and passed to an imported
`skwasmWrapper.addFunction` function.

Removing the annotation can improve scenarios where flutter is loaded
via deferred loading. It allows defering this function and anything it
depends on (including ffi things).

This can land after dart-lang/sdk@702c9e4eea444 rolled up to flutter.
@mkustermann
mkustermann force-pushed the remove-export-pragma branch from 32582a7 to 8c50b64 Compare June 24, 2026 09:35
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 24, 2026
@eyebrowsoffire eyebrowsoffire added the CICD Run CI/CD label Jun 24, 2026

@eyebrowsoffire eyebrowsoffire 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.

It has been a while, but I think the reason I exported this in the first place is because it was getting tree-shaken out or something like that. That may no longer be the case. You're right that we don't actually need this as an export otherwise, so let's see if CI passes with the pragma removed.

@mkustermann

Copy link
Copy Markdown
Member Author

@eyebrowsoffire It does seem like CI tests passed now.

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jun 26, 2026
Merged via the queue into flutter:master with commit 82c9d7b Jun 26, 2026
205 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 2026
andywolff pushed a commit to andywolff/flutter that referenced this pull request Jun 26, 2026
The `@pragma('wasm:export')` is intended to be used on functions that
are called by-name
from JS or imported by-name by other wasm modules.

Though the `callbackHandler` seems to be not called by name, instead a
wasm funcref
is taken from the function and passed to an imported
`skwasmWrapper.addFunction` function.

Removing the annotation can improve scenarios where flutter is loaded
via deferred loading.
It allows deferring this function and anything it depends on (including
ffi things).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants