carlsverre / react-outlet

Bottom-up Transclusion for React
MIT License
71 stars 12 forks source link

Comparison with react-slot-fill? #10

Open markerikson opened 7 years ago

markerikson commented 7 years ago

Hi again. Was just poking around other stuff you've done, and ran across this. Glancing at it, it appears at least vaguely similar to https://github.com/camwest/react-slot-fill .

Any thoughts on how the two libs compare at all? Similarities, differences, use cases?

carlsverre commented 7 years ago

I actually haven't seen that lib before! Thanks for pointing it out. I just reviewed the code and it appears to follow the design of react-outlet pretty accurately. The general architecture of a "plug" broadcasting it's children to a manager which is listened to by an "outlet" via events is pretty much the same.

In terms of features, it appears that react-slot-fill was designed around the concept of passing multiple components to an "slot" whereas my library is explicitly single-component. In addition, by using a element to provide the manager instance via context to the slots/fills, he is able to support server-side rendering in a more elegant way (since the event bus is now created per react-tree as opposed to shared like mine).

In terms of design decisions:

So mostly upside and similarities between the two libraries. Would have been great to collaborate with him and make React-Outlet better, but I can understanding wanting creative control over the entire design.