Closed Xaratas closed 7 years ago
We are about to release 1.7.0.0, scheduled to next week, and had not thought on this before. The current approach loads the polyfill when it is not loaded in order to have the whenReady. Although loading the polyfill in chrome is not a big deal because the polyfill skips patching everything that already is in the platform, probably there is a better approach and not load it at all. I don't think it is a big performance improvement, but will try to come with a solution today.
Fixed in Polymer.java, now it loads the polyfill only if the browser does not support native html imports. Obviously it also checks whether the polyfill was already loaded in order not to load twice. Use 1.7.0.0-SNAPSHOT until 1.7.0.0 is released next week. You can check out our demo http://vaadin.github.io/gwt-polymer-elements/demo and inspect that polyfil is not loaded in chrome, but in other browsers.
I will not hijack #112. But its somehow related.
Problem: If the polyfills are not loaded (because chrome is used), then your gwt bridge will not load the webcomponents polyfill by itself and try to call whenReady on undefined, because chrome does not natively create a HTMLImport „something“ in the window.
Code Reference: This line uses $wnd.HTMLImport.whenready https://github.com/vaadin/gwt-polymer-elements/blob/vaadin-gwt-polymer-elements-1.2.3.0/src/main/java/com/vaadin/polymer/Polymer.java#L364
We use the (general) platform check to include webcomponents polyfill only when necessary.
As we want to use the platform (remember the summit ;) ) is there a workaround or fix possible?