Even the best can be better

22 views
Skip to first unread message

eliaspan...@gmail.com

unread,
Sep 1, 2015, 4:43:10 AM9/1/15
to gwtquery
Hi all,

I recently discovered GQuery and I am really impressed. Apart from the simplicity it introduces in DOM manipulation compared to GWT Widgets, it seems to solve more problems than the upcoming JsInterop intends to do, using simpler, clearer and more robust (e.g. by supporting dead code removal from external JS libraries) solutions.

As I always do before adopting a new tool I took a look at the source code here and there to understand the methodologies and solutions used. Please find below some of my comments which may or may not be important or even correct:

1. Class JsCash: In several cases the JS method Object.indexOf is used in methods, but it is not supported from IE < 9. It seems that the relevant methods are not used in other parts of the library so maybe the problem remains hidden. Unfortunately IE8 is still the only browser that many large institutions use, as they still have Windows XP on their workstations and they do not permit the installation of other browsers.

2. In several classes of the package com.google.gwt.query.client.js many boxing - unboxing operations seem to take place for converts between JS and Java variables. I am not sure if these operations reflect on the compiled JS code, but in such case, given that since GWT 2.7 @JsType is available, my proposal is a simple @JsType class (i.e @JsType class JsValue { }) to be used for transferring JS values (both primitives and objects) through Java. Potential casts could be performed in the class JsValue.

3. I noticed that in the method inputStreamToString of the generator JsniBundleGenerator the "bytes" stream is never closed. This may cause memory leaks during subsequent compilations. However, it seems that the issue does not affect the derived code and its effect in development phase is rather insignificant.

Guys congratulations for the excellent job!!! Please keep the project live.

Regards,
Elias
Reply all
Reply to author
Forward
0 new messages