Skip to content

Conversation

pedromassango
Copy link
Contributor

@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
Contributor 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
Contributor Author

Will get back to this today

@pedromassango
Copy link
Contributor 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
Contributor 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: git@github.com: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
Contributor 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?

@jaredmixpanel jaredmixpanel added the enhancement New feature or request label Apr 11, 2025
Copy link
Collaborator

@jaredmixpanel jaredmixpanel left a comment

Choose a reason for hiding this comment

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

Thanks for this and apologies again for it taking so long.

@jaredmixpanel jaredmixpanel merged commit 9ad67d9 into mixpanel:main Apr 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WASM support
7 participants