Elemental2 provides type checked access to all browser APIs for Java code. This
is done by using closure extern files
and generating JsTypes, which are part of the new JsInterop specification
that is both implemented in GWT and J2CL.
Bazel dependencies
Using Bazel 8 or later, add to your `MODULE.bazel` file:
bazel_dep(name = "elemental2", version = "<RELEASE_VERSION>")
Elemental2 ·
· 
Elemental2 provides type checked access to all browser APIs for Java code. This is done by using closure extern files and generating JsTypes, which are part of the new JsInterop specification that is both implemented in GWT and J2CL.
Bazel dependencies
Using Bazel 8 or later, add to your `MODULE.bazel` file:
Replace
RELEASE_VERSIONwith an actual release version:Now from you can add elemental2 targets as needed to your
j2cl_librarydeps.Following are the different elemental2 modules and their target names:
@elemental2//:elemental2-core-j2cl@elemental2//:elemental2-dom-j2cl@elemental2//:elemental2-promise-j2cl@elemental2//:elemental2-indexeddb-j2cl@elemental2//:elemental2-svg-j2cl@elemental2//:elemental2-webgl-j2cl@elemental2//:elemental2-media-j2cl@elemental2//:elemental2-webstorage-j2clMaven dependencies
If your project uses Maven, add the following maven dependencies in your
pom.xml. ReplaceRELEASE_VERSIONwith an actual release version:elemental2-coreelemental2-domelemental2-promiseelemental2-indexeddbelemental2-svgelemental2-webglelemental2-mediaelemental2-webstorageGWT
If you use Elemental2 with GWT, you need to inherit the right gwt module in your
gwt.xmlfile:elemental2.core.Coreelemental2.dom.Domelemental2.promise.Promiseelemental2.indexeddb.IndexedDbelemental2.svg.Svgelemental2.webgl.WebGlelemental2.media.Mediaelemental2.webstorage.WebStorageBuild GWT compatible maven jar files
If you want to modify and/or build the last version on your own, follow the instructions below:
The script will output the directory containing the generated jar files that can be used with maven.
Contributing
Please refer to the contributing document.
Licensing
Please refer to the license file.
Disclaimer
This is not an official Google product.