gwtquery icon indicating copy to clipboard operation
gwtquery copied to clipboard

JSNIBundle load issue for highcharts 4.0.4

Open nloke opened this issue 10 years ago • 3 comments

I am not sure if this issue is with the HighCharts min js, the GWT compiler or gQuery It works with the src version of HighCharts.

Below is the code.

public abstract class HighChartsResources implements JsniBundle {
    @LibrarySource("js/highcharts.js")
    public abstract void initHighCharts();
}

HighChartsResources res = GWT.create(HighChartsResources.class);
res.initHighCharts();

Here is the error:

[ERROR] [testApp] - Errors in 'generated://721CE42A078E223CD7B634825141140F/com/test/client/resource/HighChartsResources_Impl.java'

16:06:07.021 [ERROR] [testApp] Line 48: syntax error
> ppendChild(f):g.parentNode.insertBefore(f,g);d.push(f)}this.shadows=d}return this},xGetter:function(a){this.element.nodeName==="circle"&&(a={x:"cx",y:"cy"}[a]||a);return this._defaultGetter(a)},_defaultGetter:function(a){a=p(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" "));
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

nloke avatar Nov 21 '14 21:11 nloke

Have you tried the non-minified version of the library?

manolo avatar Nov 21 '14 22:11 manolo

Yes as I have mentioned in the issue. The non-minified(highcharts.src.js) works.

On Friday, November 21, 2014, Manuel Carrasco Moñino < [email protected]> wrote:

Have you tried the non-minified version of the library?

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/gwtquery/issues/312#issuecomment-64047531.

nloke avatar Nov 22 '14 02:11 nloke

Sorry, I didn't read completely.

Using the src version is a perfect solution, since you can debug in superdevmode, and the code will be obfuscated and optimised by gwt compiler, and closure compiler if you enable the flag gwt compilation phase.

Minimised versions could have some issues because of optimisations, it's difficult to figure out where is it the actual problem, you have to play removing code until you get the cause. Probably something is not well escaped by the generator.

manolo avatar Nov 22 '14 21:11 manolo