Open
Description
Version
4.5.0
Steps to Reproduce
in a flutter web project, build it with flutter build web --wasm
Expected Result
it builds
Actual Result
it doesn't build
More Context
flutter web wasm builds are now in stable
branch and it is now a reasonable expectation for packages to support it https://docs.flutter.dev/platform-integration/web/wasm
Activity
marandaneto commentedon Jul 26, 2024
Thanks for creating the issue.
We'd need to:
mainly the
posthog_flutter_web.dart
andposthog_flutter_web_handler.dart
files would need to be changed.Something to check is if after the migration it's still compatible with older Flutter versions (that's a must I'd say otherwise we'd need a major bump).
While we'd like to support it, it's still a low priority since there are a few limitations to running wasm on the browser so we'd not do this right now but soonish, of course PRs are welcome, happy to guide anyway lending a hand here.
flowhorn commentedon Aug 9, 2024
I tried a little PR, currently I have issues with flutter 3.24 so I couldn't test it again when filing the PR, but this should work using dart:js_interop instead of dart:js.
Feel free to use this PR/adjust it etc.
#114
marandaneto commentedon Aug 12, 2024
a few things have to be fixed such as:
call.arguments['properties'] as Map<Object?, Object?>? ?? {}
so the extensionjsify
is recognized.For some reason the cast has to be always to
Map<Object?, Object?>
even though its declared asMap<String, Object>? properties
, the method channel is always converting during theinvokeMethod
call, plus test that everything works as expected, but thanks for the initial PR @flowhornIchordeDionysos commentedon Jan 19, 2025
@marandaneto we are evaluating different product analytics solutions. From a technical perspective PostHog is definitely a standout with how well you support the different ecosystems and frameworks!
The only place I can think of where you are now behind is WASM support :P
amplitude/Amplitude-Flutter#197
Why is WASM important to us?
We as simpleclub, are one of the biggest online education platform in Germany, selling to large German corporations.
We run a heavy web application with complex interactive 2D and soon 3D animations. Those animations help our customers better understand the connection between concepts and aid their learning journey.
Being able to run our Flutter web app via WASM drastically reduces the resource consumptions, making our app more accessible to customers with lower end devices.
Our customers use Edge in their day-to-day usage, which does support WASM-GC.
Flutter dynamically switches to use WASM on supported browsers and falls back to CanvasKit (non-WASM) in Firefox/Safari. For users on supported browsers this would be a massive improvement, while we wait for Firefox to fix a performance bug and the new Safari version (with support for WASM-GC) to come out of the technical preview.
marandaneto commentedon Jan 20, 2025
@IchordeDionysos #114 (comment)
let's see if the contributor would finish up the PR or if somebody else would like to take over, There's probably not much left to finish it up.