v4, beta4 (#19)

- Update with header/attribute changes between alpha8 and beta4
- Add support for htmax script, attributes, headers, and extension config

Reviewed-on: #19
This commit was merged in pull request #19.
This commit is contained in:
2026-06-15 01:07:38 +00:00
parent d4a7e0c9ce
commit 5c12ad7cef
22 changed files with 1066 additions and 214 deletions
+16 -2
View File
@@ -3,11 +3,14 @@
module Giraffe.Htmx.Common
/// <summary>The version of htmx embedded in the package</summary>
let HtmxVersion = "4.0.0-alpha8"
let HtmxVersion = "4.0.0-beta4"
/// <summary>The path for the provided htmx script</summary>
let internal htmxLocalScript = $"/_content/Giraffe.Htmx.Common/htmx.min.js?ver={HtmxVersion}"
/// <summary>The path for the provided htmax script</summary>
let internal htmaxLocalScript = $"/_content/Giraffe.Htmx.Common/htmax.min.js?ver={HtmxVersion}"
/// <summary>Serialize a list of key/value pairs to JSON (very rudimentary)</summary>
/// <param name="pairs">The key/value pairs to be serialized to JSON</param>
/// <returns>A string with the key/value pairs serialized to JSON</returns>
@@ -44,7 +47,12 @@ module HxSwap =
/// <summary>Morph the outer HTML of the target to the new content</summary>
[<Literal>]
let OuterMorph = "innerMorph"
let OuterMorph = "outerMorph"
/// <summary>Morph the outer HTML of the target to the new content, recreating all children</summary>
/// <remarks>This is used internally by the new history extension, but can be used by others if desired</remarks>
[<Literal>]
let OuterSync = "outerSync"
/// <summary>Replace the text content of the target without parsing the response as HTML</summary>
[<Literal>]
@@ -95,3 +103,9 @@ module HxSwap =
/// <seealso href="https://four.htmx.org/extensions/upsert">Extension</seealso>
[<Literal>]
let Upsert = "upsert"
/// <summary>Specify that the target of the htmx request should be downloaded</summary>
/// <remarks>This requires the <c>hx-download</c> extension (included in the htmax bundle)</remarks>
/// <seealso href="https://four.htmx.org/extensions/hx-download#explicit-swap-style">Documentation</seealso>
[<Literal>]
let Download = "download"
+1 -1
View File
@@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="6.0.0" />
<PackageReference Include="FSharp.Core" />
</ItemGroup>
<ItemGroup>
+1 -1
View File
@@ -2,6 +2,6 @@
This package contains common code shared between [`Giraffe.Htmx`](https://www.nuget.org/packages/Giraffe.Htmx) and [`Giraffe.ViewEngine.Htmx`](https://www.nuget.org/packages/Giraffe.ViewEngine.Htmx), and will be automatically installed when you install either one. It also contains htmx as a static web asset, allowing it to be loaded from your local (or published) project.
**htmx version: 4.0.0-alpha8**
**htmx version: 4.0.0-beta4**
_**NOTE:** Pay special attention to breaking changes highlighted in the packages listed above._
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long