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 wasm support #167

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pedromassango
Copy link

@pedromassango pedromassango commented Oct 4, 2024

Fixes #133

Test

To test this PR, go to the example folder and try to build the app using Wasm:

cd example && flutter build web --wasm

@pedromassango pedromassango mentioned this pull request Oct 4, 2024
@pedromassango
Copy link
Author

Cc @jaredmixpanel

@willsmanley
Copy link

could we get this merged in and patch released? thank you for putting this together! i was literally about to open the same pr as i just implemented it myself before seeing this: https://github.com/willsmanley/mixpanel-flutter

@willsmanley
Copy link

also, for wasmgc support, could yall consider including this commit? https://github.com/mixpanel/mixpanel-flutter/pull/175/files

this just adds crossorigin to the CDN which allows for wasmgc usage

@martinloesethjensen
Copy link

Could also add section in CHANGELOG.md

@pedromassango
Copy link
Author

Will get back to this today

@pedromassango
Copy link
Author

@willsmanley this is now ready for another review

@willsmanley
Copy link

willsmanley commented Jan 26, 2025

LGTM but im not a maintainer

thank you for incorporating the cross site tag!

@pedromassango
Copy link
Author

Cc @jaredmixpanel

@KonstantinRr
Copy link

Is there an estimate for when this will go into master? It's currently blocking us from deploying to web. Thanks!

@willsmanley
Copy link

Is there an estimate for when this will go into master? It's currently blocking us from deploying to web. Thanks!

Do you know how to point your pubspec version to a remote git ref? That might help unblock you while we're waiting

@nikb7
Copy link

nikb7 commented Feb 15, 2025

You can use this to refer to a specific branch and repository

 mixpanel_flutter:
    git:
      url: [email protected]:pedromassango/mixpanel-flutter.git
      ref: feat/add_wasm_support

@jalen-launchpad
Copy link

Tried pulling this PR and using it, but is throwing errors on initialization. The error says:

DartError: PlatformException(error, NoSuchMethodError: 'jsify'
Dynamic call of null.
Receiver: Instance of 'LinkedMap<Object?, Object?>'
Arguments: [], null, null)

This is happening when running Mixpanel.init() and is thrown from

 void initialize(MethodCall call) {
    Map<Object?, Object?> args = call.arguments as Map<Object?, Object?>;
    String token = args['token'] as String;
    Map<String, dynamic> config = args['config'];
    init(token, config?.jsify() ?? {});
  }

Using breakpoints I have verified that config is not empty. Not sure if anyone else has run into this but is there a known workaround?

# Conflicts:
#	CHANGELOG.md
#	pubspec.yaml
@pedromassango
Copy link
Author

This is happening when running Mixpanel.init() and is thrown from

 void initialize(MethodCall call) {
    Map<Object?, Object?> args = call.arguments as Map<Object?, Object?>;
    String token = args['token'] as String;
    Map<String, dynamic> config = args['config'];
    init(token, config?.jsify() ?? {});
  }

Using breakpoints I have verified that config is not empty. Not sure if anyone else has run into this but is there a known workaround?

Just looked at this I can't reproduce it, can you share a minimal reproducible code?

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.

WASM support
6 participants