I literally built an entire app on it using PHP that feels faster and smoother than the same thing written in React, especially on a low-end device.
I literally built an entire app on it using PHP that feels faster and smoother than the same thing written in React, especially on a low-end device.
set todo's name to "Do the laundry"
vs. todo.name = "Do the laundry"you can say
set the todo's name to "Do the laundry"
or set the name of the todo to "Do the laundry"
or set name.todo to "Do the laundry"
"the" is white space in the language (allowed before any expression) and helps w/ readability (according to taste)The first form is what I would recommend in most cases.
The second form is useful when you want to either highlight the property being set or when you want to tweak how the property binds (e.g. to avoid parenthesizing)
The third form is just there because JavaScript, but it works :)
glad you are enjoying the language!
there is a hyperscript channel
the hyperscript parser is definitely idiosyncratic (i joke that i did the opposite of everything my compilers professor taught me) but once you see the patterns it isn't too bad
First, there was no duplication of validation, or business logic on forms between the front end and back end. Everything was written in one language (with the exception of HTML + CSS).
Second, the ability to send updates out-of-band was amazing. A user selecting a change on a form and updating a preview felt instant when compared to the same thing in React.
Third, no crazy hooks or weird keeping state between the view and the data we sent. We just used plain html and inputs to store the state along with CSRF tokens.
My only issue was that the browser didn’t validate the form before submission. So email inputs weren’t validated. I don’t know if that’s an htmx bug or expected behavior, but it was annoying.