Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Dart support the use of existing JavaScript libraries?

I understand Dart compiles to JavaScript, and I read the Dart Language Spec on Libraries, although I didn't see an answer there. Also a search on their discussion form for the word 'existing' turns up 3 results that are not related.

Does anyone know if Dart will support the use of existing JavaScript libraries such as jQuery or Raphael?

like image 744
TMB Avatar asked Oct 10 '11 16:10

TMB


People also ask

Can I use JavaScript in Dart?

The Dart web platform supports calling JavaScript using the js package, also known as package:js. For help using the js package, see the following: Documentation for the js package: pub.

Can I use JavaScript in flutter?

The Javascript runtimes runs synchronously through the dart ffi. So now you can run javascript code as a native citzen inside yours Flutter Mobile Apps (Android, IOS, Windows, Linux and MacOS are all supported).

What are Dart libraries?

Dart has a rich set of core libraries that provide essentials for many everyday programming tasks such as working on collections of objects ( dart:collection ), making calculations ( dart:math ), and encoding/decoding data ( dart:convert ). Additional APIs are available in commonly used packages.


1 Answers

The answer is now Yes! Dart now ships a JS-interop library to use existing JavaScript code with your Dart app. Learn more here: https://www.dartlang.org/articles/js-dart-interop/

like image 177
Seth Ladd Avatar answered Sep 20 '22 15:09

Seth Ladd