3 ms·
Current Vue does a great job of separating templates, script and styles in a way that gives it a beautiful developer interface. This is in contrast to React wh
by CryoLogic 7y ago
Current Vue does a great job of separating templates, script and styles in a way that gives it a beautiful developer interface.
This is in contrast to React which squishes the three into one monolithic class in it's .jsx (versus .vue's deeper seperation which leads to easier debugging).
Vue3 will release a monolithic syntax where you can combine script, styles and HTML all into a class - I don't think this is the correct direction for the framework to go.
Developer interface is just as important as internal functionality and performance. Let's not forget that.
- Vanderson 7y agoYes, this is my concern as well. From day 1 though, I considered Vue to be a tech-debt investment as a trade off for fast development. (looks like that day is here already, time to prepare to update code in the next couple years for v3) Maybe in the next few years browsers will add some kind of reactivity to the DOM by default? And Vue/Angular/React will be less required to get up and running quickly with something small. And I think this would hit Vue 2.x the hardest.
- ehutch79 7y agoThis is pure FUD. You can already write a render method. In vue 3 the use case will be the same and most people will be using template tags in their single file components same as today. The big change is that the availability of a new js api for the component. This is optional, and seen as an advanced use case, or for people who need better typescript support, etc.
- The_rationalist 7y agoHow do you do when you have tightly coupled CSS, HTML and JS/TS?
- plausibilities 7y agoYou didn't see this coming considering how long they've been pushing the "Single File Component" narrative? https://vuejs.org/v2/guide/single-file-components.html https://vuejs.org/v2/guide/single-file-components.html
- mlsarecmg 7y agoWhy separate something from state, just to mix the view with pseudo code and injected state again. That isn't what separation of concern meant. React separates state from the view, because both should be apart, but the view and the code that forms it belong to the same logical layer, called the view layer. It never did squish styles into a monolith. Strangely, that is exactly what Vue does with SFC, do you use Vue without?
- koboll 7y ago>This is in contrast to React which squishes the three into one monolithic class in it's .jsx What exactly are you talking about here? First, React is (largely) no longer class-based. Second, it's completely unopinionated about styles. You can write your own classes, use CSS-in-JS, whatever. Nothing about React components is concerned with styles at all, let alone forcing you to structure them a certain way. Vue is, if anything, way more opinionated about styles.
- ratww 7y ago> Vue3 will release a monolithic syntax where you can combine script, styles and HTML all into a class. Nope. This was already possible in Vue 2, and Vue 3 is not dropping Single File Components at all. In fact most recent demos showed Single File Components [1]. And Evan You announced that the Class API is cancelled btw [1] [1] https://www.youtube.com/watch?v=E43SqPADf3k https://www.youtube.com/watch?v=E43SqPADf3k