htmx v4, alpha8 #18

Merged
danieljsummers merged 1 commits from v4alpha8 into htmx-v4 2026-03-22 22:21:23 +00:00
9 changed files with 17 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
module Giraffe.Htmx.Common
/// <summary>The version of htmx embedded in the package</summary>
let HtmxVersion = "4.0.0-alpha6"
let HtmxVersion = "4.0.0-alpha8"
/// <summary>The path for the provided htmx script</summary>
let internal htmxLocalScript = $"/_content/Giraffe.Htmx.Common/htmx.min.js?ver={HtmxVersion}"

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-alpha6**
**htmx version: 4.0.0-alpha8**
_**NOTE:** Pay special attention to breaking changes highlighted in the packages listed above._

File diff suppressed because one or more lines are too long

View File

@@ -3,15 +3,13 @@
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<VersionPrefix>4.0.0</VersionPrefix>
<VersionSuffix>alpha6a</VersionSuffix>
<VersionSuffix>alpha8</VersionSuffix>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageReleaseNotes>First htmx 4 alpha release of these libraries
- [Server] Marked removed headers as obsolete; added new HX-Source header
- [View Engine] Marked removed attributes as obsolete
- [View Engine] Added new attributes, modifiers, and support for new hx-partial tag
- Updated script tags to pull htmx 4.0.0-alpha6
<PackageReleaseNotes>Update htmx 4 to alpha8
- [Common] Update provided htmx 4 to 4.0.0-alpha8
- [View Engine] Updated script tags to pull htmx 4.0.0-alpha8
See package READMEs; this is not an update-and-forget-it release
See package and prior alpha release READMEs; v2 to v4 is not an update-and-forget-it release
</PackageReleaseNotes>
<Authors>danieljsummers</Authors>
<Company>Bit Badger Solutions</Company>

View File

@@ -2,7 +2,7 @@
This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`.
**htmx version: 4.0.0-alpha6**
**htmx version: 4.0.0-alpha8**
_Upgrading from v2.x: the [migration guide](https://four.htmx.org/migration-guide-htmx-4/) lists changes for v4. For this package, the `HX-Trigger` and `HX-Trigger-Name` headers are marked obsolete. They are replaced by `HX-Source`, which provides the triggering tag name and `id` attribute. The `HX-Prompt` header has also been marked as obsolete, as the `hx-prompt` attribute which generated its content has been removed._

View File

@@ -6,7 +6,7 @@ open Giraffe.Htmx
/// Test to ensure the version was updated
let version =
test "HtmxVersion is correct" {
Expect.equal HtmxVersion "4.0.0-alpha6" "htmx version incorrect"
Expect.equal HtmxVersion "4.0.0-alpha8" "htmx version incorrect"
}
/// Tests for the HxSwap module

View File

@@ -687,14 +687,14 @@ let script =
let html = RenderView.AsString.htmlNode Script.cdnMinified
Expect.equal
html
$"""<script src="https://cdn.jsdelivr.net/npm/htmx.org@{HtmxVersion}/dist/htmx.min.js" integrity="sha384-/5n21KGM472oBhvzUrvju8FRDq/4WNMS3TGw5RWFkZR/kq+sCevqNXFcakqRtaHu" crossorigin="anonymous"></script>"""
$"""<script src="https://cdn.jsdelivr.net/npm/htmx.org@{HtmxVersion}/dist/htmx.min.js" integrity="sha384-hUj4cz/Dd2p+Dq0r8A6TAMS1u7gu2bTyisk8xCQX3nodazPP+fRmcAWJrTh4Ycwb" crossorigin="anonymous"></script>"""
"CDN minified script tag is incorrect"
}
test "cdnUnminified succeeds" {
let html = RenderView.AsString.htmlNode Script.cdnUnminified
Expect.equal
html
$"""<script src="https://cdn.jsdelivr.net/npm/htmx.org@{HtmxVersion}/dist/htmx.js" integrity="sha384-I3uRy2RjSNcS8Oi2SNWZD9IrafyrrrBb4QaHNA9pWVWfJuKtL0p8qAwHSrEyXoKh" crossorigin="anonymous"></script>"""
$"""<script src="https://cdn.jsdelivr.net/npm/htmx.org@{HtmxVersion}/dist/htmx.js" integrity="sha384-CHKZYHwIgmpkwoWtoPaiFIiMxP1Up7yHcsZ2NeECzLxRTXCO0mqXlujZwdJgFsFC" crossorigin="anonymous"></script>"""
"CDN unminified script tag is incorrect"
}
]

View File

@@ -978,15 +978,15 @@ module Script =
/// <summary>Script tag to load the minified version from jsdelivr.net</summary>
/// <remarks>Ensure <c>cdn.jsdelivr.net</c> is in your CSP <c>script-src</c> list (if applicable)</remarks>
let cdnMinified =
script [ _src "https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-alpha6/dist/htmx.min.js"
_integrity "sha384-/5n21KGM472oBhvzUrvju8FRDq/4WNMS3TGw5RWFkZR/kq+sCevqNXFcakqRtaHu"
script [ _src "https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-alpha8/dist/htmx.min.js"
_integrity "sha384-hUj4cz/Dd2p+Dq0r8A6TAMS1u7gu2bTyisk8xCQX3nodazPP+fRmcAWJrTh4Ycwb"
_crossorigin "anonymous" ] []
/// <summary>Script tag to load the unminified version from jsdelivr.net</summary>
/// <remarks>Ensure <c>cdn.jsdelivr.net</c> is in your CSP <c>script-src</c> list (if applicable)</remarks>
let cdnUnminified =
script [ _src "https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-alpha6/dist/htmx.js"
_integrity "sha384-I3uRy2RjSNcS8Oi2SNWZD9IrafyrrrBb4QaHNA9pWVWfJuKtL0p8qAwHSrEyXoKh"
script [ _src "https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-alpha8/dist/htmx.js"
_integrity "sha384-CHKZYHwIgmpkwoWtoPaiFIiMxP1Up7yHcsZ2NeECzLxRTXCO0mqXlujZwdJgFsFC"
_crossorigin "anonymous" ] []
/// <summary>Script tag to load the minified version from jsdelivr.net</summary>

View File

@@ -2,7 +2,7 @@
This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine.
**htmx version: 4.0.0-alpha6**
**htmx version: 4.0.0-alpha8**
_Upgrading from v2.x: see [the migration guide](https://four.htmx.org/migration-guide-htmx-4/) for changes, which are plentiful. htmx switches from `XMLHTTPRequest` to `fetch`, and many changes are related to the new event cycle._