Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend connect-backbone-to-react for integrating Backbone data #510

Open
spencer-brown opened this issue Jan 11, 2018 · 8 comments
Open

Comments

@spencer-brown
Copy link

spencer-brown commented Jan 11, 2018

Hello!

Here, y'all recommend an approach for integrating Backbone models and collections with React and include a code snippet for doing so.

Luckily, this functionality has been achieved using a HoC (like the snippet recommends) in a simple, tested library created by MongoDB called connect-backbone-to-react. We and they (and probably others) have been using the library in production with great success (in our case, for over 6 months).

Recommending connect-backbone-to-react would help devs and projects new to React get up-and-running with React+Backbone quickly and easily. Rather than building their own integration library, they could simply use one that already exists. Also, by centralizing on a solution, the community could collaborate to make the migration from Backbone to React easier and safer for everyone.

connect-backbone-to-react additionally offers a Redux-like provider in BackboneProvider, that many folks may find useful.

Happy to submit a PR to update the docs :). Wanted to check in to get y'all's thoughts first.

@spencer-brown
Copy link
Author

spencer-brown commented Jan 11, 2018

cc @gaearon , since you reviewed & merged the original PR that added these docs.

@gaearon
Copy link
Member

gaearon commented Jan 11, 2018

Seems like it's fairly new, maybe it's better to wait until it gets a bit more adoption?

@bradvogel
Copy link

We've use it in production for a year and have made several long-tail bugfixes. It's been well battle tested from our end.

@gaearon
Copy link
Member

gaearon commented Jan 11, 2018

How does it compare to more popular alternatives?

@spencer-brown
Copy link
Author

@gaearon :

We considered a few other projects that happened to have more GitHub stars but found connect-backbone-to-react to be the clear winner.

backbone-react-component and react-backbone are both mixins, which we found unappealing. react.backbone's usage is primarily based on a mixin but also "plugs in" by modifying React globally, which we found even less appealing.

connect-backbone-to-react, on the other hand, uses a HoC and, as mentioned, also offers a Redux-like BackboneProvider. MongoDB actively maintains the project and is very responsive to feedback and changes.

While those other projects have more GitHub stars, only two are actually used more, and by a relatively insignificant margin: connect-backbone-to-react vs. backbone-react-component, react-backbone, and react.backbone.

@hswolff
Copy link

hswolff commented Jan 13, 2018

👋 Hi there, original author of connect-backbone-to-react here! Really excited to see this issue open, thank you @spencer-brown!

Since writing this library we've been using it in production at MongoDB (for our Atlas product) since April of last year without any issues. It's been a great addition to our toolchain, allowing us to gradually migrate our (very large) codebase from Backbone/Marionette to React. Having connect-backbone-to-react be the glue between these two frameworks has been great as it lets us leverage our existing BB Models while still allowing our React components to be oblivious to their existence.

It was written before the doc additions but mostly codifies many of the recommendations of those doc changes. Due to it being a self contained library we're also able to test it in isolation, doing our best to ensure that this glue between two frameworks doesn't leak or cause any un-expected errors. (The pain of glueing frameworks and having that glue be brittle is a pain that I never want to re-live.)

I'm not sure how many developers are doing gradual migrations from Backbone to React so that may explain the (lack of) popularity.

In any event, I would love to see it included in the docs as I do think it is beneficial to other developers out there who are in a similar situation as @spencer-brown and I.

@spencer-brown
Copy link
Author

thoughts @gaearon ?

@spencer-brown
Copy link
Author

bump @gaearon :)

BetterZxx pushed a commit to BetterZxx/react.dev that referenced this issue Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants