gwt-leaflet
gwt-leaflet copied to clipboard
Add version validation support
I see that we need to add some version validation support for JSNI wrapper methods. This also involves allowing the user to choose which version of wrapped 3rd-party js-script should be loaded by GWT.
I see two options,
*Add multiple .gwt.xml module definitions, each specifying a different 3rd-party version.
This is easy to implement. For example leaflet version 0.4.5 becomes *.Core_045.gwt.xml
. This approach could also be adapted to user-specified leaflet library where the path is hard-coded to a location which the user has access to, for example *.Core_custom.gwt.xml
includes .../WEB-INF/lib/leaflet/custom/leaflet.js
.
Add method for support for user-specified version
This is more flexible, but have serveral issues which makes the code more complex. First of all, any version-to-js mapping must be specified such that the 3rd-party library is loaded BEFORE any GWT entry-point is loaded. GWT solves this for us when scripts tags are specified in the *.gwt.xml
file. There are solutions to this problem, but it involves callbacks which make the code less readable. I have some ideas on how to overcome this problem.
I think the last options is the best. I will look into it and report back.