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

Example code/docs on interoping with other libraries/frameworks #504

Closed
btakita opened this issue Jun 26, 2021 · 5 comments
Closed

Example code/docs on interoping with other libraries/frameworks #504

btakita opened this issue Jun 26, 2021 · 5 comments

Comments

@btakita
Copy link
Contributor

btakita commented Jun 26, 2021

I have some large sveltejs projects with large components. I'd like to introduce Solidjs to more easily decompose the large components into tsx functions. Are there any good examples of embedding SolidJS into another library? It can be generalized, accounting for the compilation, dom/ssr rendering, reactive event wiring, signals, hydration, cleanup, etc.

Svelte kit, next.js, vuex are all powerful PWA libraries. Until Solidjs has a similar project, it may be useful to wrap Solidjs within one of these projects.

@ryansolid
Copy link
Member

ryansolid commented Jun 26, 2021

Client only in theory is probably pretty simple and similar in most frameworks. You get a ref and call Solid's render function in the suitable place according to the framework.

But generalizable is hard. SSR has other constraints depending on how the host works. VDOM, strings etc..Building might be ok but like Solid and React both having JSX would be a dance. Have you ever seen examples of docs like this before? I think there are a lot of pitfalls and it would take doing the integrations and writing detailed guides for each.

@ryansolid
Copy link
Member

Yeah I don't know what to do with this one. I could have a better example around using refs to import 3rd parties but the other side is really wide open and not particularly easy if even possible. I will leave this open to gather some feedback but I don't have any plans for the moment.

@btakita
Copy link
Contributor Author

btakita commented Jul 2, 2021

As discussed in the Help channel on discord, In the case of Sveltejs, it would be useful to have analogs to some of Svelte's concepts such as bind: being something like use:bindAttribute=['value', getter, setter]

Also, helper functions for interoping between Solid Signals & Svelte stores would be useful. Each library combo can have its own set of interops.

@ryansolid
Copy link
Member

Yeah I see separate packages being built for these cases. I think the contributors would need to be intimately familiar with both frameworks to do this and up to date on the latest in each of these frameworks. I'm sure there would be some people in this scenario that could really benefit from this and also be the best people to maintain the effort. I haven't seen libraries like this before as I said earlier so I don't know if there is any precedent but would look forward to supporting anyone willing to prove it out.

@ryansolid
Copy link
Member

I don't really have much in actionable items here. Solid won't integrate with existing meta frameworks directly. And interopt points with libraries depend on each library. I've seen some interesting solutions to the problem like: https://www.npmjs.com/package/react-solid-bridge

And I made these:
https://codesandbox.io/s/solid-react-hoc-8m2yd
https://codesandbox.io/s/react-solid-hoc-5lmt2

But I'm leaving it here. This is just beyond the scope of the core project to maintain I think.

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

No branches or pull requests

2 participants