single-spa / single-spa-react

Single-spa lifecycles helper for React applications
https://single-spa.js.org/docs/ecosystem-react.html
MIT License
223 stars 62 forks source link

Is possible to use with React Native ? #90

Closed jacksonsmith closed 4 years ago

jacksonsmith commented 4 years ago

Hi Everyone

I'm wondering if i can use this for render react-native library instead react ?

joeldenning commented 4 years ago

I don't think so. single-spa uses the window object, and single-spa-react's Parcel component calls document.createElement.

frehner commented 4 years ago

that being said, I think we would be very open to the idea of adding support for it, if someone presents and plan and a general idea of what changes would need to happen and then worked on it.

Archisman-Mridha commented 2 years ago

Waiting for this feature

joeldenning commented 2 years ago

A major purpose of the microfrontend architecture is independent deployment of each microfrontend. With phone apps, my understanding is it's not possible to independently deploy the pieces of an app without republishing the whole thing to the app store. This is the reason I haven't really explored single-spa for react-native or phone apps in general. The main thing that single-spa offers is framework agnostic components (via parcels) and framework agnostic url-based browser routing (via applications). I don't know of any situations where either of those apply to react-native, so I do not see even how or why anyone would want to use single-spa-react. I'm not very strong in phone apps or react native, so if I'm missing something please let me know. But as I see it, this isn't a "we might build it at some point" but more of a "it's not clear what we'd even do because the whole thing doesn't make sense"

flyskywhy commented 2 years ago

@jacksonsmith , I guess the real requirement is render a react-native APP as a sub-app (library) in other APP, right? If so, you can see how I implement it in let other react-native APP can embed PixelShapeRN as sub-app, which ref to Isolating Redux Sub-Apps and Breaking out of Redux paradigm to isolate apps

Archisman-Mridha commented 2 years ago

A major purpose of the microfrontend architecture is independent deployment of each microfrontend. With phone apps, my understanding is it's not possible to independently deploy the pieces of an app without republishing the whole thing to the app store. This is the reason I haven't really explored single-spa for react-native or phone apps in general. The main thing that single-spa offers is framework agnostic components (via parcels) and framework agnostic url-based browser routing (via applications). I don't know of any situations where either of those apply to react-native, so I do not see even how or why anyone would want to use single-spa-react. I'm not very strong in phone apps or react native, so if I'm missing something please let me know. But as I see it, this isn't a "we might build it at some point" but more of a "it's not clear what we'd even do because the whole thing doesn't make sense"

Facebook told they made their marketplace section in react native and the rest part of the facebook app is built in native code. Basically they used different frameworks for that single app. Do you have any idea how we can implement that ? For example if we can combine react-native and flutter.

Archisman-Mridha commented 2 years ago

Microfrontend feature is offered by flutter and ionic. Waiting for react native 🥺🥺

jacksonsmith commented 2 years ago

Thanks for all responses.

Thanks @joeldenning for the clarification. @flyskywhy you right, i will look you solutions 🙋🏾.

I was at a project that used React native and with an architecture such Just Eat app, as image shows bellow.

just

I searched for solutions that could share code, between our app and web, but both using "micro-front-ends".

You all great folkz.