airbnb / react-with-styles-interface-aphrodite

Interface to use react-with-styles with Aphrodite
MIT License
54 stars 14 forks source link

Add .extend to allow for extensions #24

Open merlinstardust opened 7 years ago

merlinstardust commented 7 years ago

Aphrodite has a .extend function as seen here, which allows devs to extend Aphrodite with various features (right now it's only selectorHandlers).

It would be great to be able to do this in react-with-styles as well.

ljharb commented 7 years ago

That's very aphrodite-specific; the goal of react-with-styles is to be interface-agnostic, which means all react-with-styles interfaces must have the same API.

If we add any feature - like .extend - to one interface, we'd have to be able to add it to all of them.

We could certainly make this package export a function that takes options that returns an interface - that might be one way to make it work.

merlinstardust commented 7 years ago

That's reasonable to me. And I think that's important to do as react-with-styles becomes popular, there will be many interfaces with interface-specific features.

ljharb commented 7 years ago

That's why I'm concerned about adding this feature - we need to be limited to the lowest common denominator of what all interfaces support. That's much more important than any individual interface feature.