- From: Justin Fagnani <notifications@github.com>
- Date: Sat, 04 Nov 2017 17:59:04 +0000 (UTC)
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Saturday, 4 November 2017 17:59:27 UTC
I really think that `<template>` is the right element to use for control flow. `<template>` is analogous to a function: it's lazy because the contents aren't evaluated at declaration time, and instantiating a template is analogous to calling a function. In a programming language many constructs might be lazy, function and loop bodies, if and else blocks, the second operands of short-circuiting operations, etc. In HTML we currently only have `<template>` as a lazy element. It was hard enough to add, kind of difficult to polyfill, and still not all tools have caught up with this pretty major change in how documents are interpreted. Adding more template-like elements would be cause even more disruption there, and all kinds of parsers would have to be updated, and developers might have a harder time understand the growing semantics of HTML. So I think `<template type="if">` is just going to be way more practical than `<if>`. If we want to add more template-like elements I think we should consider a universal way to mark an element as having inert contents to parsers only have to update once more. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/695#issuecomment-341917086
Received on Saturday, 4 November 2017 17:59:27 UTC