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(example): migrate to wasm #1867

Closed
wants to merge 2 commits into from
Closed

feat(example): migrate to wasm #1867

wants to merge 2 commits into from

Conversation

josxha
Copy link
Contributor

@josxha josxha commented Apr 9, 2024

Instructions

  1. Switch to the beta channel flutter channel beta
  2. Build for web assembly flutter build web --help
  3. (optional) Install a dart web server flutter pub global activate dhttpd
  4. Run the wasm app
cd build/web
dhttpd '--headers=Cross-Origin-Embedder-Policy=credentialless;Cross-Origin-Opener-Policy=same-origin'

Roadmap

  • migrate example app
  • flutter_map_cancellable_tile_provider doesn't work with wasm yet
DioException [unknown]: null
Error: Unsupported operation: Platform._version
  • update CI

Links and Resources

@JaffaKetchup
Copy link
Member

We may want to hold off on this for a little while: https://docs.flutter.dev/platform-integration/web/wasm#known-limitations.

@mdmm13
Copy link

mdmm13 commented Apr 10, 2024

We may want to hold off on this for a little while: https://docs.flutter.dev/platform-integration/web/wasm#known-limitations.

Maybe merge as index-wasm.html so those experimenting with WASM can have a go?

The Flutter team is expecting to have complete WASM support this year and judging by the number of PRs they've been merging on the topic recently, I'd assume not in the last release of the year. Let's see if it's the game changer we're hoping for on web.

@josxha
Copy link
Contributor Author

josxha commented Apr 10, 2024

We may want to hold off on this for a little while [...]

Agree, I would even delay the merge until wasm is stable. This pull request can be considered for testing purposes (and to migrate the cancellable tile provider until then).

Maybe merge as index-wasm.html so those experimenting with WASM can have a go?

flutter_map is compatible with wasm out of the box since its code is dart-only. All migration that was needed is in the example app. You can just pull the wasm branch if you want to test flutter_map on wasm.

@mdmm13
Copy link

mdmm13 commented May 13, 2024

We may want to hold off on this for a little while [...]

Agree, I would even delay the merge until wasm is stable. This pull request can be considered for testing purposes (and to migrate the cancellable tile provider until then).

I'm going to try to foresee the future here, but I have a feeling Flutter Wasm will be going stable tomorrow 💡🚀

image

@JaffaKetchup
Copy link
Member

Hmm, not sure 🤔. Maybe give it another year :D

I guess they're releasing it so they can announce it at Google I/O, which I was guessing would happen!

@mdmm13
Copy link

mdmm13 commented May 13, 2024

Hmm, not sure 🤔. Maybe give it another year :D

I guess they're releasing it so they can announce it at Google I/O, which I was guessing would happen!

Along with Flutter 3.22, which brings lots of Impeller improvements also.

@JaffaKetchup
Copy link
Member

Not sure if this was here before:

Even with the --wasm flag, flutter build web will still compile the application to JavaScript. If WasmGC support is not detected at runtime, the JavaScript output is used so the application will continue to work across browsers.

But it might be safe to do this now! Might need to do a fresh create of the web build config though.

@JaffaKetchup
Copy link
Member

Superseded by #1885.

@JaffaKetchup JaffaKetchup deleted the wasm branch May 23, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants