Skip to content

Latest commit

 

History

History
77 lines (61 loc) · 3.31 KB

index.md

File metadata and controls

77 lines (61 loc) · 3.31 KB
title short-title description nextpage
JavaScript interoperability
JS interop
Integrate JavaScript code into your Dart web app.
url title
/interop/js-interop/usage
Usage

The Dart web platform supports communication with JavaScript apps and libraries, as well as browser APIs, using dart:js_interop.

Web developers can benefit from using external JS libraries in their Dart code, without having to rewrite anything in Dart.

Next-generation JS interop

The Dart team recently overhauled the collection of features and APIs that allow developers access to JavaScript and browser bindings in their Dart code. This next generation of web interop not only improves user experience, but also enables Wasm support, aligning Dart with the future of the Web.

The following table maps Dart's new JS and web interop solutions to their past counterparts:

New interop libraries Previous libraries
package:web dart:html
dart:indexed_db
dart:svg
dart:web_audio
dart:web_gl
dart:js_interop
dart:js_interop_unsafe
package:js
dart:js
dart:js_util

{:.table .table-striped}

The Dart interop story has been under heavy development for some time now; check out the Past JS interop page for a more in depth summary on past iterations.

Overview

For information on how to write and use JavaScript interop:

For information on interacting with web APIs:

For tutorials and help:

For information on previous JavaScript interop libraries:

For additional documentation on JavaScript interop: