Hacker News new | past | comments | ask | show | jobs | submit login

I think Vue.js is an excellent choice for this. They recommend bundlers and the default import doesn't come with the template compiler but the template compiler is fast enough to run when loading the page, and the vue template syntax looks clean inside a template string IMO, especially if you take care to minimize logic in templates.



view really deserves as serious a crack that react got, imo it's just better made. and vite is so good I think it's earned it.


I just don’t get the whole adding another DSL instead of using JSX or something.


JSX suffers from the same problem that early PHP did. Because you have the full power of JS at your hands, you need some very good linting rules if you don't want to end up with a mess combining presentation and functionality. By having a hard split between the two you're forced to build declarative templates.

Most React projects I've jumped into are really hard to understand regarding which template elements come from which pieces of code (partly due to JSX, partly due to design patterns which seem counter-productive). I've never had this issue with a Vue project.


JSX is quite a bit better than early PHP, but yeah, it has the same issue. I like both JSX and Vue templates, though (I prefer JSX with Vue or Preact).

I think JSX and Vue templates both are discovered, not invented, and have staying power because of that. JSX is neat because it is a really simple hybrid of two languages and is fully composable. Vue templates are neat because unlike so many other HTML templating languages, the templating is inside (X)HTML attributes, and they don't go too nuts with them like Angular did. It took time for Vue to support pretty much everything, but now it does. The nested <template> tag can be used to accomplish the same things as JSX fragments. The IDE tooling adds syntax highlighting and autocomplete to the JavaScript expressions. Even though it's HTML5, Vue went ahead and supported XML-style self-closing tags.


This is a balanced viewpoint, thank you for sharing! I probably have been burned a few too many times with legacy applications without good separation of concerns in the rendering layer to ever really prefer JSX to a strongly-separated templating language, but in the right hands they can definitely be well-written and -composed.

In a way JSX feels like GOTO statements.




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

Search: