GWT or Javascript? A Vaadin expert's opinion. by Haijian Wang #GWTcon2016 - Firenze 14-15th November 2016
G W T O R J A V A S C R I P T ?A V A A D I N E X P E R T ’ S O P I N I O NH A I J I A N W A N G
View Slide
Is GWT Dying?Scary Questions FirstShould I use JavaScript Instead?
Scary Questions FirstToo Scary to answer
Let’s limit the scope to VaadinapplicationToo Scary to answer
What is Vaadin?A Java web framework forbuilding Web applications.
AWhat is Vaadin?Server Side Java web framework forbuilding Web applications.
How does Vaadin application look like?
Vaadin Application Architecture
GWT or JavaScript?Custom Widget: two approaches
•Language Preference•Community Support•Development Speed•RequirementConsiderations
Language PreferenceJavaScript sucks?https://www.youtube.com/watch?v=xE8tL8NdHaYOr not.
Community Support
Development Speed•Widgetset Compilation•Debugging
RequirementCase studies•Workflow canvas in SVG•Disable backspace navigation
Workflow Canvas in SVG
Workflow Canvas in SVGraphael4gwt->Snap.svg-> Raphaël?
Disable backspace navigationEvent.addNativePreviewHandler(new NativePreviewHandler() {@Overridepublic void onPreviewNativeEvent(NativePreviewEvent event) {if(event.getNativeEvent().getKeyCode() == KeyCodes.KEY_BACKSPACE) {if(!WidgetUtil.isFocusedElementEditable()) {event.getNativeEvent().stopPropagation();event.getNativeEvent().preventDefault();}}}});
Disable backspace navigationIt’s now disabled by default sinceChrome 52.
Conclusion•GWT is NOT dead.•It’s fun to learn some JavaScript.•Choose whichever fits you best.
Q U E S T I O N S ?
G R A Z I E