I know…you probably going to say this is a Polymer issue.
But I am not totally sure, because when I render this simple layout:
template(name="globalLayout2")
paper-drawer-panel
paper-header-panel(drawer)
paper-toolbar
div Application
div Drawer content...
paper-menu
paper-icon-item
iron-icon(icon="inbox" item-icon)
| Inbox
paper-header-panel(main='')
paper-toolbar
paper-icon-button(icon='menu', paper-drawer-toggle='')
div Title
div Main content...
it doesnt show the iron-icon in Chrome. Safari works fine.
However, when I display the paper Icon demo: http://localhost:3000/components/paper-item/demo/index.html
which runs without Meteor or Blaze, the icons work fine.
So…could it be Blaze that is messing things up in the Polymer load order for Chrome?
which is just true or false based on the firing of WebComponentsREady event, it does render normally.
Bit annoying of course to postpone loading till this event has fired.
I dont see any bug, as chrome have this native support, it loads it god damn fast.
That means components which does not depend on any longer operation (as loading icon set could be) are loaded and ready very fast.
And if you decide to wait for that longer iconset loading operation (which is not even direct import in these components) than u need to orchestrate it yourself. It nicely provide event which you just need to wait to be on safe side.
From my point of view Polymer handle it correctly.
Same as using cordova in meteor, u need to wait till all is rdy and thats why u put it in startup function.
why was it working fine in Poylemer 0.5 then?
It only doesnt seem to work in combination with Blaze. The fact that Blaze renders the template and the Polymer elements messes something up with dependency load order IMO
So if u want to use dependencies, you probably need your own element to wrap them and than use that element.
But still it does not sounds like clean solution to me.
No, I dont want dependencies.
I just use a paper element with an iron-icon. Nothing wrong with that, right?
I copy stuff from the demo’s of Polymer.
It breaks when loaded through Blaze.
The dependency I mention are only the initial imports of the elements in the head.
Have you tried a simple meteor app with a paper-icon like this:
If you generate whole html and let Polymer loads afterwards, result will be OK
If you let Polymer loads and add elements afterwards, result will be OK.
If you pick random moment in between to generate, results does not have to be right.
How you dont want dependencies? You want to have iron-icon and iron-icons loaded and these 2 elements have 0 connections between them. Still u expect them to sync somehow… but just expect
In my meteor project I have my import.html file where I load the record polymer elements, right. That should be okay.
Then I use Iron-Router (or flow router in another test) and I have a globalLayout where I load the standard Scaffold within the globalLayout template (blaze). Just Polymer elements.
Within the drawer I load my menu, paper-menu with paper-elements that have an iron-icon.
All stanard.
However, it doesnt load the icons. Triggers the “Could not find XXX icon set…”.
When using the WebComponentsReady Event to start rendering the Blaze template, the Icons work. But then the Scaffold falls apart.
I am not user what you mean with “Pick random moments”… I am just defining a Template.
Probably best way would be to wait with rendering whole template till that webcomponents rdy is done. Not just minor template, the whole Polymer element scaffold.
But this deferring Blaze load until webcomponentsReady actually triggers the error that the scaffold doesnt load correctly anymore. That was the other issue I posted and you replied on.
from that example we cant see if he is deffering render.
only thing visible is re-render.
So I would not render any polymer component before that reactive variable is true.
Just yeld some dummy template, or in the main template prepare helper monitoring that ready.get() for example isReady and than use it {{#if isReady …
I am pretty sure It does defer, because on startup we replace the render function with a function that only calls the original render when the ready = true.
But anyway…I is only chrome related so it is a bug and would be fixed by the polymer team.
It is kinda annoying to develop in version 0.5 again but I am running into to many issues right now with 1.0