developit/htm
View on GitHub ↗ ★ 9,050 JavaScript
Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
58 mentions on Hacker News by 44 people: 6 stories, 52 comments · first 2018-11-21 · latest 2026-08-05
20082026
-
> Bonus points at scale you invent a templating solution. Maybe you use JSX FYI this exists https://github.com/developit/htm which couples well with preact browser only (no npm/node compilation)
comment by actee · 2026-08-05 · in You don't need React: creating a minimal UI library in Vanilla JavaScript -
…common but few libraries use that to support JSX-like syntax at runtime, without a build step. e.g. https://github.com/developit/htm and https://lit.dev/docs/components/rendering/
comment by jsheard · 2026-01-09 · in JavaScript Demos in 140 Characters -
…below). This jsx discussion seems more about removing the compile step, which you can do with https://github.com/developit/htm import { createElement as m } from "your-jsx-compatible-library"; var ListComponent = () => { let count = 0,…
comment by kevlened · 2025-11-09 · in Marko – A declarative, HTML‑based language -
…browser import jsx from "react/jsx" const App = () => jsx!(<div>>Foo</div>) Projects like this : https://github.com/developit/htm are an expression/symptom of that need
comment by apatheticonion · 2025-09-16 · in React is winning by default and slowing innovation -
…libraries. We sort of get around this today using template literals and eval, but it's janky. https://github.com/developit/htm A generic macro system could open the door to a framework like Svelte, Angular, Vue, etc being able to embed…
comment by apatheticonion · 2025-08-09 · in Comptime.ts: compile-time expressions for TypeScript -
…convention as well [2]. [1] https://github.com/ryansolid/dom-expressions/tree/7fd9f86f1b... [2] https://github.com/developit/htm
comment by throwitaway1123 · 2025-07-01 · in What should a native DOM templating API look like? -
…add anything to simplify DOM handling, which is why libraries like Lit exist. -- 1: Inspired by https://github.com/developit/htm
comment by emmanueloga_ · 2024-11-30 · in If not React, then what? -
For a practical example of this technique used in JS take a look at libraries like htm and lit-html: https://github.com/developit/htm
comment by throwitaway1123 · 2024-08-10 · in PEP 750: Tag Strings for Writing Domain-Specific Languages -
…want to use React as _just_ a `<script>` tag with no build step, I'd recommend also using https://github.com/developit/htm to at least give you JSX-like syntax for writing your components.
comment by acemarke · 2024-05-10 · in Ask HN: How do you use React as a library in 2024? -
…also dislikes transpiling jsx so they've developed an alternative using tagged template literals: https://github.com/developit/htm
comment by fs_tab · 2023-12-20 · in VanJS – A no-JSX framework based on vanilla JavaScript -
You can use the htm library as a pure client-side jsx: https://github.com/developit/htm It is not completely the same, but far better than that h function madness.
comment by Joeri · 2023-11-13 · in HTML Web Components -
…"HTM" is a JSX like javascript string template representation of HTML, and it can be found here: https://github.com/developit/htm -- it is used by rehtm, which is the OP. It's a confusing collection of names at first sight.
comment by skygazer · 2023-06-25 · in Create and Hydrate HTML with HTM -
…no custom syntax for js variable, so @attribute something when you must pass an object as props. 0. https://github.com/developit/htm
comment by anton96 · 2023-05-03 · in JavaScript import maps are now supported cross-browser -
…be compiled away in a build step) https://preactjs.com/guide/v10/getting-started#alternatives-... https://github.com/developit/htm
comment by flanbiscuit · 2023-05-03 · in JavaScript import maps are now supported cross-browser -
…some of the few nicities JSX has, but which are actually compatible with the official language. [1] https://github.com/developit/htm
comment by rektide · 2023-02-17 · in Simple Modern JavaScript Using JavaScript Modules and Import Maps -
You can also use preact without a build step via htm https://github.com/developit/htm#installation
comment by forsakenharmony · 2022-10-05 · in Templating in HTML -
…electron apps before, and I have to say, Tauri really feels snappier. [0] https://preactjs.com/ [1] https://github.com/developit/htm
comment by graboid · 2022-08-13 · in Tauri – Creating Tiny Desktop Apps With React/Vue -
…just a limitation of JSX. [1]: https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1n... [2]: https://github.com/developit/htm
comment by amadeuspagel · 2022-07-14 · in Statements vs. Expressions -
…components in plain javascript files and import them. Bliss for me. [0] https://preactjs.com/ [1] https://github.com/developit/htm Edit: Just read that you want drag & drop style UI building, so this might not be for you.
comment by graboid · 2022-07-07 · in Ask HN: What's is your go to toolset for simple front end development? -
…add on here, the Preact author made a generalized utility for tagged template => vnode conversions: https://github.com/developit/htm
comment by aidenyb · 2022-06-01 · in Show HN: I made React with a faster Virtual DOM -
You might find this interesting: https://github.com/developit/htm#readme
comment by mst · 2022-03-01 · in Solid.js feels like what I always wanted React to be -
…of JSX I’ve been using htm, which fulfills roughly the same role but runs entirely in the browser: https://github.com/developit/htm I find typescript useful for libraries, less so for application code.
comment by Joeri · 2021-11-17 · in Some notes on using esbuild -
…Compiler[4] works better. [0]: https://developer.mozilla.org/ [1]: https://preactjs.com/ [2]: https://github.com/developit/htm [3]: https://svelte.dev/ [4]: https://developers.google.com/closure/compiler/
comment by easrng · 2021-06-29 · in Ask HN: Where to start with getting back into front end? -
…too. Cool! -1: https://github.com/TimDaub/web3-sign-msg - 2: https://docs.ficusjs.org/ -3: https://github.com/developit/htm
comment by timdaub · 2021-05-05 · in How we use web components -
…- no build tools required! Btw there's vscode support for this so you get syntax hilight too https://github.com/developit/htm
comment by atis · 2021-04-05 · in Ask HN: What novel tools are you using to write web sites/apps? -
Here I am again. Stop using JSX and start embracing Javascript's template strings. They're awesome! https://github.com/developit/htm
comment by timdaub · 2021-01-16 · in Show HN: Forgo.js – a 4kb React alternative based on plain JS and DOM APIs -
…small. And with preact/compat you can use any third party react component. I'm a particular fan of https://github.com/developit/htm , which is an alternative to JSX that simply uses JS template strings and needs no preprocessor.
comment by timdaub · 2020-12-12 · in Preact: Fast 3kb React Alternative with the Same API, Components and Virtual DOM -
…you really hate transpilers/tools). Most of them are outdated or not actual "Improvements". [1]: https://github.com/developit/htm#improvements-over-jsx
comment by mumblerino · 2020-09-22 · in New JSX Transform -
…Tagged Markup) instead of JSX and I love it. It's just plain JS and works extremely similar to JSX: https://github.com/developit/htm
comment by timdaub · 2020-09-22 · in New JSX Transform -
…only targeting modern browsers with ES6 support you can even use `import from` statements. [1] https://github.com/developit/htm
comment by ratww · 2020-09-16 · in On Modern Web Applications Stability -
…paragraph that you linked, is a very clever alternative, similar to jsx but in pure javascript [1] https://github.com/developit/htm
comment by riquito · 2020-06-30 · in Hyperapp – A tiny framework for building web interfaces -
ah, and the article also mentioned https://github.com/developit/htm which pretty much provides what JSX does, just in a lot less complex way (at the cost of a little run-time)
comment by onetom · 2020-06-30 · in Hyperapp – A tiny framework for building web interfaces -
…where I want to add some interactivity without involving the rest of the nightmarish JS ecosystem. https://github.com/developit/htm
comment by bschwindHN · 2020-06-22 · in A little bit of plain JavaScript can do a lot -
htm and vhtml from @developit. https://github.com/developit/htm https://github.com/developit/vhtml
comment by nathancahill · 2020-06-21 · in Show HN: Noact – React-like Virtual DOM library in 70 lines of TypeScript -
…better and only add 5kB of Javascript to your site instead of leaving an unmaintainable mess. [0] https://github.com/developit/htm
comment by imtringued · 2020-06-19 · in Advice to Young Web Developers -
…needing to compile to hyperscript first (but you should compile during production builds) 1. https://github.com/developit/htm 2. https://lit-html.polymer-project.org/guide
comment by flanbiscuit · 2020-06-01 · in Userinterface.js – A small library to build front-end JavaScript applications -
…possible to use htm with Preact for developing without a bundler if your target users support ES6. https://github.com/developit/htm
comment by pier25 · 2020-05-08 · in Rebuilding our tech stack for the new facebook.com -
…Htm (JSX in string templates) which doesn't need a build step either and is much smaller than Vue. https://github.com/developit/htm
comment by pier25 · 2020-04-14 · in Using VueJS Alongside Django -
…the compilation step you can use htm (also originally by the same author of the blog and Preact): https://github.com/developit/htm
comment by uhryks · 2019-09-28 · in Modern Script Loading -
…you could replace the default template strings with something using tagged template literals (like https://github.com/developit/htm ). You can work around nesting by spinning up new components after the innerHTML assignment, and assigning…
comment by bryanbraun · 2019-09-24 · in Web-dev nirvana, and why I needed to let go of React to reach it -
…They both look like they accomplish the same goal but HTM's implementation looks smaller. [1] https://github.com/developit/htm
comment by sdegutis · 2019-06-21 · in Why I don't use web components -
yup, just add the script tag and you're good to go! It's frequently used along with https://github.com/developit/htm for a jsx-less template syntax. No build tools required :)
comment by mhagemeister · 2019-06-15 · in JavaScript Is the CO2 of the Web [audio] -
…library is a great alternative: nearly-JSX syntax via template strings, with no compilation needed: https://github.com/developit/htm
comment by acemarke · 2019-05-19 · in Virtual DOM is pure overhead (2018) -
…`htm` library seems to be a very nice alternative to JSX that does not require a build step: https://github.com/developit/htm
comment by acemarke · 2019-02-19 · in A Newly-Generated Create-React-App 2.1.5 App Has 1,568 Dependencies -
…viable alternative to JSX in many ways. [0] https://github.com/jador/react-hyperscript-helpers [1] https://github.com/developit/htm
comment by acemarke · 2019-02-18 · in A Newly-Generated Create-React-App 2.1.5 App Has 1,568 Dependencies -
…a parser, turning your example into something more like: return htm`<Some pseudoHTMLcode />`; https://github.com/developit/htm
comment by Klathmon · 2018-12-31 · in React.js cheatsheet -
You're likely thinking of https://github.com/developit/htm .
comment by sophiebits · 2018-12-03 · in How Does React Tell a Class from a Function?