by CryoLogic · 7y ago · 0 comments
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.
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]
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.
It never did squish styles into a monolith. Strangely, that is exactly what Vue does with SFC, do you use Vue without?
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.
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.