Skip to content

Conversation

@aptinio
Copy link
Contributor

@aptinio aptinio commented Jan 25, 2026

TailwindFormatter currently vendors Phoenix.LiveView.HTMLFormatter code so that it can use the private tokenize/1 function. However, problems arise when the vendored code and the user's LiveView version gets out of sync. A PR has been submitted to the Phoenix.LiveView team in the hopes of having this function publicly exposed:

phoenixframework/phoenix_live_view#3778

Instead, a suggestion was made to add an :attribute_formatters config option to Phoenix.LiveView.HTMLFormatter. This has been available since Phoenix.LiveView v1.1

phoenixframework/phoenix_live_view#3781

This PR removes the vendored code and converts TailwindFormatter from a mix formatter to an attribute formatter of
Phoenix.LiveView.HTMLFormatter.

TailwindFormatter currently vendors Phoenix.LiveView.HTMLFormatter
code so that it can use the private `tokenize/1` function. However,
problems arise when the vendored code and the user's LiveView version
gets out of sync. A PR has been submitted to the Phoenix.LiveView team
in the hopes of having this function publicly exposed:

phoenixframework/phoenix_live_view#3778

Instead, a suggestion was made to add an `:attribute_formatters` config
option to Phoenix.LiveView.HTMLFormatter. This has been available since
Phoenix.LiveView v1.1

phoenixframework/phoenix_live_view#3781

This PR removes the vendored code and converts TailwindFormatter from
a mix formatter to an attribute formatter of
Phoenix.LiveView.HTMLFormatter.
@aptinio aptinio force-pushed the phx-lv-attribute-formatter branch from 27ff2ee to 75b87c4 Compare January 25, 2026 14:17
@aptinio aptinio marked this pull request as ready for review January 25, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant