Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Comparison with react-slot-fill? #10

Open
markerikson opened this issue Apr 21, 2017 · 1 comment
Open

Comparison with react-slot-fill? #10

markerikson opened this issue Apr 21, 2017 · 1 comment

Comments

@markerikson
Copy link

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
Copy link
Owner

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:

  • fully typed - this is epic
  • more declarative testing
  • requires React Fiber - probably a safe bet at this point, but for most people his library is not immediately useful. Also I am excited about this since it means my overall design should work out of the box with React Fiber (which makes sense, but the validation is good)

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants