Hacker News new | ask | show | jobs
by sim0n 3544 days ago
For me, once I started declaring my UI as a series of components that simply render what they are provided (the common `v = f(d)` expression), it was hard to go back to the Backbone/jQuery way of mutating things all over the place and manually updating DOM nodes to try and reflect the current app state.
2 comments

Thanks! So is react the only JS framework you use now (besides jQuery)?
For view/UI, yes (if you can call React a framework). I personally do not use jQuery anymore as there is not much need to deal with the DOM directly when using React and when there is, I just use vanilla JS.

Since React only deals with UI, I use it alongside a bunch of other great libraries such as Redux (for state management).

Out of curiosity, what do you usually use on the backend?
The backend where I work (Airbnb) runs on Rails but most of my projects use node on the backend since they usually just expose a REST API.

Since it only cares about UI, React is obviously not opinionated about your backend/server environment unless you're trying to do server rendering (then you need something in your stack capable of executing JS).

I've spent some time looking at the 'needs a JS runtime' part and am prototyping an isometric framework in rust which renders with natively compiled code on the server and generated JS on the client, both generated from the same source template and logic. The JS can also be cached and served statically.

The server-rendered page is then instanced in the browser and differential rendering can be performed. I have been interested in doing this concept using React but have decided to prototype with a simpler implementation called Incremental DOM.

My project is at github.com/tmzt/incrust.

Nice. I was always wondering why no one was trying to do isometric stuff in other languages since every language and their mother seem to have a compile-to-js feature.
*isomorphic (FTFY)

Nice project!