Please test: testing-loader.js

155 views
Skip to first unread message

Daniel LaLiberte

unread,
May 26, 2017, 2:10:57 PM5/26/17
to Google Visualization API, google-char...@googlegroups.com
Hello Google Charts users,

I have made available a new version of the loader, called testing-loader.js, that affects loading of all versions on the gstatic server.  I would appreciate if you could try it out before I make it the official loader.

To try it, all you have to do is change 'loader.js' to 'testing-loader.js', and reload your page.

This testing version is only temporary, however, so after you try it out, please revert to the normal loader.js, which will be updated with this new version after a couple weeks of testing.

I'm particularly interested in whether there is any regression for any of the browsers we support and any of the more complex loading configurations.

What's new in this loader?  From our standpoint, it is almost completely rewritten to be much more maintainable.  More interesting for users, it augments the callback mechanism with JavaScript's Promises.  So now you can do this:

<script type="text/javascript" src="https://www.gstatic.com/charts/testing-loader.js"></script>
<script>
  google.charts.load('current', { packages: ['corechart'] }).then(drawChart);
  function drawChart() { ... }
</script>

If you are using any of the earlier versions, 41-44, you are still limited to only one load call.  But the Promise mechanism works for them as well, if that helps.

And if you are feeling adventurous, there is a new version you can try now, 45.2, which I will begin releasing soon after the loader change is finished.

--

Nick Dunbar

unread,
May 27, 2017, 2:00:04 PM5/27/17
to Google Visualization API, google-char...@googlegroups.com
Dan
It doesn't work.

I just tried
<script type="text/javascript" src="https://www.gstatic.com/charts/testing-loader.js"></script>
<script type="text/javascript">
google.charts.load('45.2', {packages: ['treemap','corechart', 'controls', 'table']});
google.charts.setOnLoadCallback(drawChart);

...and got a blank screen in Safari. 

If I used the old loader with version 45.2 I got this error 

TypeError: d is not a function. (In 'd(a,c)', 'd' is null)

Regards, 
Nick

Daniel LaLiberte

unread,
May 27, 2017, 7:51:10 PM5/27/17
to Google Visualization API, google-char...@googlegroups.com
Hi Nick,

Seems to work fine for me, even outside of Google.  See: https://jsfiddle.net/vj6gzskr/ 
Can you provide an example that shows the failure you are seeing?

Version 45.2 won't work with the old loader, and I probably won't try to make it work since the old loader is going away anyway.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/cba78fa4-a383-448a-88af-c55f68651335%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ray Thomas

unread,
May 27, 2017, 10:51:32 PM5/27/17
to Google Visualization API, google-char...@googlegroups.com
I use Chrome 58, Firefox 52, IE 11, Edge 38 and here's what I found


<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

google.charts.load('current', {packages:['corechart', 'table', 'gauge', 'controls']});
google.charts.setOnLoadCallback(drawChart);

Chrome = OK, Firefox = OK, IE = OK, Edge = OK - Table works in all of them



<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

google.charts.load('45.2',{ packages: ['corechart', 'table', 'gauge', 'controls'] }).then(drawChart); 

Chrome = No, Firefox = No, IE = No, Edge = No - Table does not appear in any of them



<script type="text/javascript" src="https://www.gstatic.com/charts/testing-loader.js"></script>

google.charts.load('current',{ packages: ['corechart', 'table', 'gauge', 'controls'] }).then(drawChart);

Chrome = OK, Firefox = OK, IE = OK, Edge = OK - Table works in all of them



<script type="text/javascript" src="https://www.gstatic.com/charts/testing-loader.js"></script>

google.charts.load('45.2',{ packages: ['corechart', 'table', 'gauge', 'controls'] }).then(drawChart); 

Chrome = OK, Firefox = No, IE = No, Edge = No - Table does not appear in anything other than Chrome

Ray Thomas

unread,
May 27, 2017, 11:27:33 PM5/27/17
to Google Visualization API, google-char...@googlegroups.com
and for the sake of completeness:


<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

google.charts.load('current',{ packages: ['corechart', 'table', 'gauge', 'controls'] }).then(drawChart); 

Daniel LaLiberte

unread,
May 28, 2017, 7:15:06 PM5/28/17
to Google Visualization API, google-char...@googlegroups.com
I am seeing some problems loading 41-44 with the testing-loader.js on IE, so I'll have to figure out why that is.

My tests worked fine for me with Firefox, and Safari.

Don't bother testing 45.2 with the old loader.js since it won't work.  But testing-loader.js should work with 45.2, however, if you want to try it.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.

Jean-Rémi Delteil

unread,
May 29, 2017, 1:10:17 PM5/29/17
to Google Visualization API, google-char...@googlegroups.com
Hello Daniel,

It's awesome to see the promises integrated in Google Chart !

