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 v1.9.6 #3

Merged
merged 3 commits into from
Oct 5, 2023
Merged

Htmx v1.9.6 #3

merged 3 commits into from
Oct 5, 2023

Conversation

sheridanchris
Copy link
Contributor

@sheridanchris sheridanchris commented Oct 5, 2023

Begin work on update to Htmx v1.9.6 (reference: #2)

HTMX Changelog - https://github.com/bigskysoftware/htmx/blob/master/CHANGELOG.md
Current Version - 1.8.0
New Version - 1.9.6

Attributes added:

  • hx-validate
  • hx-history
  • hx-on
  • hx-disabled-elt

Headers added or updated:

  • HX-Reselect response header
  • HX-Trigger header supports comma-separated event names

I may have missed a few things and some of these constructs may benefit from stronger typing. Will edit after reviews and re-reading the changelogs.

@sheridanchris sheridanchris changed the title Begin work on update to Htmx v1.9.6 Htmx v1.9.6 Oct 5, 2023
@sheridanchris
Copy link
Contributor Author

sheridanchris commented Oct 5, 2023

For the HX-Trigger response header I'm thinking there could either be multiple functions like

let withHxTriggerMultiple (events: string list) : HttpResponseModifier =
    let headerValue = String.concat ", " events
    Response.withHeaders [ "HX-Trigger", headerValue ]

or a discriminated union like

type HxTriggerResponse =
  | Events of string list
  | DetailedEvents of (string * obj) list

https://htmx.org/headers/hx-trigger/

@sheridanchris sheridanchris marked this pull request as ready for review October 5, 2023 08:17
@@ -100,17 +105,15 @@ module Response =
Response.withHeaders [ "HX-Retarget", TargetOption.AsString option ]

// Allows you to trigger client side events, see the documentation for more info
let withHxTrigger<'T>(event: string, detail : 'T option) : HttpResponseModifier =
let withHxTrigger<'T>(triggerResponse: HxTriggerResponse) : HttpResponseModifier =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@dpraimeyuu dpraimeyuu merged commit 0170e2e into dpraimeyuu:main Oct 5, 2023
1 check passed
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.

2 participants