Skip to content

Warn when hx-live expressions take over 16ms - #3932

Merged
1cg merged 1 commit into
bigskysoftware:four-devfrom
scriptogre:4.0/hx-live-slow-pass-warning
Jul 31, 2026
Merged

Warn when hx-live expressions take over 16ms#3932
1cg merged 1 commit into
bigskysoftware:four-devfrom
scriptogre:4.0/hx-live-slow-pass-warning

Conversation

@scriptogre

@scriptogre scriptogre commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Why

After a page change, hx-live runs all live expressions once.

The current warning counts how often this happens. It does not measure the time:

51 runs at 0.1ms each -> warning
 1 run at 100ms       -> no warning

Change

Measure each run instead. Warn once if it takes more than 16ms:

htmx: hx-live expressions took 18.4ms.

The warning does not stop the expressions.

Merges cleanly before or after #3919, #3928, #3930, and #3931.

@scriptogre
scriptogre force-pushed the 4.0/hx-live-slow-pass-warning branch from 64b2229 to 0a4964d Compare July 30, 2026 22:37
@scriptogre scriptogre changed the title Warn on slow hx-live recompute passes Warn on slow hx-live recomputes Jul 30, 2026
@scriptogre
scriptogre force-pushed the 4.0/hx-live-slow-pass-warning branch from 0a4964d to 621c43d Compare July 30, 2026 22:39
@scriptogre scriptogre changed the title Warn on slow hx-live recomputes Warn when hx-live expressions take over 16ms Jul 30, 2026
@scriptogre
scriptogre force-pushed the 4.0/hx-live-slow-pass-warning branch from 621c43d to 26de055 Compare July 30, 2026 22:40
@scriptogre scriptogre changed the title Warn when hx-live expressions take over 16ms Warn when hx-live expressions take over 16ms Jul 30, 2026
@scriptogre scriptogre added htmx 4 Issues specific to htmx version 4 hx-live labels Jul 30, 2026
@1cg

1cg commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Thank you!

@1cg
1cg merged commit 5f6126a into bigskysoftware:four-dev Jul 31, 2026
3 checks passed
@scriptogre
scriptogre deleted the 4.0/hx-live-slow-pass-warning branch July 31, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

htmx 4 Issues specific to htmx version 4 hx-live

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants