elemental2 | Type checked access to browser APIs for Java code | SDK library

 by   google Java Version: 1.1.0 License: Apache-2.0

kandi X-RAY | elemental2 Summary

kandi X-RAY | elemental2 Summary

elemental2 is a Java library typically used in Utilities, SDK applications. elemental2 has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However elemental2 build file is not available. You can download it from GitHub, Maven.

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.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              elemental2 has a low active ecosystem.
              It has 134 star(s) with 41 fork(s). There are 33 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 18 open issues and 70 have been closed. On average issues are closed in 220 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of elemental2 is 1.1.0

            kandi-Quality Quality

              elemental2 has 0 bugs and 16 code smells.

            kandi-Security Security

              elemental2 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              elemental2 code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              elemental2 is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              elemental2 releases are available to install and integrate.
              Deployable package is available in Maven.
              elemental2 has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 977 lines of code, 50 functions and 20 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed elemental2 and discovered the below as its top functions. This is intended to give you an instant insight into elemental2 implemented functionality, and help decide if they suit your requirements.
            • On load
            • Install the UI UI
            • Write a message to the page
            • Get resolved value
            • Add Java types to the given program
            • Add as array helper methods
            • Clean common array methods
            • Helper function to improve the concat method
            • Called when the form is submitted
            • Add a result
            • Clears the results
            • Remove all event listeners from the given program
            • Checks if the given type implements EventTarget or EventTarget
            • Cleans event listener method
            • Find the type of a callback parameter
            • Determines if the method is a add or remove event listener method
            • All promises from one or more promises
            • Returns a promise that matches the given promises
            • Add the hello world
            • Print hello world
            • Installs the load listener
            Get all kandi verified functions for this library.

            elemental2 Key Features

            No Key Features are available at this moment for elemental2.

            elemental2 Examples and Code Snippets

            No Code Snippets are available at this moment for elemental2.

            Community Discussions

            QUESTION

            How to import custom jar (not gwt module) to gwt project
            Asked 2021-Dec-31 at 01:16

            I struggle with adding my custom jar to gwt compiler.

            I've check tons of internet and can not find answer. I found solution to add module.gwt.xml file to this custom jar library and import it in my gwt app app.gwt.xml as follow: But this will make my custom java library gwt aware and this is anti pattern for me. As I will spoil backend common library with gwt (which is just UI detail).

            I would like to follow approach with entry but I can configure it only for local java classes. I do not know how to do this for external jar.

            Please help

            Here are steps I've done already:

            I've added source plugin to pom.xml of my custom jar as follow:

            ...

            ANSWER

            Answered 2021-Dec-31 at 01:16

            You dont need to modify the jar, all you need is to create a gwt.xml file in your own project/client module that has its sources tag points to the pojos package.

            What I would do is to create a package in my client module com.ia.ia.maintenance and add a new gwt.xml there Maintenance.gwt.xml

            Source https://stackoverflow.com/questions/70532611

            QUESTION

            Should I stop using GSS etc. if I want to be ready for GWT 3?
            Asked 2020-Sep-05 at 13:11

            I've ditched GWT Widgets in favor of JsInterop and Elemental2.

            But I'm still using modules from "gwt-user.jar" for GSS, Resources, and I18N.

            Are these modules likely to be supported in the next version of GWT? If not, is there a future-friendly alternative that I can use?

            I'm just starting out, so I'd rather get it "right" now, than have to unpick it later on.

            ...

            ANSWER

            Answered 2020-Sep-05 at 13:11

            If you are looking for a nice GWT3/J2CL ready widget lib, please take a look here: https://github.com/DominoKit/domino-ui.

            You'll find a demo app here: https://demo.dominokit.org/home

            Domino-ui is based on Elemento (https://github.com/hal/elemento) With Elemento you can create J2CL-ready widgets really easy.

            Regarding your question about the modules: We are currently working on making the GWT modules J2CL ready. A few of them are already released to Maven Central as rc1. For more informations take a look here: https://docs.google.com/spreadsheets/d/15WXfiklnTeqjRLI8gKj5iyGk7iDhnuQHGcpYJgpNlmQ/edit#gid=0

            and here:

            https://docs.google.com/spreadsheets/d/1b1D9fEqRh5lZ8cqMJtYoc_25rfTRvsuJkTtS2vjgi3o/edit#gid=0

            Our goal is to make the migration as easy as possible. Mostly just replacing com.google.gwt with org.gwtproject and GWT.create statements with something like new ...Impl. The new modules will work with GWT 2 & GWT 3/J2CL. At the moment a real drawback is, that only a few modules have made it's way to Maven Central. I would suggest to stay with the old modules and wait until the new modules are available in Maven Central.

            There are two Gitter rooms that might be of interest you you:

            Source https://stackoverflow.com/questions/63744560

            QUESTION

            How does Js.cast() perform its type checking?
            Asked 2020-May-26 at 16:54

            I'm using GWT 2.9 with elemental2-1.0.0-RC1.

            The following code throws a ClassCastException at runtime:

            ...

            ANSWER

            Answered 2020-May-26 at 16:54

            Js.cast() is a way to cheat a bit, and do something that the Java language will not permit, but might actually be legal. Ignoring "how it actually works", the idea is that you can now get past issues where Java would complain, even if it turns out to be legit.

            An example could be where you take a java.lang.Double or double and want to treat it as a JsNumber so you can call toPrecision(2) on it. Since java.lang.Double is final, it isn't legal to cast to an unrelated type, but Java doesn't know that in GWT, Double is really just a js Number. So, instead you can perform the cast with Js.cast(). The compiler will insert a runtime type check in there, verifying at runtime that your number is in fact a JS Number instance.

            Another example could be trying to extend some native type that elemental2 provides, either to implement a workaround for a missing feature, or to do something browser-specific. Your new class may not extend the existing class - from JS's perspective this is okay, you are just describing the API that you know will exist at runtime. As such, we need to avoid the Java language check of "does this cast even make sense?", and just tell the compiler to try it.

            On the other hand, you can "lie" to the compiler with Js.uncheckedCast(). This is used in cases where you are even asking the runtime to skip the check, and just pretend that it will work. This can let you do weird things, like treating Strings as if they were arrays, or solve cross-frame problems. No runtime check will be emitted, so instead you might just get a TypeError if a method/property is missing, instead of a proper ClassCastException.

            In elemental2-dom 1.0.0-RC1, there is a class called DocumentRange, but it doesnt really make any sense - it is declared as a class, which means it can be type checked in JS, but the browser spec says that it should be an "interface" (which in JS-land means that it just is a description of a type, rather than something you can typecheck). https://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-DocumentRange-method-createRange

            This bug is inherited from closure-compiler, which claims that this has a constructor: https://github.com/google/closure-compiler/blob/6a418aa/externs/browser/w3c_range.js#L241-L251

            The fix is for closure-compiler to refer to this as an interface, and for a new release of elemental2 to be made so you can use this.

            There are two workarounds you can make here. The first is to cheat with Js.uncheckedCast(DomGlobal.document) and say "yes, I know that the Document is not instanceof DocumentRange, but that's because there is no such class as DocumentRange, so just pretend it worked so I can call createRange() on it". This is what you are doing already - it hides the fact there is a bug, but at the end of the day it works.

            The "correct" answer is to declare your own DocumentRange, and do a Js.cast() to that instead. This is still gross - you have to keep your new interface around until closure gets fixed, and then elemental2 gets released, and then you have to remember to clean it up.

            In this case, I would suggest lying to GWT and using Js.uncheckedCast() - there is only a single method on here, and it is unlikely to change in a meaningful way.

            Source https://stackoverflow.com/questions/62018107

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install elemental2

            You can also download manually the jars 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.
            Install Bazelisk:
            Clone this git repository: $ git clone https://github.com/google/elemental2.git
            Run the release script: $ cd elemental2 $ ./maven/release_elemental.sh --version local --no-deploy

            Support

            Please refer to the contributing document.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/google/elemental2.git

          • CLI

            gh repo clone google/elemental2

          • sshUrl

            git@github.com:google/elemental2.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular SDK Libraries

            WeiXinMPSDK

            by JeffreySu

            operator-sdk

            by operator-framework

            mobile

            by golang

            Try Top Libraries by google

            guava

            by googleJava

            zx

            by googleJavaScript

            styleguide

            by googleHTML

            leveldb

            by googleC++