2 ms·
Having an ecosystem does not, in my humble opinion, make writing a React application feel substantively different from writing a pure JS application. Yes, JSX
by ralmidani 8y ago
Having an ecosystem does not, in my humble opinion, make writing a React application feel substantively different from writing a pure JS application.
Yes, JSX is not part of the core language (yet), but it's the closest to pure JS we are going to get considering developers' need for an intuitive, expressive, and virtually bulletproof templating language.
Before learning React, I built some decent-sized applications with Ember and Emblem (a whitespace-significant language that compiles to Handlebars) and it was utterly painful. Not wanting to deal with Handlebars' proprietary, Ruby-like syntax (not bad per se--Ruby is really cool--but out-of-place in a JS application) and its artificial limitations on what you can do with the language (anything resembling display logic has to be extracted into special helper functions) is probably the single biggest reason I ultimately came to prefer React over Ember, despite Ember having some conveniences React didn't and still doesn't (such as a concrete modeling and persistence layer like Ember Data).
With that aside, I think React is the closest we can get to "just JS" without abandoning pragmatism.
Transpilers and build systems are a necessity when the language itself is changing at such a rapid pace and there are so many different environmental concerns an application needs to satisfy.
- acdha 8y agoOut of curiosity, what do you think about lit-html[1]? The main thing I’m interested in there is that it’s based on native web technologies so you don’t need the huge non-standard React stack just to be able to load a file. Having has similar experiences with frameworks in the past I’m increasingly inclined only to use things which are moving in the direction of web standards to reduce the amount of churn. 1. https://github.com/Polymer/lit-html/blob/master/README.md https://github.com/Polymer/lit-html/blob/master/README.md
- ralmidani 8y agoLooks nice! I've thought about working with tagged template literals before, but I didn't know Google already had such a project. On the flip side, I am apprehensive about it being run by Google. Look at what happened with Angular 1.x, which was also supposed to let you do data-binding without abandoning valid html completely. Also, JSX offers some conveniences I'm not sure would be possible with tagged templates, such as not having to join an array explicitly after you map its data to markup. Edit: I stand corrected; lit-html supports mapping an array to markup naturally. As far as churn, which in general is a valid concern, I don't think React is going anywhere in the foreseeable future; it, along with Vue, has gained developer mindshare even jQuery may not have enjoyed back in its glory day. Absent a totally unexpected breakthrough, or Facebook really dropping the ball on updates, I think React could easily be viable in 2025 or beyond. Edit: lit-html is built with TypeScript, oh my! I will definitely be diving deeper into this project. Especially if I'm not building an SPA.