phoenixframework/phoenix_html
58.7
Adequate · 3 October 2026
1.2k
lines of production code
Elixir
with JavaScript
2
measurements over time
What this system is
This system is the Phoenix.HTML library, which provides core utilities for rendering safe HTML, generating form abstractions, and handling client-side link interactions in Phoenix applications. It manages HTML escaping, attribute handling, and form data structures while delegating HTTP method overrides and confirmation prompts to a lightweight JavaScript component. The codebase focuses on maintaining API stability and robust test coverage for these web rendering capabilities.
Behavioural changes
Client-side link method handling via event delegation
The \priv/static/phoenix\_html.js\ file is introduced to handle links with \data-method\ and \data-to\ attributes on the client side. Instead of relying on inline \onclick\ handlers, the script uses event delegation to intercept clicks, dispatches a \phoenix.link.click\ event (which can be cancelled via \event.preventDefault()\ or \data-confirm\), and dynamically creates a hidden form to submit the request with the specified HTTP method and CSRF token. It also supports opening links in new tabs via modifier keys and respects the \target\ attribute.
priv · high confidence
Phoenix.HTML v4.0 removes the \`use Phoenix.HTML\` macro and restructures the library
The \use Phoenix.HTML\ macro has been removed; attempting to use it now raises an error instructing users to add the \{:phoenix\_html\_helpers, "\~\> 1.0"}\ dependency and import modules individually. The library's documentation has been updated to reflect its three core functionalities: HTML safety, form abstractions, and a small JavaScript library for handling \data-confirm\ and \data-method\ attributes. Additionally, the \raw/1\ function now explicitly supports \nil\ values, returning an empty safe string, and the \sigil\_e\ and \sigil\_E\ macros have been removed from this module.
lib · high confidence
Phoenix.HTML v4.0: Major API overhaul and structural reorganization
This release introduces a significant breaking change by reorganizing the library's internal structure and updating its public API. The \Phoenix.HTML.Link\ and \Phoenix.HTML.Tag\ modules have been removed, with their functionality consolidated into the main \Phoenix.HTML\ module. A new \Phoenix.HTML.FormField\ struct has been added to represent individual form fields, supporting the \Access\ behavior for convenient field access via \form\[field\]\. The \Phoenix.HTML.Form\ struct has been redesigned to include new fields like \:impl\, \:action\, and \:index\, while the \Phoenix.HTML.FormData\ protocol has been expanded to support maps as form data sources. Additionally, the HTML engine has been refactored to use a new \@behaviour EEx.Engine\ implementation with optimized HTML escaping, and support for Elixir's calendar types (\Date\, \Time\, \DateTime\, \Duration\) has been added to the \Phoenix.HTML.Safe\ protocol.
_lib/phoenix\html · high confidence
Removal of legacy Mix.Config application configuration
The project has removed the \config/config.exs\ file, which previously used the deprecated \Mix.Config\ module. This change eliminates the legacy configuration mechanism and the commented-out examples for logger and environment-based imports, indicating a migration to a newer configuration approach (likely \Config\ or \Phoenix.Config\ in the context of Phoenix 2.0.1).
config · medium confidence
Test coverage
Added tests for Phoenix.HTML engine, safe data handling, and refactored form tests; Expanded test coverage for HTML escaping and attribute handling.
Dependencies
Upgrade to Phoenix.HTML v4.3.0 with Elixir 1.7+ requirement and updated documentation dependencies
This release updates the Phoenix.HTML library to version 4.3.0, synchronizing the Elixir package (mix.exs) and the npm package (package.json). It raises the minimum supported Elixir version to 1.7 and removes the runtime dependency on Plug, which is no longer required for the core functionality. The documentation tooling has been modernized by replacing older dependencies with ex\_doc, makeup\_eex, and makeup\_syntect for improved syntax highlighting, and the package metadata has been updated to include maintainer information and proper file inclusions for both Hex and npm distributions.
(dependencies) · high confidence
Housekeeping
Initial repository structure and documentation update
This change establishes the foundational project structure by adding the \.formatter.exs\ configuration file to standardize code formatting, including the \LICENSE\ file for MIT licensing, and updating the \README.md\ to reflect the library's current scope (HTML safety, form abstractions, and JavaScript enhancements) along with updated build badges and documentation links. It also updates \.gitignore\ to exclude \node\_modules\ and \doc\ directories.
(repo-wide) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 58 → 59 (+0.6)
- Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (+0.3)
- Architecture 69 → 69 (+0.0)
- Maturity 39 → 39 (+0.0)
- Readiness 67 → 69 (+2.4)
- Security 99 → 99 (+0.3)
Resolved (4)
- (anonymous) (cognitive 17) (priv/static/phoenix_html.js)
- Documentation: no licence statement (README.md)
- Documentation: no usage examples (README.md)
- Off-boarding risk: anonymized user #1
New (1)
- Off-boarding risk: anonymized user #1
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
phoenixframework/phoenix_html was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7cbed8256057aaa3e6b266d780c7cb7824610aca — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.