简体   繁体   English

ReactJS是没有NodeJS服务器的小型分布式应用程序

[英]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. 我正在试图弄清楚如何使用reactJS作为我的客户端javascript框架而不是我的服务器端上的NodeJS来构建应用程序。
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. 我认为重要的是说我不关心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. 编辑:我不是特别谈论reactJS,这是一个关于服务器端和客户端分离的抽象问题。

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. 假设您将拥有移动用户,则必须根据js文件大小与网络请求数量做出决策,同时注意浏览器缓存。 If some routes are rarely used, maybe it makes sense to separate those out into their own js file. 如果很少使用某些路由,将它们分离到自己的js文件中可能是有意义的。 I'd start with small pieces. 我从小件开始。 You can always combine them later. 您可以随时将它们组合在一起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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