刚开始研究ReactJS,我到处都可以看到ReactJS是应用程序的“View”部分。 好的,所以如果我目前正在使用像AngularJS或Kendo UI或Backbone这样的框架,或者我想将ReactJS用作“视图”,它是否只是与这些其他框架一起开箱即用?
如果没有,那么人们在做什么呢(路由,模板等)? 回到简单的JS? jQuery的? 零碎地添加JS库以涵盖其他典型的应用程序需求? 那些小部件(可能最好添加而不是重新发明轮子的网格和东西) - 是否有ReactJS的小部件库?
不是愤世嫉俗 - 我真的很感兴趣。 对于ReactJS来说肯定有足够的嗡嗡声,但我只是在寻找一个完整的图片,说明使用ReactJS构建一个非平凡的应用程序的样子。
Just beginning to look into ReactJS and I see everywhere that you can think about ReactJS as the "View" portion of the application. OK, so if I'm currently using a framework like AngularJS or Kendo UI or Backbone or whatever and I want to use ReactJS as "the View" instead, does it just work out of the box with these other frameworks?
If not, what are people doing about the rest (routing, templating, etc)? Back to plain JS? jQuery? Adding JS libraries piecemeal to cover the other typical application needs? And what about widgets (grids and things that might be better left to add instead of re-inventing the wheel) - are there widget libraries for ReactJS?
Not being cynical - I really am interested. There's certainly enough buzz out there for ReactJS, but I'm just looking for a complete picture of what building a non-trivial application with ReactJS might look like.
最满意答案
当人们称React为“V中的MV”时,我不喜欢。 这是一个过于简单化,导致混乱。
React根本不是MVC的一部分。 这是对取代 MVC的设计模式的基本重新思考。 也就是说,因为MVC架构是目前的黄金标准,它需要理解您需要将React与MVC工具混合使用。
所以也许是一种更好的说话方式; 在预先存在的MVC堆栈中,React用新的设计模式替换V. 这种新的设计模式将您传统上可能认为是堆栈中M或C方面的某些元素抽象出来。
那么在如何将React与其他mvc工具结合起来方面呢? 它确实“开箱即用”,但您选择在传统MVC和React设计原则之间划清界限是您需要做出的架构决策。
但是,如果您希望获得更多“标准”方法,我建议您熟悉Flux模式。 Flux有很多实现,但模式的基本目的是处理数据到React结构的输入/输出。 大多数指南都会根据对服务器的API调用来解释它,但您也可以轻松地使用相同的模式与其他前端框架进行通信。
I dislike when people call React the "V in MVC". It's an oversimplification and leads to confusion.
React isn't part of MVC at all. It's a fundamental rethinking of design patterns that replaces MVC. That said, because MVC architecture is the gold standard at present, it comes with the understanding that you're going to need to intermix React with MVC tools.
So perhaps a better way of saying things; In your pre-existing MVC stack, React replaces the V with a new design pattern. And this new design pattern abstracts certain elements that you might traditionally think of as aspects of the M or C in your stack.
So in terms of how to combine React with your other mvc tools? It does "work" out of the box, but where you choose to draw the line between traditional MVC and the React design principles is an architecture decision you need to make.
If you're hoping for more of a "Standard" methodology, though, I would suggest familiarizing yourself with the Flux pattern. There are plenty of implementations of Flux out there, but the basic purpose of the pattern is to handle input/output of data to your React structure. Most guides will explain it in terms of API calls to your server, but you can easily use the same pattern to talk with other frontend frameworks as well.
如果ReactJS用于“视图”,那么应用程序的其余部分是什么?(If ReactJS is for the “View”, what is for the rest of the application?)刚开始研究ReactJS,我到处都可以看到ReactJS是应用程序的“View”部分。 好的,所以如果我目前正在使用像AngularJS或Kendo UI或Backbone这样的框架,或者我想将ReactJS用作“视图”,它是否只是与这些其他框架一起开箱即用?
如果没有,那么人们在做什么呢(路由,模板等)? 回到简单的JS? jQuery的? 零碎地添加JS库以涵盖其他典型的应用程序需求? 那些小部件(可能最好添加而不是重新发明轮子的网格和东西) - 是否有ReactJS的小部件库?
不是愤世嫉俗 - 我真的很感兴趣。 对于ReactJS来说肯定有足够的嗡嗡声,但我只是在寻找一个完整的图片,说明使用ReactJS构建一个非平凡的应用程序的样子。
Just beginning to look into ReactJS and I see everywhere that you can think about ReactJS as the "View" portion of the application. OK, so if I'm currently using a framework like AngularJS or Kendo UI or Backbone or whatever and I want to use ReactJS as "the View" instead, does it just work out of the box with these other frameworks?
If not, what are people doing about the rest (routing, templating, etc)? Back to plain JS? jQuery? Adding JS libraries piecemeal to cover the other typical application needs? And what about widgets (grids and things that might be better left to add instead of re-inventing the wheel) - are there widget libraries for ReactJS?
Not being cynical - I really am interested. There's certainly enough buzz out there for ReactJS, but I'm just looking for a complete picture of what building a non-trivial application with ReactJS might look like.
最满意答案
当人们称React为“V中的MV”时,我不喜欢。 这是一个过于简单化,导致混乱。
React根本不是MVC的一部分。 这是对取代 MVC的设计模式的基本重新思考。 也就是说,因为MVC架构是目前的黄金标准,它需要理解您需要将React与MVC工具混合使用。
所以也许是一种更好的说话方式; 在预先存在的MVC堆栈中,React用新的设计模式替换V. 这种新的设计模式将您传统上可能认为是堆栈中M或C方面的某些元素抽象出来。
那么在如何将React与其他mvc工具结合起来方面呢? 它确实“开箱即用”,但您选择在传统MVC和React设计原则之间划清界限是您需要做出的架构决策。
但是,如果您希望获得更多“标准”方法,我建议您熟悉Flux模式。 Flux有很多实现,但模式的基本目的是处理数据到React结构的输入/输出。 大多数指南都会根据对服务器的API调用来解释它,但您也可以轻松地使用相同的模式与其他前端框架进行通信。
I dislike when people call React the "V in MVC". It's an oversimplification and leads to confusion.
React isn't part of MVC at all. It's a fundamental rethinking of design patterns that replaces MVC. That said, because MVC architecture is the gold standard at present, it comes with the understanding that you're going to need to intermix React with MVC tools.
So perhaps a better way of saying things; In your pre-existing MVC stack, React replaces the V with a new design pattern. And this new design pattern abstracts certain elements that you might traditionally think of as aspects of the M or C in your stack.
So in terms of how to combine React with your other mvc tools? It does "work" out of the box, but where you choose to draw the line between traditional MVC and the React design principles is an architecture decision you need to make.
If you're hoping for more of a "Standard" methodology, though, I would suggest familiarizing yourself with the Flux pattern. There are plenty of implementations of Flux out there, but the basic purpose of the pattern is to handle input/output of data to your React structure. Most guides will explain it in terms of API calls to your server, but you can easily use the same pattern to talk with other frontend frameworks as well.
发布评论