← Back to context

Comment by faefox

7 days ago

The Angular/Vue approach of sprinkling application logic in HTML attributes demos really well - wow, it's like magic! - but it can only end one of two ways: either it's too simple to keep up with real-world requirements so you end up implementing everything in JS anyway, or it tries to be everything to everyone and you end up with hideously convoluted and slow DSLs like the abomination that is ngFor.

Personally I think attacking the problem from the other direction and making JS more fluent at generating markup is the much more practical approach and that's why JSX won.

I've been getting productive with Facet's approach, especially its 'templates as mixins' paradigm [0]. This gets really powerful when you consider how template scripts are automatically scoped.

But there is much more to like. In fact, while a scripting escape hatch is there, this microlibrary asks you to touch JS as little as possible.

[0]: https://github.com/kgscialdone/facet