I'm looking at potentially bringing file-icons support back to Nuclide (https://github.com/facebook/nuclide/issues/951 – sorry for the long delay).
Since Nuclide uses React, DOM nodes for file names get re-used _very_ frequently, eg. in quick-open and in the file-tree. I've built a React wrapper that applies addIconToElement to the underlying DOM nodes whenever the path changes. However, the disposable returned from addIconToElement does not reset the classnames applied by addIconToElement to the DOM node. I think it would be cleaner if the disposable not only removed references to the attached node from file-icons, but actually reverted all DOM side-effects caused by addIconToElement.
console.log(element.className);
// 'initial-classname'
const disposable = addIconToElement(element, 'foo.js');
console.log(element.className);
// 'initial-classname js-icon medium-yellow'
disposable.dispose();
console.log(element.className);
// CURRENT: 'initial-classname js-icon medium-yellow'
// IDEAL: 'initial-classname'
Awesome. Thanks for the quick turnaround!
Nope, thank YOU for taking care of this for us. Seriously.
Can you ping me once Nuclide has integrated file-icon support, please?
@Alhadis just a heads-up, next weeks' Nuclide release will include the file-icons compatibility fixes (and it looks _really_ nice; thanks for all your work on this!)
We usually release Tuesday afternoon-ish (PST), ±24h.
Oh man, music to my ears. Thank you SO much!
I'll cut a new release right at the same time to minimise friction.
Awesome! So is v2.1.4. Thanks for that! 🙏
Most helpful comment
@Alhadis just a heads-up, next weeks' Nuclide release will include the file-icons compatibility fixes (and it looks _really_ nice; thanks for all your work on this!)
We usually release Tuesday afternoon-ish (PST), ±24h.