Tuesday 10 March 2015

GWT 2.7 Features

GWT 2.7 Include following feature which are listed Below,

SuperDev mode as default
The Main feature in GWT 2.7 is SuperDev mode(SDM), with Dev mode now deprecated. You use the browser’s built in debugger and don’t need to use any browser plugins. With SDM, all of your debugging happens right inside your browser, making it easier to debug mixed Java/Javascript code. If you are familiar with Super Dev Mode in 2.6, you will also notice that you no longer need any bookmarklets to enable/recompile when using Super Dev Mode, the code is recompiled automatically when you reload the page.

Incremental compilation
If you have a large GWT project, you will instantly notice the incremental compilation feature of GWT 2.7. No longer will Super Dev Mode recompile your full project but instead only recompile the changed parts. The speedup in development is significant.

Easier Javascript integration
The new annotation based JsInterop allows you to quickly and easily integrate your GWT classes with Javascript. Instead of writing JSNI methods/JSO classes, you can simply annotate (@JSType, @JSProperty) which Javascript should be mapped to your Java file.
An example of JSInterop , by reducing the amount of code from
class Window extends JavaScriptObject {
  public native void alert(String msg)/-*{
    this.alert(msg);
  }-*/;
  public native boolean void confirm(String msg)/-*{
    this.confirm(msg);
  }-*/;
  public native boolean addEventListener(String event, EventListener listener)/-*{
    var callback = function(evt) {
    listener.@com.google.gwt.user.client.EventListener::onBrowserEvent(*)(evt);
    };
    this.addEventListener(event, callback);
  }-*/;
}
to just this
@JsInteface
interface Window {
  void alert(String msg);
  boolean confirm(String msg);
  void addEventListener(String event, EventListener listener);
}
Do note that JsInterop is still experimental in GWT 2.7 and will likely change in the future. You will need to add an X flag to the compiler to enable it in GWT 2.7

New GSS resources
CssResource is using Flute to parse the CSS, but it only supports CSS2 and a couple of features added for Gwt. With GssResource, GWT comes to a new era, not only supporting modern CSS syntax but also the Closure Stylesheets semantics. Now it will be even easier to write CSS since the closure processor adds variables, functions, conditionals, mixins and much more to the standard CSS3.
@def PADDING_RIGHT 50px;
@def PADDING_LEFT 50px;

@defmixin size(WIDTH, HEIGHT) {
  width: WIDTH;
  height: HEIGHT;
}

.class-name {
    @mixin size(add(PADDING_RIGHT, 150px, PADDING_LEFT), 50px);
    padding-right: PADDING_RIGHT;
}
Both CssResources and GssResources will live together in 2.7.0 for backward compatibility, but the old one will be removed in a future release.

For more Information see the Release note www.gwtproject.org

No comments:

CSS Selectors

  CSS Selectors In CSS, selectors are patterns used to select the element(s) you want to style There are 3 different types of CSS selectors ...