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

You're right, but because it's not part of the standard, there's various implementations. This is what I meant about consensus.



The standard side of things is just that DOM Elements have a JS interface with properties. That there are many ways to set properties on JS objects, with template systems being just one of many.

I'm not sure that HTML itself will get a standard way to set properties, even with the Template Instantiation proposal. Encoding the intent to set a property is hard given that all valid attribute names are already valid attribute names, and could have current semantics. Adding new support for currently invalid attribute names sounds like a very difficult thing to do.

This can stay at the level of opinionated libraries. You learn how to use that library and it's method for setting properties, and you don't have to worry about other components choices for templating.


Well, it seems like a basic problem that everyone runs into pretty quickly when they start putting components together. Think of an Android RecyclerView created as a web component which lets you scroll through a large dataset. The parent component needs to be able to pass a reference to an array of content. This can be done programmatically easily enough, but not in a declarative way.

(BTW, lit-html is really well done. I look forward to seeing its progress - LitElement could really be the underpinning to a standards-based competitor to React, which is a very welcome thing in my opinion.)




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

Search: