abner / flutter_js

A Javascript engine to use with flutter. It uses quickjs on Android and JavascriptCore on IOS
MIT License
460 stars 112 forks source link

Question: How do I use it with a library? #131

Open azwalzaman opened 1 year ago

azwalzaman commented 1 year ago

I want to use my Google Sign In code I made for NodeJS here

filipe-ingles commented 1 year ago

Same question here! Can I use flutter_js with javascript library? I like to use https://opensheetmusicdisplay.org/ in my app

timarnoldev commented 1 year ago

+1

Anwenden001 commented 11 months ago

You can compile your code to JS and then add it as a string.

MulverineX commented 11 months ago

Here's an example of how to bundle your JS into something useable. Do note that this is unfinished, so there may be more polyfills and such that you need to get it running.

ekkis commented 4 months ago

I see many questions like this one, unanswered for months. is anyone even maintaining this? could someone respond please?

MulverineX commented 4 months ago

@ekkis this project is not supported anymore. It was more created as a hobby project and wasn't really ever polished to the point to be dependable.

In collaboration with WebF (Alibaba Kraken successor), I sponsored & aided in work on a new library called Mercury. Currently there are still some issues to work out with fetch, their quickjs fork needs to be updated for the recent progress in TC39 compliance, and in the future Mercury will be integrated and used in the WebF library which will encourage more regular maintenance. But if you're willing to bundle your code that's no issue.

My project has already been migrated to Mercury if you want to check out an example of usage.

ekkis commented 4 months ago

@MulverineX thanks for repyling. I've had a gander at Mercury. I don't know what the WebF library but I'm building on mobile. will Mercury allow me to run functions from a Javascript library in a mobile app? I'm happy to bundle (you mean like webpack?) or do whatever it takes. and yes! I'd love to see some sample code

ekkis commented 4 months ago

incidentally, you can reach me on https://t.me/ekkis

ekkis commented 3 months ago

for those looking for a solution, this works: https://pub.dev/packages/mercuryjs/versions/0.1.3