PolymerElements / iron-icons

A set of icons for use with iron-icon

Home Page:https://www.webcomponents.org/element/PolymerElements/iron-icons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dependency ordering problem

sjmiles opened this issue · comments

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]).

+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.

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?

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

@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

+1, also running into this now on my app

This also happens on my minified & vulcanized app.

[iron-icon::_updateIcon]: could not find iconset `social`, did you import the iconset?

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

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

I can investigate this week 👍