简体   繁体   中英

ReactJS as small distributed apps with no NodeJS server

I'm trying to figure out how to approach building an application with reactJS as my client side javascript framework and NOT NodeJS on my server side.
My routing is delivered only by server right now and I want to involve some functionality with react on my client side which will involve the react router.
I think that it is important to say that I don't care here about SEO.
So the question is what is the better approach? to distribute the app to some smaller pieces of react app? or wrap my app with big react app and always use only chunks of it's functionality? I'm afraid that when I use a big wrapper app I do some more coupling which I'll pay for that later when I will need to separate things.
Hope it is not too abstract. thank you :)

edit: I don't talk about reactJS especially, this is an abstract question about separation of server and client sides.

So the question is what is the better approach? to distribute the app to some smaller pieces of react app? or wrap my app with big react app and always use only chunks of it's functionality?

So you'll have more than one single-page-application. Assuming you'll have mobile users, you'll have to make decisions based on the js file sizes vs the number of network requests all while being mindful of browser caching. If some routes are rarely used, maybe it makes sense to separate those out into their own js file. I'd start with small pieces. You can always combine them later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM