PolymerElements / iron-icons

A set of icons for use with iron-icon
https://www.webcomponents.org/element/PolymerElements/iron-icons
105 stars 61 forks source link

dependency ordering problem #18

Closed sjmiles closed 8 years ago

sjmiles commented 9 years ago

iron-icons imports iron-icon before it defines any icons. This creates a race condition where under some circumstances (generally dynamic loading) icon instances upgrade before the iconset is available.

Putting the iron-icon import at the bottom of the file solves the problem for iron-icons specifically, but if one were to subsequently load one of the other icon sets, you have the same problem (dependent icon instances may have already upgraded).

Either iron-icon has to be able to adapt to lazily loaded iconsets, or we have to remove iron-icon import from icon-sets and require users to import iron-icon only after all iconsets are loaded (or otherwise synchronize manually [i.e. avoid creating dependent icons before the necessary icon-set is loaded]).

adalinesimonian commented 9 years ago

+1

I'd personally vouch for the ability to account for lazily loaded iconsets rather than forcing load order, as I can envision several scenarios in a larger app where lazily loaded content could import its own iconsets.

cdata commented 9 years ago

It sounds like it would be useful to be able to request iconsets via an asynchronous interface internal to the icon (or perhaps, as part of a behavior that can be applied to anything that wants to deal with iconsets). Instead of failing when an iconset isn't available, the iconset can trigger an event when it is eventually available that causes the original asynchronous iconset request to be fulfilled. WDYT?

sjmiles commented 9 years ago

Yes, I'm thinking the same thing. I suspect iron-meta should support a notification event (events are our promises).

ebidel commented 8 years ago

@sjmiles @cdata do we have any update on this? It's still a pretty big issue and causes missing icons :.

Specifically, I'm running into this by using an async import in our codelab frontend for Polymer Summit. The first two imports in my app are:

<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../bower_components/iron-icons/image-icons.html">

which causes:

screen shot 2015-08-12 at 1 14 22 pm

robdodson commented 8 years ago

+1, also running into this now on my app

mazswojejzony commented 8 years ago

This also happens on my minified & vulcanized app.

[iron-icon::_updateIcon]: could not find iconset `social`, did you import the iconset?
arthurevans commented 8 years ago

+1 I run into this intermittently, especially when working with jsbin-type samples. It's extremely frustrating. Can we prioritize this?

RedBrogdon commented 8 years ago

+1 for prioritizing if possible. I'm getting this as well.

samccone commented 8 years ago

I can investigate this week 👍