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

HTMX integration #11

Closed
wants to merge 8 commits into from
Closed

HTMX integration #11

wants to merge 8 commits into from

Conversation

algunion
Copy link

The current implementation manages the syntactic sugar that makes HTMX attributes easier to add by the sole usage of hx property (added to Node).

My aim here was to extend the Cobweb package while keeping the same look and feel relative to the development experience.

With the exception of adding the special property to the Node (inside Cobweb.jl file) value, all the functionality was added to the htmx.jl file.

Also - I added relevant tests and updated the documentation accordingly.

There are cases where the values of the attributes are predefined (e.g., hx-swap), and some special syntax can be employed to simplify the workflow even more (see the swap work that I started - and also check the tests).

This is for now. I'll consider adding more types in the future - to make sure that illegal states/configuration is unrepresentable.

Regards,

@joshday
Copy link
Member

joshday commented Jun 27, 2023

Just chiming to say sorry I haven't had time to review. yet Been unusually busy the last two weeks.

@joshday
Copy link
Member

joshday commented Jul 5, 2023

Hey, sorry to leaving you hanging for a few weeks, especially since my response is: I think this should live in its own package.

This is the thing that's bothering me. It's a little too magical/special-case-y for my tastes:

function Base.getproperty(o::Node, name::Symbol)
    if name == :hx
        hx(o)
    else
        attrs(o)[string(name)]
    end
end

Said package could then also do some managing of the CDN url/downloading local copies of htmx, but that would be out of scope in Cobweb.

@joshday joshday closed this Jul 5, 2023
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.

None yet

2 participants