Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For me Vue 3 with <script setup> get's pretty close to pure JavaScript/TypeScript. 90% of the code will be exactly like JS code, the only difference being the use of computed(), ref() and reactive() to achieve (something JS simply doesn't provide but is necessary for every non-trivial application). Your HTML code and CSS code are not mixed with JS and look and feel like the real thing as well. Other than the reactivity indication and the occasional onMounted(), etc. Vue 3 with <script setup> does away with all boilerplate and unidiomatic parts of Vue 2 and imo is the framework that most closely resembles pure HTML/CSS/JS while allowing for far greater productivity.


Are we still taking about vue <template>? I don‘t see how that is any way close to html when it has: custom conditional and loop syntax and semantics, arbitrary js expressions and a unique concept of scope?


It does have extra non-native features but the overarching

  <template />
  <script />
  <style />
format for single file components is plain HTML which makes it feel closer to vanilla than React.


Yeah I never really understood this benefit. The file structure is irrelevant to me after 15 minutes, the nitty-gritty semantics of my code are causing me headaches and bugs forever.

(I like working with all 3 current frontend frameworks btw, not trying to start a flamewar)


I like it because it separates layout, styling, and scripting while still collating them in the same file.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: