bs-react
bs-react copied to clipboard
How can I help?
Hi,
I want to help, moving the project forward.
If you can share, what need to be done and how I can contribute.
Hey! That's lovely to hear! It's been a bit quiet in the repo lately as I've been working on other related projects and exploring a rewrite of BsReact core (see https://github.com/eldh/bs-react/tree/rewrite-exploration, we'll see where that lands).
I don't know how much you've worked with reason before, but a few things I think would be awesome to see:
- Bindings to custom hooks. The more we have, the easier it will be to get value from bs-react. (see https://github.com/rehooks/awesome-react-hooks#packages). I'm actually writing bindings for react-spring right now.
- Example apps. Getting more apps to try this out would be awesome, both for finding pain points and for helping other people get started.
- Documentation. There's a very basic setup but the api is pretty much all undocumented.
- Exploring how to support React.lazy and Suspense. This one is a bit tricky since it relies on hacking around Bucklescript's lack of support for dynamic imports, but something like https://github.com/kMeillet/reason-loadable should work.
- Improve https://github.com/eldh/bs-react-scripts. It's pretty hacky and untested so far, would be awesome to get it more polished.
If you have any other ideas I'm all ears! I'm sure there are a lot of good ideas I haven't thought of!
I added some of these to https://github.com/eldh/bs-react/projects/1
I'm pretty new to Reason, but with a little guidance, I can help. I think I will start to write bindings for custom hooks. Maybe I will start with react-fetch-hook. What do you think?
What are the main changes in the rewrite?
Sounds awesome! I'll be happy to help out as much as I can! (Sorry in advance if I'm slow to respond sometimes, some days I won't have much time)
As for the re-write, right now there are a bunch of baggage from reason-react, which basically re-implemented parts of react. This prevents us from using React.memo
for example, and I suspect (whiteout having done any benchmarking) that it might hurt performance. So I basically want to remove anything not needed and make the bindings "smaller".
Sounds like a significant improvement of the codebase. It would be nice if we had a better communication channel, do you use discord?
Yep, feel free to ping me there!
Bindings to custom hooks.
Wouldn’t we (the Reason community) rather need more hooks written in Reason? Probably doesn’t matter that much when it comes to effectful hooks, but the stateful ones could really benefit from strong types and lack of interop, don’t you think?
@hoichi I think both are needed! I'm currently working on bindings to react-spring, where I think it makes sense to make bindings rather than re-implementing. I suspect libs like Apollo etc will also provide hooks that are well-suited for reason bindings. For other things like fetch, router etc I think pure reason implementations make sense.
Currently, projects like brisk & revery have a different interface for hooks, so it's hard to write pure reason hooks that works for both native compilation and ReasonReact/BsReact. Hopefully that will change in the future, but for now I think making it easy to work with React is really important.