speced / respec

A tool for creating technical documents and web standards
https://respec.org/
Other
711 stars 378 forks source link

Explore alternative templating engine #2343

Open marcoscaceres opened 5 years ago

marcoscaceres commented 5 years ago

We've been using HyperHTML for a while, and it's served us well. As HyperHTML pioneered this space, a few new alternatives have come along. It might be worth while investigating what else is out there and if ReSpec would benefit from using an even more modern templating engine.

saschanaz commented 5 years ago

even more modern

Or actually less modern, because I think we don't need hyperhtml's (or anything else's) dynamic template feature. ReSpec documents in runtime are not mutating their contents in any frequent way.

marcoscaceres commented 5 years ago

True that.

sidvishnoi commented 5 years ago

So, we're looking for a "template string to dom node" template engine, right?

marcoscaceres commented 5 years ago

yep

marcoscaceres commented 5 years ago

Note that now that we do have authorization from the W3C to start shipping JS code int specs, we can actually start considering making better use of things like hyperHTML to drive the display of things. For instance, the dfn pop-box we've talked about stealing from the HTML spec would be one such candidate.

sidvishnoi commented 5 years ago

For template string to DOM Node, can't we just use document.createFragment or createElement("template")?

saschanaz commented 5 years ago

We have to support interpolating DOM elements, which is more complicated than just passing string. (text text ${anchorElement} text text)

marcoscaceres commented 5 years ago

Yeah, and there are a bunch of security assurances we get from HyperHTML with attributes and general insertions.

saschanaz commented 5 years ago

I think we can implement our own assurances with ease, though.

marcoscaceres commented 5 years ago

Agree, it won’t be hard. The thing to put in perspective is where this sits in relation to the project priorities. Imho, the main thing for us to focus on this year is migrating folks to using xref, and getting specs into Shepherd. In parallel, we need to finish the migration to webpack or similar, as right now debugging remains challenging.

saschanaz commented 4 years ago

Some previous opinions from me: https://github.com/w3c/respec/pull/2340#issuecomment-490346182 https://github.com/w3c/respec/pull/2342#issuecomment-490440217

They were about _hyper comments and lack of DocumentFragment (hyperhtml uses it's own structure).