On Thursday, March 24, 2016 at 8:49:10 PM UTC+1, Paul Stockley wrote:
We currently have a large GWT application that we have been working on for the last 4 years. We use Uibinder and Widgets very
heavily, although we have our own Widget set and RPC mechanism. The application is being constantly expanded and realistically
won't be fully rewritten for 8-10 years. Given the news about J2CL not supporting widgets, I have been thinking about how we could
migrate to a world without widgets on an incremental basis.
In parallel, I have also being exploring writing native mobile apps. We tried the mobile web but it wasn't great and we really needed
hardware integration for NFC and total offline capabilities. Which brings us React. I found React Native and started researching
and playing around. I have to say I am very impressed. In my mind it is a game changer. They are getting close to allowing one code
base to support iOS, Android and the Web with only about 10-20% custom code for each platform.
The more I played with React Native, the more I liked the React declarative model for defining UI's. I started thinking that React
would be ideal for incrementally embedding within an existing GWT application. Facebook designed it so they could incrementally
role it out into their existing Web application. When GWT 2.8 beta came out, I wanted something to try the new JsInterop out on.
React seemed like a good candidate. After a couple of weeks of experimenting, I have a working proof of concept for React. I
tutorials and apply them to writing GWT React code without some huge mental translation.
I decided to try and port http://todomvc.com/examples/
react/#/to Java. The reason for this was so I could have a direct comparison
a 3rd party React component called React Router (https://github.com/reactjs/
react-router). This is pretty much the de facto standard
for routing in the React world. This proved that I could consume React components written by other people. Overall I am pleased with
how it turned out. I find the java version easier to follow, especially since the Prop types are explicit. It would be nice to support JSX
instead of the legacy createElement interface. However, it isn't terrible. The Java version was 465 lines in total vs 419 for the original
was actually only 414 lines. You can take a look at the code here :
At this point I am about 80% sure what I have created could become a viable production solution. The next steps I want to do are:
- Finish the API
- Test embedding Gwt React within an existing GWT Widget based application.
- Build an API for Redux (https://github.com/reactjs/
redux) and React Redux (https://github.com/reactjs/ react-redux) which is becoming the de facto standard for the MC in MVC. I will probably re-implement todomvc using this.
If I don't hit any roadblocks, I will either publish to Github or make the source publicly available. I haven't made my mind up on which approach I will take.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.