Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support to wasm in web platform #544

Merged

Conversation

yeikel16
Copy link
Contributor

@yeikel16 yeikel16 commented Aug 7, 2024

Use the web package in web platform to allow wasm compilation.

Fix #523

Run:

flutter run -d chrome --release --wasm

Output:
Captura de pantalla 2024-08-07 a la(s) 2 31 13 p m

Copy link
Contributor

@sowens-csd sowens-csd left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR, I really appreciate the effort.

Do you know if the WASM support is the same as the previous JS support, all the same browsers would be supported using WASM?

@yeikel16
Copy link
Contributor Author

Do you know if the WASM support is the same as the previous JS support, all the same browsers would be supported using WASM?

Yes is the same API, but the decision to compile using --wasm is made by the developer.

To support compilation to Wasm, Dart has shifted how it enables interop with browser and JavaScript APIs. This shift prevents Dart code that uses dart:html or package:js from compiling to Wasm.

Instead, Dart now provides new, lightweight interop solutions built around static JS interop:

package:web, which replaces dart:html (and other web libraries)
dart:js_interop, which replaces package:js and dart:js

See some docs

@sowens-csd sowens-csd merged commit 19293bb into csdcorp:main Aug 14, 2024
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.

Support Flutter web WASM
2 participants