Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add htmx and astro for the benchmark ? #1604

Closed
TheElegantCoding opened this issue Feb 12, 2024 · 3 comments
Closed

add htmx and astro for the benchmark ? #1604

TheElegantCoding opened this issue Feb 12, 2024 · 3 comments

Comments

@TheElegantCoding
Copy link

htmx is no a framework is a library and requires in some cases more tools to works, but right now is been using a lot, so i think there should be a benchmark for this with astro or other combinations of tools, this tools are almost as vanilla js

@krausest
Copy link
Owner

From what I understand htmx is all about ajax requests and then updating (a part of) the page from the response. (I'm ignoring client side scripting since that would just converge with vanillajs).
I can't imagine that this kind of interaction can be reasonably measured with this benchmark. Imagine select row: The measurement would include the ajax call and the swapping of the selected row. Other frameworks manage to just patch the css class for the selected row. That comparison wouldn't make much sense IMHO and wouldn't show the benefits of htmx.

@ukazap
Copy link

ukazap commented Feb 14, 2024

Can we make the overhead from AJAX calls slightly irrelevant, say, by using Service Worker to mock a server that spits out html?

@krausest
Copy link
Owner

Maybe, but I think it misses the point of that benchmark.
This benchmark is focused on frameworks with a client side model. You change the model (create, delete, select rows) and the DOM gets magically updated. The benchmarks measures the efficiency of that update and applies a note if it's not real magic. I think it doesn't match htmx's update strategy.
How would you create the following operations?

  • Create rows: return html for the requested number of rows and swap tbody with that response
  • Delete row: I don't know htmx well enough - maybe return all rows except the deleted and swap tbody
  • Select row: return a row with the updated css class and swap that tr

Unless I'm mistaken with the assumptions above this would be very inefficient for delete row and would get note #772 for select row. The implementation would be non-keyed if implemented as described above.

@krausest krausest closed this as completed Mar 5, 2024
@krausest krausest mentioned this issue Jun 19, 2024
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

No branches or pull requests

3 participants