Skip to content

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

Open
mkustermann wants to merge 1 commit into
flutter:masterfrom
mkustermann:remove-export-pragma
Open

[web/skwasm] Remove name-based export of function#188256
mkustermann wants to merge 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 defering this function and anything it depends on (including ffi things).

This can land after dart-lang/sdk@702c9e4eea444 rolled up to flutter.

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

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.

1 participant