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

Please:

- Try Vue[0], Lit[1] (it's a bit cutting edge but I really like it), or the other entries in the component-building library space

- Don't use redux/vuex all of that, and just write plain javascript objects that make fetch() calls

- Don't use hooks (yet)

If you do these things, you should find the component approach refreshing compared to copying and pasting HTML and managing event handlers/spaghetti and making your own structure. For all but the simplest of pages there should be an improvement over vanilla HTML+JS.

If it makes you feel better, if you squint React looks exactly like Backbone views, which had a reason for existing back when they did, and if you go even further back it's like COM[2].

[0]: https://vuejs.org/

[1]: https://lit.dev/

[2]: https://www.bitquabit.com/post/the-more-things-change/




>Don't use redux

This is a puzzling advice to give to someone who wants to offload business logic away from components, as redux with sagas for example is a great place to put it. That way if you use selectors (preferably memoized as well) your components will only update when needed and you can organize business logic however you want.


It didn’t seem like the commenter didn’t know what Redux was, but more that they in using it as prescribed they still ran into the same issues. I was suggesting not using/needing redux mostly to reduce the starting level of complexity


I mean gp mentions they don't like the god components, and in my experience the kind of project where this becomes a problem is likely not using redux. Nowadays, redux is pretty well documented and there are ways to reduce boilerplate (for example, redux-toolkit) so I feel like it's a pretty good option to consider.


A lot of new programmers don’t know the meaning of complexity. They only see the features and not the costs.

By the time they finally realize the mess they’ve created, they’ve sunk too much effort and credibility to admit fault.


Yeah I think it's a real shame, most of my zeal these days on the front end is finding the smallest most focused libraries that do certain things -- I always shudder when I see what seems like pattern explosion/new development in libraries like React.

Of course, most of this is not React's fault -- they blazed the trail, and it's not like they could have known to build in the semi-automatic reactive system that Vue did right ouf o the gate. That said, KnockoutJS and the whole MVVM revolution along with RXJS were around to learn from.


I just tried the pattern you recommended using Vue to build a simple Purchase Power Parity Calculator[1] as all current ones are outdated AFAIK.

I'm a least JS, 'You Might Not Need JQuery' kind of person so my complex web applications are all rendered in the back-end using Go but this particular website is static and this is the first time I've added some JS to it for a core function.

It does seem like Vue is a good fit for small front end reactive components like this, I'm refraining from passing further comments on the subject as this is the first time I've tried it.

[1] https://startuptoolchain.com/calculators/ppp.html


Love the project, it works well, loads fast, and I'm glad you didn't fall into any crazy frontend pitfalls.

I think vue is great for small apps and "big" apps, and I think others would agree. I mostly disagree on just how much value some of the enterprise-grade patterns that show up have.


Thank you for checking it out!

I agree with your use cases for Vue, It enables quick component development with minimal learning curve and good performance. A good choice for someone like me who had been holding out on modern JS libraries to offer better usability.

There seems to be more lighter version of Vue[1] being developed[1] which seems to offer more flexibility in terms of how light we would want it to be and looks similar to Lit, Did you recommended Lit for the same reason?

[1] https://github.com/vuejs/petite-vue


hooks are amazing, wtf


To me, hooks allow to do class-based components without class. I do not exactly see the point. What is wrong with class-based components?


It is not cool


To Vue's credit, Evan has been absolutely up front and has made his rationale clear for why class based components were abandoned:

https://github.com/vuejs/rfcs/pull/17#issuecomment-494242121

You can't ask for more than that from someone who disagrees and is in control of the project. Also he's doing a pretty awesome job maintaining the project.


Isn't this conversation about React?


> What is wrong with class-based components?

The posted link contains a detailed breakdown written by Vue's creator of why Vue, a similar tool to React chose to de-emphasize class-based components in favor of the composition API (hooks).

I thought you might be able to find some clues to why people pick hooks over class-based components in there.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: