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

Finish migrating to wasm-safe JS-interop #125

Closed
kevmoo opened this issue Feb 28, 2024 · 18 comments
Closed

Finish migrating to wasm-safe JS-interop #125

kevmoo opened this issue Feb 28, 2024 · 18 comments

Comments

@kevmoo
Copy link

kevmoo commented Feb 28, 2024

Sadly, v7.1.0 is still not ready for wasm.

js_wrapping is outdated and still uses pkg:js.
There is still a dependency on pkg:js.

@kevmoo
Copy link
Author

kevmoo commented Feb 28, 2024

How can we help here? Seems like js_wrapping is the culprit!

@a14n
Copy link
Owner

a14n commented Mar 4, 2024

This is a real big task. Not sure to have enough free time in the next days/weeks :-/

@kevmoo
Copy link
Author

kevmoo commented Mar 4, 2024

@a14n – you've been a MACHINE here. Thanks for clearly communicating your limitations!

@JgomesAT
Copy link

We have some conflicts with libraries of use of package js the major part of libraries are updated to use js 0.7 but Google maps uses 0.6 is it possible to update to version 0.7.1?

@a14n
Copy link
Owner

a14n commented Apr 18, 2024

I started working on a new version but it is a full rewrite and will take some time for it to land.

@kevmoo
Copy link
Author

kevmoo commented Apr 24, 2024

Any updates here @a14n ? anyway we can help?

@a14n
Copy link
Owner

a14n commented Apr 24, 2024

I started a new generator based on scraping/parsing https://developers.google.com/maps/documentation/javascript/reference/.

There are some challenges:

  • regarding types: e.g Dart type to use for JS union type like LatLng|LatLngLiteral ?
  • type conversion to Dart
  • trying to reduce changes to do for the migration
  • dartify the api like the current google_maps package

I don't have a lot of free time to work on it. I will try to push some code on a branch once I have something clean.

@MagnusJohansson
Copy link

I'm also waiting for an update that addresses the dependency on the 3 year old js ^0.6.3, starting to get conflicts with other packages that uses 0.7.1.

I have also seen this, that might need to be taken into consideration for future updates.
Important: Prefer using dart:js_interop instead of this package for JS interop. See the [JS interop documentation](https://dart.dev/interop/js-interop) for more details.

@bziembanski
Copy link

Also having problems with old js version. I would really appreciate new resolved version

@a14n
Copy link
Owner

a14n commented May 23, 2024

A little update on this migration/rewrite. I made great progress and it's close to have a pre-version to test. If someone is crazy enough to give it a stab the code lives in the new-js-interop branch. WARNING this is a working branch where force-pushes occurs regularly.

@Rexios80
Copy link
Contributor

This was expected, but the new google_maps code is not a drop in replacement for the old version for anyone thinking of trying it

@a14n
Copy link
Owner

a14n commented Jul 6, 2024

It took a long time but I just published google_maps-8.0.0-dev.1.

To migrate, here are the main points:

  • GMap should be rename to Map
  • toJS and toDart are sometimes required on elements accepting/returning several types
  • some services now return Future instead of having a callback function

@kevmoo
Copy link
Author

kevmoo commented Jul 6, 2024

amazing! thank you! We'll try it out.

@Rexios80
Copy link
Contributor

Rexios80 commented Jul 6, 2024

@kevmoo do you have a designated person to do the migration? If not I can try and do it.

@kevmoo
Copy link
Author

kevmoo commented Jul 7, 2024

@Rexios80 – want to run on this? flutter/packages#7064

@Rexios80
Copy link
Contributor

Rexios80 commented Jul 7, 2024

Sure! I can take a look next week.

@Rexios80
Copy link
Contributor

Rexios80 commented Jul 8, 2024

@a14n I almost have a fully working version of google_maps_flutter using this new google_maps version here: flutter/packages#7077

Thanks for the awesome work!

I just had a few issues I resolved in #132 along with one issue I mentioned there that I have been unable to resolve without help. Please take a look when you get a chance.

@a14n
Copy link
Owner

a14n commented Jul 30, 2024

Done via google_maps-8.0.0

@a14n a14n closed this as completed Jul 30, 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

No branches or pull requests

6 participants