Errai: The browser as a platform

Thursday, November 10, 2016

Errai 4.0.0.Beta4 released!

Greetings!

Errai 4.0.0.Beta4 is now available. This release contains mostly bug fixes, but here are some noteworthy changes:
  • Upgrade GWT to 2.8.0 and Guava to 20.0
  • The Errai Tutorial now showcases Errai's JS interop integration

Errai Tutorial Enhancments

A major vision of Errai 4 has been more support for working directly with the DOM and more support for using JS interop. With this latest round of enhancements, the Errai Tutorial now showcases this vision and below I'll highlight some of the major features in action.

UI Components without GWT Widgets

The Errai Tutorial now showcases UI components built without any GWT widgets [1] [2]. These components are built with Errai templating using JS interop wrappers for interacting with the DOM; Element wrappers are used in place of GWT widgets and DOM events in place of GWT widget events.

One big advantage of this approach is that the markup of these UI components at runtime is exactly the same as the template HTML. Because GWT widgets are often implemented with multiple tags and custom CSS classes, using widgets as @DataFields can result in UI components rendering differently than their templates render when viewed outside the application.

Custom JS Interop Wrappers for DOM Elements and Web Components

The Errai Tutorial demonstrates how you can integrate web components with your Errai app, and how you can write your own custom element wrappers with specialized data-binding behaviour.

The tutorial now uses the Polymer paper-input and paper-textarea web components as part of a @Templated form. These components can be injected and used as @DataFields (as they are here). By using Errai's new HasValue interface for native @JsTypes with the @JsProperty annotation, these wrappers declaratively instruct Errai to use the "value" property of the paper elements for data-binding.

The tutorial also includes custom anchor element wrappers that showcase more complex data-binding behaviour. The BindableEmailAnchor is a wrapper for an anchor element that uses HasValue and @JsOverlay so that @Bound instances will display an email address as a mailto link as well as in the anchor text content.

Since the @JsOverlay method implementation is the only code generated by the GWT-compiler for a native @JsType, this is a light-weight way to declare element interfaces with custom data-binding behaviour.

Uses JQuery to Demonstrate Third-Party JavaScript Integration

The Errai Tutorial has a wrapper for a small subset of JQuery to showcase third-party JavaScript integration. With only a single @Produces annotation added to the JQuery wrapper, it is possible to inject the JQuery function for use in GWT code.

In general, we on the Errai team believe that using dependency injection is a best practice, but this is especially important with native JavaScript objects. By injecting the JQuery function rather than accessing it through a static method, it is much easier to mock out that object and test the code using it in a Java SE environment.

Try It Out and Give Us Your Feedback

We encourage you all to check out Errai 4.0.0.Beta4 and our new tutorial and share with us your feedback, whether that feedback is bug reports to our JIRA page, or more general disucssion in our forum.

Until the next time, happy coding!

