# hhvm/xhp-lib

Class libraries for XHP. XHP is a Hack feature that augments the syntax of the language such that XML document fragments become valid Hack expressions.

Repository: https://github.com/hhvm/xhp-lib
Canonical: https://ross.abutalabs.com/products/xhp-lib
Homepage: http://facebook.github.io/xhp-lib/
Language: Hack
License: MIT
License Family: permissive
Topics: facebook, hacklang, hack, xhp
Archived: true
Last push: 2023-05-25T16:04:04+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 6082, "days_push": 1196, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1378, forks 160 (observed 2026-08-28T04:04:33.598322+00:00)

## What it is
XHP-Lib provides the class libraries for XHP, a Hack language feature that makes XML/HTML fragments valid Hack expressions. It lets developers build reusable, type-checked UI components where markup structure is validated at compile time.

## Use cases
- render html markup in hack with compile-time validation
- build reusable ui components in hack
- use hack as a stricter templating engine
- prevent mismatched html tags at compile time
- compose complex nested xml document fragments in code

## When to choose
- you are writing a Hack/HHVM web application and want type-safe templating
- you want markup errors caught at compile time instead of runtime
- you prefer component-based html construction over string templates

## When to avoid
- your project uses plain PHP rather than Hack/HHVM
- you need a general-purpose templating language with runtime flexibility
- you are not on the HHVM toolchain

## Facets
- artifact type: library
- maturity: maintenance
- function: templating, ui-components, serialization
- domain: web-development, programming-languages, frontend
- platform: php, cross-platform
- tags: hack, xhp, hhvm, xml-fragments, compile-time-markup-validation, component-library

## Member repositories
- hhvm/xhp-lib (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:33.598322+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:40:23.080246+00:00, confidence not recorded.
  - readme: https://github.com/hhvm/xhp-lib (fetched 2026-08-28T04:04:33.598322+00:00, sha 6d25fb0f8eac)
- Data as of 2026-08-30T08:39:29.467469+00:00.
