Add v2.0.0-alpha1 support

This commit is contained in:
Daniel J. Summers 2024-01-30 22:46:34 -05:00
parent 71286b9064
commit 16355e8f58
6 changed files with 18 additions and 13 deletions

View File

@ -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. 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: 1.9.10** **htmx version: 2.0.0-alpha1**

View File

@ -2,8 +2,9 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<VersionPrefix>1.9.10</VersionPrefix> <VersionPrefix>2.0.0</VersionPrefix>
<PackageReleaseNotes>Update script tags to pull htmx 1.9.10; add support for hx-on:* attributes; require lowest FSharp.Core version; fix _hxDisabledElt spelling</PackageReleaseNotes> <VersionSuffix>alpha1</VersionSuffix>
<PackageReleaseNotes>Update script tags to pull htmx 2.0.0-alpha1</PackageReleaseNotes>
<Authors>danieljsummers</Authors> <Authors>danieljsummers</Authors>
<Company>Bit Badger Solutions</Company> <Company>Bit Badger Solutions</Company>
<PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl> <PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl>

View File

@ -2,11 +2,13 @@
This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`. This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`.
**htmx version: 1.9.10** **htmx version: 2.0.0-alpha1**
_Note that htmx 2.0 is an ALPHA release. The [migration guide](https://v2-0v2-0.htmx.org/migration-guide-htmx-1/) does not currently specify any request or response header changes. This means that, as of this release, there are no required code changes in moving to this major version._
### Setup ### Setup
1. Install the package. 1. Install the package (must use `--Prerelease` flag).
2. Prior to using the request header extension properties or the header-setting `HttpHandler`s, `open Giraffe.Htmx`. 2. Prior to using the request header extension properties or the header-setting `HttpHandler`s, `open Giraffe.Htmx`.
### Use ### Use

View File

@ -820,14 +820,14 @@ let script =
let html = RenderView.AsString.htmlNode Script.minified let html = RenderView.AsString.htmlNode Script.minified
Expect.equal Expect.equal
html html
"""<script src="https://unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>""" """<script src="https://unpkg.com/htmx.org@2.0.0-alpha1" integrity="sha384-KGfWLOUs4pJD2kawhHdm4vgr/cEAofjPPagKWIZ/YnYDQ2bcthCK5LRfBMr7zco+" crossorigin="anonymous"></script>"""
"Minified script tag is incorrect" "Minified script tag is incorrect"
} }
test "unminified succeeds" { test "unminified succeeds" {
let html = RenderView.AsString.htmlNode Script.unminified let html = RenderView.AsString.htmlNode Script.unminified
Expect.equal Expect.equal
html html
"""<script src="https://unpkg.com/htmx.org@1.9.10/dist/htmx.js" integrity="sha384-j1TtLExqttdT7C3Z/rJy8UZcCGiuqwwN9++coZ6up+5O/l2FHdp3IGfuJOvst6d1" crossorigin="anonymous"></script>""" """<script src="https://unpkg.com/htmx.org@2.0.0-alpha1/dist/htmx.js" integrity="sha384-2kZGZBH6t8d5fRh0/kvj/fwwVwnnTpwcLOhp0t8F0/mXWF5M5iPbo/ygeFN2cFbG" crossorigin="anonymous"></script>"""
"Unminified script tag is incorrect" "Unminified script tag is incorrect"
} }
] ]

View File

@ -450,14 +450,14 @@ module Script =
/// Script tag to load the minified version from unpkg.com /// Script tag to load the minified version from unpkg.com
let minified = let minified =
script [ _src "https://unpkg.com/htmx.org@1.9.10" script [ _src "https://unpkg.com/htmx.org@2.0.0-alpha1"
_integrity "sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" _integrity "sha384-KGfWLOUs4pJD2kawhHdm4vgr/cEAofjPPagKWIZ/YnYDQ2bcthCK5LRfBMr7zco+"
_crossorigin "anonymous" ] [] _crossorigin "anonymous" ] []
/// Script tag to load the unminified version from unpkg.com /// Script tag to load the unminified version from unpkg.com
let unminified = let unminified =
script [ _src "https://unpkg.com/htmx.org@1.9.10/dist/htmx.js" script [ _src "https://unpkg.com/htmx.org@2.0.0-alpha1/dist/htmx.js"
_integrity "sha384-j1TtLExqttdT7C3Z/rJy8UZcCGiuqwwN9++coZ6up+5O/l2FHdp3IGfuJOvst6d1" _integrity "sha384-2kZGZBH6t8d5fRh0/kvj/fwwVwnnTpwcLOhp0t8F0/mXWF5M5iPbo/ygeFN2cFbG"
_crossorigin "anonymous" ] [] _crossorigin "anonymous" ] []

View File

@ -2,11 +2,13 @@
This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine. This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine.
**htmx version: 1.9.10** **htmx version: 2.0.0-alpha1**
_Note that this is an ALPHA release of htmx 2.0; see [the migration guide](https://v2-0v2-0.htmx.org/migration-guide-htmx-1/) for changes_
### Setup ### Setup
1. Install the package. 1. Install the package (must use `--Prelease` flag).
2. Prior to using the attribute or support modules, `open Giraffe.ViewEngine.Htmx`. 2. Prior to using the attribute or support modules, `open Giraffe.ViewEngine.Htmx`.
### Use ### Use