babel-plugin-macros VS htm

Compare babel-plugin-macros vs htm and see what are their differences.

babel-plugin-macros

🎣 Allows you to build simple compile-time libraries (by kentcdodds)

htm

Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support. (by developit)
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
babel-plugin-macros htm
6 47
2,637 9,017
-0.2% 0.0%
0.0 0.0
about 3 years ago over 2 years ago
JavaScript JavaScript
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

babel-plugin-macros

Posts with mentions or reviews of babel-plugin-macros. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-14.

htm

Posts with mentions or reviews of htm. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2026-06-01.
  • How to Convert Supplier CSVs to Shopify/Amazon/WooCommerce Without Uploading to a Server
    4 projects | dev.to | 1 Jun 2026
    eBay: 30+ fields (item specifics, variations, shipping) Each schema is a JSON file defining field names, data types, and validation rules. The mapper walks source → target assignments and applies type coercion (string → number, date formatting, etc.) before export. The entire app stays under 200 KB gzipped by avoiding heavy UI libraries. It's built with Preact + htm (no JSX build step) and styled with Tailwind CSS v4. Export & Practical Considerations Export uses the standard Blob + download API. No server round-trip — just an ephemeral click with URL.createObjectURL(). The free tier handles 50 rows, enough to validate the mapping before committing. Column mapping profiles can be saved and reused, which is useful when the same supplier sends weekly inventory files with identical headers. Try It If you deal with supplier files regularly, you might find this useful. SKUMart handles all of this out of the box — just drop a file and export.
  • Comptime.ts: compile-time expressions for TypeScript
    4 projects | news.ycombinator.com | 6 Aug 2025
    ```

    Where the `template!` macro instructs the engine how to translate the tokens into their JavaScript syntax and the `#[reactive]` macro converts the class member into a getter/setter that triggers a re-render calculation.

    It would need to be adopted by TC39 of course and the expectation would be that, if provided at runtime, a JavaScript engine could handle the preprocessing however transpilers should be able to pre-compute the outputs so they don't need to be evaluated at runtime.

    We sort of get around this today using template literals and eval, but it's janky. https://github.com/developit/htm

  • What should a native DOM templating API look like?
    9 projects | news.ycombinator.com | 1 Jul 2025
    The author of the article mentions this very briefly, where he writes "For JSX-style references you would need to use binding syntax like <${MyComponent}>". The Preact author's htm tagged template library uses this convention as well [2].

    [1] https://github.com/ryansolid/dom-expressions/tree/7fd9f86f1b...

    [2] https://github.com/developit/htm

  • I've been writing web backends and frontends since the 90s. Finally: declarative, dynamic markup done right
    2 projects | dev.to | 5 Jun 2024
    Because AI-UI is a JavaScript module, you specify the layout as a series of function calls. However, it also fully supports JSX and htm, so you can use a more familiar markup at the cost of the loss of some type safety. There's more about these choices in the AI-UI guide here.
  • Ask HN: How do you use React as a library in 2024?
    1 project | news.ycombinator.com | 10 May 2024
    I know what "MVC" _stands_ for, but I'm asking what _context_ you mean that in. Are you talking about how to define your server-side data models and endpoints? How you're organizing client-side fetching and caching?

    Normally "MVC" as a concept doesn't get used in the React ecosystem (the way it did with Backbone.js).

    FWIW it's certainly _possible_ to use React as a script tag, but it's extremely rare. It's normally expected that the frontend _is_ actually bundled and compiled, whether it be using a pure-SPA build tool like Vite, or one of the full server-side frameworks like Next or Remix.

    Note that the SPA build output is just a set of static HTML/JS/CSS files, which do not require a separate Node server process for hosting - they can be served by any HTTP server.

    My own advice would be to use Vite and build as an SPA.

    _If_ you absolutely want to use React as _just_ a `` tag with no build step, I'd recommend also using <a href="https://github.com/developit/htm">https://github.com/developit/htm</a> to at least give you JSX-like syntax for writing your components.

  • VanJS: A 0.9KB JavaScript UI framework
    15 projects | news.ycombinator.com | 20 Dec 2023
    The preact team also dislikes transpiling jsx so they've developed an alternative using tagged template literals: https://github.com/developit/htm
  • React SSR web-server from scratch
    2 projects | dev.to | 21 Nov 2023
    So getting this to work without bundler magic is very hard. It's not surprising why NextJS is investing in a bundler. Though one thing that really sticks out is how much complexity we add for just miniscule dev ergonomics. Not using JSX and using something like htm would make all this easier (removing the bundler entirely), it's a lot of overhead to avoid a couple of quotes. React should really have a tagged-template mode. Also all of this is indirection is actually bad for dev ergonomics too! One of the reasons I did this is because I'm absolutely sick of magic caches and sorting through code that's been crushed by a bundler into something I don't recognize and can't easily debug. While we can't get rid of this completely (ts/jsx) this preserves the module import graph completely on the client-side making it easy to find things as you are working and preserving line numbers. This obviously is not useful for a production build and there's a lot of work that would need to go in to support both modes over the same code, but it's depressing no tools really work like this for local development.
  • HTML Web Components
    14 projects | news.ycombinator.com | 13 Nov 2023
    You can also do JSX and skip the build step with preact + htm : https://github.com/developit/htm#example
  • Service Worker Templating Language (SWTL)
    4 projects | dev.to | 19 Aug 2023
    While I was able to achieve this fairly easily, the developer experience of manually stitching strings together wasnt great. Being myself a fan of buildless libraries, such as htm and lit-html, I figured I'd try to take a stab at implementing a DSL for component-like templating in Service Workers myself, called Service Worker Templating Language (SWTL), here's what it looks like:
  • Gaseous - Yet Another Games Manager
    3 projects | /r/selfhosted | 10 Jul 2023
    I would however highly recommend https://github.com/developit/htm

What are some alternatives?

When comparing babel-plugin-macros and htm you can also consider the following projects:

babel-plugin-styled-components - Improve the debugging experience and add server-side rendering support to styled-components

jsx - The JSX specification is a XML-like syntax extension to ECMAScript.

babel-plugin-proposal-pattern-matching - the minimal grammar, high performance JavaScript pattern matching implementation

Preact - ⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.

nextjs-typescript-starter - A starter project with NextJS, Typescript and Tailwind/Styled Components

esbuild-plugin-alias - esbuild plugin for path aliases

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured

Did you know that JavaScript is
the 5th most popular programming language
based on number of references?