asteroidal: asteroidal: I’m returning html from javascript!!!

So is blaze, it just hides it using a template layer.

asteroidal: asteroidal: We should simplify things and not complicate them. I feel things should be sequential.

Honestly, React isn’t any more complicated than blaze. If anything it’s simpler in one aspect because React isn’t reactive (a real trip with the mind let me tell you trying to explain that to someone who has been heads down in blaze for the last couple of years)

asteroidal: asteroidal: Lets take designing a simple page. With Blaze approach we dont have to write any javascript in beginning. Just make a html page with mockup data and then once the page looks good you can start pub/sub stuff and attach the dynamic data {{}} part.

In react you throw two extra lines on that and still just emit a simple “html” page using JSX. Or if you prefer https://atmospherejs.com/lassombra/react-templates (not 1.3 ready yet sorry) which I use for more complex templates.

asteroidal: asteroidal: With react you are writing javascript from step 1.

You are in blaze too, you just hide it by using a compiler which is native to meteor

asteroidal: asteroidal: I hope this react fad passes away soon.

I think we’re well past fad at this point.[quote=“mbochynski, post:12, topic:21846”]

Just because you don’t see the point doesn’t mean to call something stupid. I didn’t like React but I have to give it a try because my co-workers were using it in other projects and we wanted to unify software stack.

[/quote]

I had a similar introduction but am slowly “accepting” the React way. Of course I refused until I had a template solution (hence my atmosphere package)

mbochynski: mbochynski: React is brilliant. What it gives me is that no more i mix components/part of the view that I shouldn’t mix with each other. React gives you ability to write simpler, smarter components that has HTML and JS in single place. So you don’t have to debug/understand logic of whole application just to get to know how very smart part of a view works.

I’m not sure I’d go to brilliant, but yes, React does a lot of things right in the modern world of proper separation of concerns.[quote=“mbochynski, post:12, topic:21846”]

Give it a try. I bet you will not call it stupid anymore. You can dislike React, but you can’t say its worthless

[/quote]

Some people will always call things like this stupid. Not because they are narrow sighted, but because these things really are stupid from their point of view and in the world they work in. I use React and it suits me well. Someone else might be better off with another option.

corvid: corvid: Didn’t we separate view, model, and controller for a reason in the past?

We did. And then we created a different separation called MVVM (Model, View, ViewModel). Then someone came along and created a Presenter/Model separation. There are lots of ways to separate concerns, React suggests a component style separation. Rather than having really deep templates covering large chunks of your renderable page, you have really deep component hierarchies which build up a DOM based on a ton of little pieces, each of which is concerned only with it’s little thing.

corvid: corvid: I mean, the only situation in which I could see this making sense is if the components were rendered programmatically via something…

… like a shadow dom? Newsflash, Blaze and React are both programmatically emitting DOM. The fact that Blaze looks like pure HTML is just a veneer over what it is really doing. React syntax may be annoying to you, but it is no different. And if you want your view in a separate “layer” then you can use either my template package or stateless components which do nothing but render their given object (and thus are like 2 lines of code on top of an XML tree).

sashko: sashko: Did we though? We did a lot of things in the past, doesn’t mean we should never do anything else in the future. For example, in the past all websites returned only server-side rendered HTML and each click got new HTML.

Yeah, we did. It was for a reason, and that reason remains valid. The reason is so that as a developer we’re not thinking about too many things at once and avoid risk of breaking things at the boundaries. Separating view, model, and controller created boundaries where the seams were well defined, and then within that boundary developers only had to remember the contents of the boundary and the seam, not also how the other layers would use the results. Only that the results adhere to a contract.

React just uses different boundaries. Those boundaries are the components. There is usually still a separate model, but controller and view gave way to higher order and lower order components. Higher order components would have special logic and generally don’t emit any DOM themselves, instead emitting lower order components. Those would take the input data from the higher order component (in a parent/child relationship) and emit DOM to show that data. Events then would usually be passed up to the higher order components to handle them. In a sense, higher order components become the controller.

seba: seba: The thing about learning react is, that it doesn’t require you to stop your project and read books for a couple of weeks. The API is ultra-thin. Basically if you read the getting started guide, you’re almost done.

I learned React on a Saturday. I built and released my template compiler on that Sunday. I started using it on Monday and 3 weeks later had it in production. In short, this is 100% accurate! The documentation is simple and relatively straightforward. It just does one thing and focuses on that one thing and tries to do it really well. I would say that it does it well, I’m still debating if it’s really well!