R2 icon indicating copy to clipboard operation
R2 copied to clipboard

Create/enable plugins-like architecture

Open jbalsas opened this issue 12 years ago • 7 comments

Currently r2 doesn't address icon fonts such as FontAwesome

Since this seems quite a specific, it doesn't exactly meet the requirements to land this in the core of r2. It's possible that someone doesn't use it at all, and also that someone using a different icon font could see their icons swap randomly.

We've created kind-of a prototype to swap FontAwesome 3 icons (https://github.com/liferay-labs/R2/commit/e3918ac10a507cbdd37f0b04c16d599d31c0c10f) which we're currently using.

We'd love to be able to improve that and contribute it back.

Do you think you'd be interested in something like this? Do you have any plans towards allowing such things?

Thanks for a great work, guys!

jbalsas avatar Jan 17 '14 14:01 jbalsas

Oh, thank you for bringing this up!

I like the idea of plugins though I'm not use if we should have it in a folder in the package itself. I'd rather we have a convention such as Grunt plugins. I'll also look how ESLint does it and try to replicate that functionality.

BYK avatar Jan 18 '14 12:01 BYK

I guess I'll choose the "Grunt way" which both has conventions and options for NPM packages and a local "extra tasks" directory.

I'll update the ticket once I have something working.

BYK avatar Jan 18 '14 12:01 BYK

@BYK That sounds awesome!!

I completely agree about building a proper plugin architecture outside the r2 package. We just wanted to have something working and get the ball rolling ;)

As a bonus, it'd be useful if valueMap functions received some context such as within which declaration or rule are they. This would allow for more specific and conflict-free plugins.

jbalsas avatar Jan 18 '14 13:01 jbalsas

Another important need for this, as we can see, is the possibility to register several plugins for the same valueMap functions. If functions receive context, then it's easy to just affect a selected group of rules, but more than one plugin may want to get a chance at changing the value of some property...

jbalsas avatar Jan 23 '14 15:01 jbalsas

Hey @BYK,

Have you been able to make any progress on this?

Please, let us know if we could assist you in any way :)

jbalsas avatar Feb 25 '14 16:02 jbalsas

Hey @jbalsas, thanks for following up! I'm sorry to keep you waiting though I had a pretty rough month. I plan to spend some time on this in the first half of March.

If you have any prototypes for such plugin system, I can use them as a start too. My plan is to have something similar to grunt's plugin system.

BYK avatar Feb 25 '14 16:02 BYK

Hi @BYK, thanks for letting me know. We applied the temporary solution to our fork and that's what we're using for now with good results. Sadly, I got sidetracked with other stuff, so I couldn't work any further on this...

For reference, in case it helps with the specs for the architecture, you can check which kind of additional conversions we're applying in our plugins

I'll try to look into it again, but I'm not sure I'll be able to do that before March either. I'll keep you informed.

Thanks!

jbalsas avatar Feb 25 '14 17:02 jbalsas