Back to Explore

syntax-tree/hast-util-to-estree

GitHub
1 watchersOpen source

Last release: 3/3/2025

hast-util-to-estree is a JavaScript utility that converts a hast (HTML) syntax tree into an estree (JavaScript AST) syntax tree with JSX nodes, including support for embedded MDX nodes. It’s useful when you want to embed HTML as JSX inside JavaScript while working with syntax trees.

Project status

  • The repository appears actively maintained, with recent tagged updates in early 2025 (last upstream push on 2025-03-03, followed by prior updates on 2025-02-19 and 2025-01-03).
  • The apparent update cadence is roughly every 1 to 2 months, suggesting an ongoing maintenance and incremental-improvement pattern rather than a long idle period.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 3.1.3

    3/3/2025

    Release 3.1.3 is a small refactor described as externalizing some code. The code change centers on how CSS style strings are converted into a JavaScript/React-compatible style object.

  • 3.1.2

    2/19/2025

    Release 3.1.2 is primarily a dependency update. The release notes only mention updating `property-information`, but the actual diff also updates other tooling dependencies and refreshes README assets/links.

  • 3.1.1

    1/3/2025

    Release 3.1.1 updates the `style-to-object` dependency and refactors internal type documentation to use `@import` statements. It also adds declaration maps (via TypeScript `declarationMap`) to improve type debugging in editors.

  • 3.1.0

    9/1/2023

    Release 3.1.0 adds a new `tableCellAlignToStyle` configuration option. The code changes convert obsolete `align` attributes on `td` and `th` into a CSS-style `style` object with `textAlign` (or `text-align` when `stylePropertyNameCase: 'css'`).

    Features
  • 3.0.0

    8/4/2023

    hast-util-to-estree 3.0.0 is a major release that drops support for Node < 16 and switches the package to use an `exports` entrypoint. The release notes also mention improved error reporting for invalid `style` attributes and updates to `@types/hast`.

    Breaking
  • 2.3.3

    5/22/2023

    Release 2.3.3 contains no described code-level changes beyond a note that it is the same as 2.3.2, but with missing generated types. The provided diff shows only a package.json update, primarily dependency version bumps (TypeScript, Node types, and the linter).

    Breaking
  • 2.3.2

    2/10/2023

    Release 2.3.2 is a targeted fix for how `style` properties are converted into estree nodes. Specifically, it corrects the AST output when CSS property names are not valid JavaScript identifiers.

    Breaking
  • 2.3.1

    2/9/2023

    Version 2.3.1 makes a targeted fix to table whitespace handling by updating which table-related elements are treated as “table elements”. The release notes only mention removal of `th` and `td` from that set.

    Breaking
  • 2.3.0

    2/6/2023

    Release 2.3.0 adds configurable casing behavior for how hast element attributes and inline style objects are emitted into estree/JSX. It introduces options to output HTML-style attribute names and CSS-style style property names, and adds documentation about framework differences.

    Features
  • 2.2.1

    1/17/2023

    Release 2.2.1 is a small maintenance update. The release notes only mention updating the `style-to-object` dependency (commit 54952b5).