Skip to content

config: require selecting the HTMX version - #132

Merged
rameel merged 2 commits into
mainfrom
config/require-htmx-version
Nov 2, 2026
Merged

rameel merged 2 commits into
mainfrom
config/require-htmx-version

Conversation

@rameel

@rameel rameel commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

HtmxToolkit selected HTMX 2.x when the application chose no version.
It cannot detect the script that the browser loads, so an application on HTMX 1.9.x or 4.x silently got markup
and response headers for the wrong version. Moving the default to HTMX 4.x later would break existing applications just as silently.

Make the AddHtmxToolkit delegate required and fail at startup if no version is selected.
Without AddHtmxToolkit, nothing can be validated at startup, so HtmxConfig and TargetVersion throw on first use.

This also removes the HTMX 2.x fallback for response events and the side effect of selecting a version by reading HtmxConfig.

HtmxToolkit selected HTMX 2.x when the application chose no version.
It cannot detect the script that the browser loads, so an application
on HTMX 1.9.x or 4.x silently got markup and response headers for the
wrong version. Moving the default to HTMX 4.x later would break
existing applications just as silently.

Make the AddHtmxToolkit delegate required and fail at startup if no
version is selected. Without AddHtmxToolkit, nothing can be validated
at startup, so HtmxConfig and TargetVersion throw on first use. This
also removes the HTMX 2.x fallback for response events and the side
effect of selecting a version by reading HtmxConfig.
Select the version in every registration example and remove the
statements about the HTMX 2.x default. Describe the startup and runtime
errors in the version guide, the migration guide, and troubleshooting.
@rameel
rameel merged commit 71840d7 into main Nov 2, 2026
1 check passed
@rameel
rameel deleted the config/require-htmx-version branch November 2, 2026 22:27
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