7 comments:

  1. your articles following all these tips for a web dev

    ReplyDelete
    Replies
    1. i am ERIC BRUNT by name. Greetings to every one that is reading this testimony. I have been rejected by my wife after three(3) years of marriage just because another Man had a spell on her and she left me and the kid to suffer. one day when i was reading through the web, i saw a post on how this spell caster on this address AKHERETEMPLE@gmail.com have help a woman to get back her husband and i gave him a reply to his address and he told me that a man had a spell on my wife and he told me that he will help me and after 3 days that i will have my wife back. i believed him and today i am glad to let you all know that this spell caster have the power to bring lovers back. because i am now happy with my wife. Thanks for helping me Dr Akhere contact him on email: AKHERETEMPLE@gmail.com
      or
      call/whatsapp:+2349057261346




      i am ERIC BRUNT by name. Greetings to every one that is reading this testimony. I have been rejected by my wife after three(3) years of marriage just because another Man had a spell on her and she left me and the kid to suffer. one day when i was reading through the web, i saw a post on how this spell caster on this address AKHERETEMPLE@gmail.com have help a woman to get back her husband and i gave him a reply to his address and he told me that a man had a spell on my wife and he told me that he will help me and after 3 days that i will have my wife back. i believed him and today i am glad to let you all know that this spell caster have the power to bring lovers back. because i am now happy with my wife. Thanks for helping me Dr Akhere contact him on email: AKHERETEMPLE@gmail.com
      or
      call/whatsapp:+2349057261346

      Delete
    2. WITH THE HELP OF  DR PERFECT ENLARGEMENT CREAM MY PENIS GROW  FROM 3 INCHES TO 9 INCHES YOU CAN ON EMAIL AT SOLUTIONTOALLPROBLEMS1@GMAIL.COM

      Hello everyone I have to give my testimony about a herbal doctor called Dr Perfect. I was heartbroken because I had a very small penis not good enough to satisfy a woman, I have been in so many relationships but they were cut off because of my situation, I have used so many products prescribed by the doctor but none could render me the help I was looking for, so I decided to search online for solution and I saw a lot of comments about this specialist called Dr Perfect on how he helped people with small penis, cancer and others so I decided to give his herbal product a try, I messaged him on WhatsApp and replied me back, he gave me some comforting words we talked on how i can receive the product and he sent me his herbal product for penis enlargement, within 1 week of using it I began to feel the enlargement of my penis, now it just two weeks of me using his products my penis is about 9 inches longer, and I settle things with my girlfriend I was surprised when she said that she is satisfied with my performance in bed and am happy that i have a big penis now all thanks to Dr Perfect feel free to contact Dr Perfect at solutiontoallproblems1@gmail.com or WhatsApp him +1(256)251-3614 and get your enlargement cream 






      WITH THE HELP OF  DR PERFECT ENLARGEMENT CREAM MY PENIS GROW  FROM 3 INCHES TO 9 INCHES YOU CAN ON EMAIL AT SOLUTIONTOALLPROBLEMS1@GMAIL.COM

      Hello everyone I have to give my testimony about a herbal doctor called Dr Perfect. I was heartbroken because I had a very small penis not good enough to satisfy a woman, I have been in so many relationships but they were cut off because of my situation, I have used so many products prescribed by the doctor but none could render me the help I was looking for, so I decided to search online for solution and I saw a lot of comments about this specialist called Dr Perfect on how he helped people with small penis, cancer and others so I decided to give his herbal product a try, I messaged him on WhatsApp and replied me back, he gave me some comforting words we talked on how i can receive the product and he sent me his herbal product for penis enlargement, within 1 week of using it I began to feel the enlargement of my penis, now it just two weeks of me using his products my penis is about 9 inches longer, and I settle things with my girlfriend I was surprised when she said that she is satisfied with my performance in bed and am happy that i have a big penis now all thanks to Dr Perfect feel free to contact Dr Perfect at solutiontoallproblems1@gmail.com or WhatsApp him +1(256)251-3614 and get your enlargement cream 

      Delete
  2. Looks good, thanks for sharing! Thanks for writing such great texts.
    organic noni

    ReplyDelete
  3. Useful article, thank you for sharing the article!!!

    Website bloggiaidap247.com và website blogcothebanchuabiet.com giúp bạn giải đáp mọi thắc mắc.

    ReplyDelete
  4. i am ERIC BRUNT by name. Greetings to every one that is reading this testimony. I have been rejected by my wife after three(3) years of marriage just because another Man had a spell on her and she left me and the kid to suffer. one day when i was reading through the web, i saw a post on how this spell caster on this address AKHERETEMPLE@gmail.com have help a woman to get back her husband and i gave him a reply to his address and he told me that a man had a spell on my wife and he told me that he will help me and after 3 days that i will have my wife back. i believed him and today i am glad to let you all know that this spell caster have the power to bring lovers back. because i am now happy with my wife. Thanks for helping me Dr Akhere contact him on email: AKHERETEMPLE@gmail.com
    or
    call/whatsapp:+2349057261346




    i am ERIC BRUNT by name. Greetings to every one that is reading this testimony. I have been rejected by my wife after three(3) years of marriage just because another Man had a spell on her and she left me and the kid to suffer. one day when i was reading through the web, i saw a post on how this spell caster on this address AKHERETEMPLE@gmail.com have help a woman to get back her husband and i gave him a reply to his address and he told me that a man had a spell on my wife and he told me that he will help me and after 3 days that i will have my wife back. i believed him and today i am glad to let you all know that this spell caster have the power to bring lovers back. because i am now happy with my wife. Thanks for helping me Dr Akhere contact him on email: AKHERETEMPLE@gmail.com
    or
    call/whatsapp:+2349057261346

    ReplyDelete
  5. WITH THE HELP OF  DR PERFECT ENLARGEMENT CREAM MY PENIS GROW  FROM 3 INCHES TO 9 INCHES YOU CAN ON EMAIL AT SOLUTIONTOALLPROBLEMS1@GMAIL.COM

    Hello everyone I have to give my testimony about a herbal doctor called Dr Perfect. I was heartbroken because I had a very small penis not good enough to satisfy a woman, I have been in so many relationships but they were cut off because of my situation, I have used so many products prescribed by the doctor but none could render me the help I was looking for, so I decided to search online for solution and I saw a lot of comments about this specialist called Dr Perfect on how he helped people with small penis, cancer and others so I decided to give his herbal product a try, I messaged him on WhatsApp and replied me back, he gave me some comforting words we talked on how i can receive the product and he sent me his herbal product for penis enlargement, within 1 week of using it I began to feel the enlargement of my penis, now it just two weeks of me using his products my penis is about 9 inches longer, and I settle things with my girlfriend I was surprised when she said that she is satisfied with my performance in bed and am happy that i have a big penis now all thanks to Dr Perfect feel free to contact Dr Perfect at solutiontoallproblems1@gmail.com or WhatsApp him +1(256)251-3614 and get your enlargement cream 

    ReplyDelete