simolus3 / zap

Zap is a fast web framework built on Dart
https://simonbinder.eu/zap/
MIT License
233 stars 12 forks source link

JavaScript interoperability #8

Closed mjablecnik closed 2 years ago

mjablecnik commented 2 years ago

I see that with Zap I can create code in Dart and import Dart packages on the frontend. But what when I will want to use some JavaScript library in my project? Is somewhere some example of how Zap can interop with JavaScript?

simolus3 commented 2 years ago

Zap is no magic and compiles to intermediate Dart files, so you can use the existing tooling Dart provides to interop with JavaScript (in particular, package:js).

I agree that the docs could benefit from an example here, is there any library in particular that you have in mind? I think svelte has a mapbox example, I could port that to zap and include it in the examples.

mjablecnik commented 2 years ago

I think any small example about Dart interoparability with JS in documentation would be great. So I think that mapbox example can be sufficient. :)

simolus3 commented 2 years ago

I've added a mapbox example using riverpod for state management in 169575daba301afbc6ed8b1bf772f315478e0642.