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

No.

JSX is not JavaScript. React builds an entire system hidden from you that isn't the way JavaScript runs.

What abstraction are you thinking in? With Svelte I'm thinking in JavaScript. With Vue and React I'm thinking in hooks-land or whatever, and trying to understand a completely different virtual machine. There are some really brilliant ideas they have come up with, but the whole cloth experience isn't for me.

Vue is worse. Create an item inside the data attribute. Somehow that becomes available to computed functions. Somehow you can have that data attribute rely on parent attributes. None of that is the way JavaScript works without Vue on top. I'm so glad I don't have to remember those rules anymore.

You are correct they just compile into render functions. But the one Svelte produces is readable and the ones produced by Vue and React are a lot less so.



Yes, templates are different. That's why I said that they're "specific DSLs ... compiled into a JS render function"

Anyway there is no other abstraction. Hooks and composition APIs aren't magic, they're functions that you can write yourself. It's basic property change notifications but wrapped up in various levels of automation. Vue's object API can definitely seem messy but the new composition APIs in Vue 3 is standard JS syntax. Maybe it would be helpful to see the code yourself: https://github.com/vuejs/vue-next/tree/master/packages/react...


I had heard things were improving. Thanks for sending providing a place where I can learn more.

(This is a complaint about React, but...) I really find hooks/effects to be pretty magical. Keeping track of how many times a hook/effect runs is really difficult for me. It looks so simple at first, but there is a lot going under the hood to figure out how often they run.




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

Search: