TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Objectified – An all JSON-HTML templating engine – in Node or Browser

2 pointsby delmarcalmost 11 years ago

2 comments

krappalmost 11 years ago
I can appreciate that this scratches your itch but the premise isn&#x27;t really that unique - I&#x27;ve been using daffl&#x2F;dform for instance when I want to generate forms from json.<p>My problem with things like this is I don&#x27;t see the benefit of the abstraction.<p>admittedly Objectified.render({ tagName:&quot;p&quot;, attributes:{ innerHTML:&quot;some nice text&quot; } });<p>is slightly less verbose than var p = document.createElement(&quot;p&quot;); p.appendChild(document.createTextNode(&quot;some nice text&quot;));<p>But both would probably become unwieldy and difficult to manage if you were building a complex document. One benefit to me of having templates which look like actual html is that they make it easier to reason about what the actual document is going to look like. The purely json or &quot;replace tags with significant whitespace&quot; seems to add syntactic sugar without obvious benefit.<p>Although, again admittedly, if you&#x27;re more comfortable with those then for you, it&#x27;s a benefit having everything look the same.
评论 #7813242 未加载
icedchaialmost 11 years ago
Gross. It&#x27;s not a &quot;templating engine&quot; if you have to convert your HTML to a JSON data structure, like in the example.
评论 #7813301 未加载