I did some tests with the testing-loader.js, (I'm still running on the v44), and found issue when using Edge (v40): loading just stall.
For info, i'm using this code to load the Gviz:

new Promise(function (resolve) {
google.charts.load('44', {
packages: ['table', 'corechart'],
callback: resolve
});
})
.then(function () {
// Do things
})

This code works perfectly fine when using the v45. (so I guess it's time to move on).

it will be so nice to replace the above by :

google.charts.load('45', {
packages: ['table', 'corechart']
})
.then(function () {
// Do things
});


By the way, I saw that you are using a Promise polyfill in the testing loader.
I'm sure a lot of people are also importing a promise polyfill, so it will bloat the code !?

Is it possible to make it optional ? or maybe add it with feature detection if it's not already there ?

Also, are you adding any polyfill on the global object ?


Best,

Jean-Rémi


On Monday, 29 May 2017 01:15:06 UTC+2, Daniel LaLiberte wrote:
I am seeing some problems loading 41-44 with the testing-loader.js on IE, so I'll have to figure out why that is.

My tests worked fine for me with Firefox, and Safari.

Don't bother testing 45.2 with the old loader.js since it won't work.  But testing-loader.js should work with 45.2, however, if you want to try it.
On Sat, May 27, 2017 at 11:27 PM, 'Ray Thomas' via Google Visualization API <google-visua...@googlegroups.com> wrote:
and for the sake of completeness:


<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

google.charts.load('current',{ packages: ['corechart', 'table', 'gauge', 'controls'] }).then(drawChart); 

Chrome = No, Firefox = No, IE = No, Edge = No - Table does not appear in any of them 

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.



--

Daniel LaLiberte

unread,
May 29, 2017, 3:32:29 PM5/29/17
to Google Visualization API, google-char...@googlegroups.com
Hi Jean-Rémi,

I also saw problems loading 41-44 on IE, so perhaps the problem with Edge is the same.  I'll be investigating, and hopefully will find a workaround.  

The Promise polyfill is almost certainly included in the loader to support more browsers that don't yet properly support Promises.  I don't know how it is implemented, though it is compiled-in rather than a separately loadable component, so it is not optional to load it, though hopefully it detects whether another polyfill is already being used.

I just read that IE11 doesn't support Promises, as of April 2015 while Edge does support Promises.  I wonder if the problem might be a bug in the polyfill that is replicated in Edge.   I would be surprised, however, since our use of Promises is not very advanced.


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Daniel LaLiberte

unread,
May 30, 2017, 8:10:11 PM5/30/17
to Google Visualization API, google-char...@googlegroups.com
The testing-loader.js should be working better now on ie and edge.  The problem was not related to Promises after all, but just a new use of getRootNode() which is not supported on ie or edge (yet).

Thanks for everyone's testing and reporting.  Please give it another try and let me know.

--

Jean-Rémi Delteil

unread,
May 31, 2017, 6:36:07 AM5/31/17
to Google Visualization API, google-char...@googlegroups.com
No more issues with either Edge nor IE11.
Nothing special to report on the other browsers.

From your usage of getRootNode, do you have in mind to get the Charts (and chartWrapper objects, dashboards) more compatible with shadow root ?


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

Daniel LaLiberte

unread,
May 31, 2017, 8:33:25 AM5/31/17
to Google Visualization API, google-char...@googlegroups.com
Indeed, the use of getRootNode is in support of a new feature to work with shadow roots.  If you specify an 'element' setting, it will be used as the element to append 'link' tags to when loading css.  

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
--



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Jean-Rémi Delteil

unread,
May 31, 2017, 9:49:05 AM5/31/17
to Google Visualization API, google-char...@googlegroups.com
This is an even better news !
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
--



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

Nick Dunbar

unread,
Jun 1, 2017, 4:40:11 PM6/1/17
to Google Visualization API, google-char...@googlegroups.com
Hey Dan,

Testing loader and version 45.2 works fine for me now. 

Have you documented the new stuff in 45.2, in terms of enhancements to the existing charts?

Regards, 

Nick 
To post to this group, send email to google-visua...@googlegroups.com.



--

Daniel LaLiberte

unread,
Jun 1, 2017, 5:09:25 PM6/1/17
to Google Visualization API, google-char...@googlegroups.com
I have not documented 45.2 yet since it is not actually released yet.  Just thought I would throw it out for people to try if they would like.  There is a lot of refactoring internally, but not much should be changed externally, and so I'll probably roll it into the v45 release and replace the v45 and v45.1 versions with v45.2.

Since we are not hearing any more problems with the new loader, I will be comfortable making it the standard loader next week, and then I will release 45.2 soon after that. 

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Ray Thomas

unread,
Jun 1, 2017, 8:37:22 PM6/1/17
to Google Visualization API, google-char...@googlegroups.com
It works on IE and Edge for me now as well. 

Ray

Daniel LaLiberte

unread,
Jun 10, 2017, 3:06:04 PM6/10/17
to Google Visualization API, google-char...@googlegroups.com
The loader has now (a couple days ago, actually) been replaced with this testing-loader.  Please report any problems.
Reply all
Reply to author
Forward
0 new messages