Using Solid with mobx-jsx #604
-
Hi @ryansolid — thanks for making these libraries. My question is about whether it makes sense to use Solid together with mobx-jsx. I enjoy MobX and would like to use mobx-jsx, but I see that it hasn't had a release in a while, and I don't want to miss out on new developments in Solid. Is it possible and worthwhile to use them together and get the best of both worlds? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Hmm seamless integration is a no. Basically reactive systems work off a singleton tracking context. So interopt with other reactive libraries is always a bit clunky since it basically involves granular synchronization. It's possible but also once you start doing that you start wondering why you just didn't pick one and do an API level integration. The libraries probably can be used together in the same project if there was a good way to figure out how to get the build step to apply the right JSX transforms where. Maybe via file extension. Since both projects work the same way with real DOM children and no re-render I imagine it would be much easier than integrating with React. It would just require wrapping the entry points with a function wrapper to basically handle the synchronization of props. One tailored for each direction. Each nested context would be its own render mount point. There are definitely details there to work out. As for the library itself, it has been a while and I can post an update again soon. I tend to update it every 6 months or so, so it can leverage the latest compiler improvements etc.. but honestly, I wasn't able to generalize a lot of the features from Solid so about a year to a year and a half ago I stopped trying to as much. Things like Suspense got to a point that I couldn't generalize the solution anymore, even things like how Solid has introduced scheduled lifecycles through its reactive system. Like |
Beta Was this translation helpful? Give feedback.
-
@ryansolid just found solidjs and mobx-jsx at the same time and wondering how exactly they differ? to me mobx-jsx offers a way better observable-tracking api compared to the explicit way solidjs does but given you started solidjs afterwards I guess mobx had some limitation. |
Beta Was this translation helpful? Give feedback.
-
The whole hooks thingy is the only thing that push me away from solid. I have been using svelte now. I just can't stand the "hook way". Code and more important logic becomes very messy and confusing with hooks. If this project provided a more intuitive way to deal with reactive statement, it would have become the library of choice. |
Beta Was this translation helpful? Give feedback.
Hmm seamless integration is a no. Basically reactive systems work off a singleton tracking context. So interopt with other reactive libraries is always a bit clunky since it basically involves granular synchronization. It's possible but also once you start doing that you start wondering why you just didn't pick one and do an API level integration.
The libraries probably can be used together in the same project if there was a good way to figure out how to get the build step to apply the right JSX transforms where. Maybe via file extension. Since both projects work the same way with real DOM children and no re-render I imagine it would be much easier than integrating with React. It would ju…