Skip to content

Allows hx-live to cache JS eval functions#3919

Open
MichaelWest22 wants to merge 2 commits into
bigskysoftware:four-devfrom
MichaelWest22:hx-live-cache-eval
Open

Allows hx-live to cache JS eval functions#3919
MichaelWest22 wants to merge 2 commits into
bigskysoftware:four-devfrom
MichaelWest22:hx-live-cache-eval

Conversation

@MichaelWest22

@MichaelWest22 MichaelWest22 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Description

I found that we can get around a 23x speed improvment to hx-live expression evaluations by updating executeJavaScript function to return a function instead of the value which then allows hx-live to cache this function in its run closure

Corresponding issue:

Testing

Tested performance and found it went from around 1.15s for 20,000 live bindings to 50ms. No real function changes so tests all pass.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@MichaelWest22 MichaelWest22 added the htmx 4 Issues specific to htmx version 4 label Jul 27, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant