From 643af67916569cb7e9ee736a6f2c15c4a01c07b3 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Wed, 2 Jul 2025 20:16:34 -0400 Subject: [PATCH] Final changes for v2.0.6 --- src/Common/README.md | 2 +- src/Directory.Build.props | 10 ++++++++-- src/Htmx/README.md | 2 +- src/Tests/ViewEngine.fs | 4 ++-- src/ViewEngine.Htmx/Htmx.fs | 8 ++++---- src/ViewEngine.Htmx/README.md | 4 ++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Common/README.md b/src/Common/README.md index 6747422..1b9f74a 100644 --- a/src/Common/README.md +++ b/src/Common/README.md @@ -2,4 +2,4 @@ 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. -**htmx version: 2.0.4** +**htmx version: 2.0.6** diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5a3f9d7..58015d0 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,9 +2,15 @@ net8.0;net9.0 - 2.0.5 + 2.0.6 true - Add full packaged XML documentation; update script tags to pull htmx 2.0.5 (no header or attribute changes) + - All packages now have full XML documentation +- Adds HxSync module and attribute helper to view engine +- Updates script tags to pull htmx 2.0.6 (no header or attribute changes) +- Drops .NET 6 support + +NOTE: The CDN for htmx changed from unpkg.com to cdn.jsdelivr.net; sites with Content-Security-Policy headers will want to update their allowed domains accordingly + danieljsummers Bit Badger Solutions https://git.bitbadger.solutions/bit-badger/Giraffe.Htmx diff --git a/src/Htmx/README.md b/src/Htmx/README.md index 29addf7..a041166 100644 --- a/src/Htmx/README.md +++ b/src/Htmx/README.md @@ -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: 2.0.4** +**htmx version: 2.0.6** _Upgrading from v1.x: the [migration guide](https://htmx.org/migration-guide-htmx-1/) does not currently specify any request or response header changes. This means that there are no required code changes in moving from v1.* to v2.*._ diff --git a/src/Tests/ViewEngine.fs b/src/Tests/ViewEngine.fs index 0d5e249..f0c9cd7 100644 --- a/src/Tests/ViewEngine.fs +++ b/src/Tests/ViewEngine.fs @@ -849,14 +849,14 @@ let script = let html = RenderView.AsString.htmlNode Script.minified Expect.equal html - """""" + """""" "Minified script tag is incorrect" } test "unminified succeeds" { let html = RenderView.AsString.htmlNode Script.unminified Expect.equal html - """""" + """""" "Unminified script tag is incorrect" } ] diff --git a/src/ViewEngine.Htmx/Htmx.fs b/src/ViewEngine.Htmx/Htmx.fs index 7a68ed0..99cb93f 100644 --- a/src/ViewEngine.Htmx/Htmx.fs +++ b/src/ViewEngine.Htmx/Htmx.fs @@ -790,14 +790,14 @@ module Script = /// Script tag to load the minified version from unpkg.com let minified = - script [ _src "https://unpkg.com/htmx.org@2.0.4" - _integrity "sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" + script [ _src "https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js" + _integrity "sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm" _crossorigin "anonymous" ] [] /// Script tag to load the unminified version from unpkg.com let unminified = - script [ _src "https://unpkg.com/htmx.org@2.0.4/dist/htmx.js" - _integrity "sha384-oeUn82QNXPuVkGCkcrInrS1twIxKhkZiFfr2TdiuObZ3n3yIeMiqcRzkIcguaof1" + script [ _src "https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.js" + _integrity "sha384-ksKjJrwjL5VxqAkAZAVOPXvMkwAykMaNYegdixAESVr+KqLkKE8XBDoZuwyWVUDv" _crossorigin "anonymous" ] [] diff --git a/src/ViewEngine.Htmx/README.md b/src/ViewEngine.Htmx/README.md index 7f17761..10b2c77 100644 --- a/src/ViewEngine.Htmx/README.md +++ b/src/ViewEngine.Htmx/README.md @@ -2,7 +2,7 @@ This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine. -**htmx version: 2.0.4** +**htmx version: 2.0.6** _Upgrading from v1.x: see [the migration guide](https://htmx.org/migration-guide-htmx-1/) for changes_ @@ -29,7 +29,7 @@ Support modules include: - `HxTrigger` - `HxVals` -There are two `XmlNode`s that will load the htmx script from unpkg; `Htmx.Script.minified` loads the minified version, and `Htmx.Script.unminified` loads the unminified version (useful for debugging). +There are two `XmlNode`s that will load the htmx script from jsdelivr; `Htmx.Script.minified` loads the minified version, and `Htmx.Script.unminified` loads the unminified version (useful for debugging). This also supports [fragment rendering](https://bitbadger.solutions/blog/2022/fragment-rendering-in-giraffe-view-engine.html), providing the flexibility to render an entire template, or only a portion of it (based on the element's `id` attribute).