Closed rslawik closed 5 years ago
@wesalvaro What do you think about this?
We can merge this into master (Polymer 2 version) - there are no breaking changes. After that conversion to Polymer 3 (i.e. ES modules) should be as easy as running the modulizer (https://polymer-library.polymer-project.org/3.0/docs/upgrade#upgrade-a-project-using-modulizer).
Sorry to be slow, I thought my comments posted automatically.
Hmm... Any idea why this would cause the tests to fail?
Oh, yes, if (google && ...)
throws if google
is not defined. Replaced by typeof google !== 'undefined'
.
Tested with polymer test
.
Move loading Google Charts from a synchronous
<script>
to a dynamically added one (asynchronous). When this component is converted to ES modules, the synchronous behavior cannot be replicated. Luckily the component has been written in such a way (chart constructors are handled asynchronously) that this change is extremely simple.