ArcBees / gwtquery

A jQuery clone for GWT, and much more.
MIT License
85 stars 38 forks source link

JSNIBundle load issue for highcharts 4.0.4 #312

Open nloke opened 9 years ago

nloke commented 9 years ago

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(" "));
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
manolo commented 9 years ago

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

nloke commented 9 years ago

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

On Friday, November 21, 2014, Manuel Carrasco Moñino < notifications@github.com> 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.

manolo commented 9 years ago

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.