Compare commits
4 Commits
htmx-v1
...
v2.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| bdb7255a1c | |||
| 9276db7ffe | |||
| 452f15b2d4 | |||
| 16355e8f58 |
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -17,9 +17,9 @@ jobs:
|
||||
dotnet-version: [ "6.0", "7.0", "8.0" ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup .NET ${{ matrix.dotnet-version }}.x
|
||||
uses: actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}.x
|
||||
- name: Restore dependencies
|
||||
@@ -32,9 +32,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-and-test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: "8.0"
|
||||
- name: Package Common library
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
- name: Move View Engine package
|
||||
run: cp src/ViewEngine.Htmx/bin/Release/Giraffe.ViewEngine.Htmx.*.nupkg .
|
||||
- name: Save Packages
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: packages
|
||||
path: |
|
||||
|
||||
@@ -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: 1.9.12**
|
||||
**htmx version: 2.0.0-alpha2**
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<VersionPrefix>1.9.12</VersionPrefix>
|
||||
<PackageReleaseNotes>Update script tags to pull htmx 1.9.12</PackageReleaseNotes>
|
||||
<VersionPrefix>2.0.0</VersionPrefix>
|
||||
<VersionSuffix>alpha2</VersionSuffix>
|
||||
<PackageReleaseNotes>Update script tags to pull htmx 2.0.0-alpha2; remove deprecated _hxOn attribute</PackageReleaseNotes>
|
||||
<Authors>danieljsummers</Authors>
|
||||
<Company>Bit Badger Solutions</Company>
|
||||
<PackageProjectUrl>https://git.bitbadger.solutions/bit-badger/Giraffe.Htmx</PackageProjectUrl>
|
||||
<PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<RepositoryUrl>https://git.bitbadger.solutions/bit-badger/Giraffe.Htmx</RepositoryUrl>
|
||||
<RepositoryUrl>https://github.com/bit-badger/Giraffe.Htmx</RepositoryUrl>
|
||||
<RepositoryType>Git</RepositoryType>
|
||||
<Copyright>MIT License</Copyright>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageTags>Giraffe htmx</PackageTags>
|
||||
<PackageTags>Giraffe htmx alpha</PackageTags>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -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`.
|
||||
|
||||
**htmx version: 1.9.12**
|
||||
**htmx version: 2.0.0-alpha2**
|
||||
|
||||
_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
|
||||
|
||||
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`.
|
||||
|
||||
### Use
|
||||
|
||||
@@ -820,14 +820,14 @@ let script =
|
||||
let html = RenderView.AsString.htmlNode Script.minified
|
||||
Expect.equal
|
||||
html
|
||||
"""<script src="https://unpkg.com/htmx.org@1.9.12" integrity="sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2" crossorigin="anonymous"></script>"""
|
||||
"""<script src="https://unpkg.com/htmx.org@2.0.0-alpha2" integrity="sha384-291pOdLqD0RmU6d5pyz/xmHmZZPhEv465X4AJDWvc8n0KrWrD65qaf2fk0xmsrJe" crossorigin="anonymous"></script>"""
|
||||
"Minified script tag is incorrect"
|
||||
}
|
||||
test "unminified succeeds" {
|
||||
let html = RenderView.AsString.htmlNode Script.unminified
|
||||
Expect.equal
|
||||
html
|
||||
"""<script src="https://unpkg.com/htmx.org@1.9.12/dist/htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS" crossorigin="anonymous"></script>"""
|
||||
"""<script src="https://unpkg.com/htmx.org@2.0.0-alpha2/dist/htmx.js" integrity="sha384-4Owd2qj8qFNBZ8QiR2ItYnNuMGgpOxaDT1uuRJXziuB1lvvKGYA/Lxy/oVM6q3h1" crossorigin="anonymous"></script>"""
|
||||
"Unminified script tag is incorrect"
|
||||
}
|
||||
]
|
||||
@@ -979,18 +979,6 @@ let renderFragment =
|
||||
]
|
||||
]
|
||||
|
||||
#nowarn "44"
|
||||
|
||||
/// Tests for the HtmxAttrs module
|
||||
let deprecatedAttributes =
|
||||
testList "Deprecated Attributes" [
|
||||
test "_hxOn succeeds" {
|
||||
let newLine = "\n"
|
||||
strong [ _hxOn "submit: alert('oops')\nclick: alert('howdy!')" ] []
|
||||
|> shouldRender $"""<strong hx-on="submit: alert('oops'){newLine}click: alert('howdy!')"></strong>"""
|
||||
}
|
||||
]
|
||||
|
||||
/// All tests in this module
|
||||
let allTests =
|
||||
testList "ViewEngine.Htmx" [
|
||||
@@ -1004,5 +992,4 @@ let allTests =
|
||||
attributes
|
||||
script
|
||||
renderFragment
|
||||
deprecatedAttributes
|
||||
]
|
||||
|
||||
@@ -317,8 +317,6 @@ module HxVals =
|
||||
/// Create values from a list of key/value pairs
|
||||
let From = toJson
|
||||
|
||||
open System
|
||||
|
||||
/// Attributes and flags for htmx
|
||||
[<AutoOpen>]
|
||||
module HtmxAttrs =
|
||||
@@ -368,10 +366,6 @@ module HtmxAttrs =
|
||||
/// Overrides a previous `hx-boost`
|
||||
let _hxNoBoost = attr "hx-boost" "false"
|
||||
|
||||
/// Attach an event handler for DOM or htmx events
|
||||
[<Obsolete "This will be removed in htmx 2; use _hxOnEvent or _hxOnHxEvent instead">]
|
||||
let _hxOn = attr "hx-on"
|
||||
|
||||
/// Attach an event handler for DOM events
|
||||
let _hxOnEvent evtName =
|
||||
attr $"hx-on:%s{evtName}"
|
||||
@@ -450,14 +444,14 @@ module Script =
|
||||
|
||||
/// Script tag to load the minified version from unpkg.com
|
||||
let minified =
|
||||
script [ _src "https://unpkg.com/htmx.org@1.9.12"
|
||||
_integrity "sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2"
|
||||
script [ _src "https://unpkg.com/htmx.org@2.0.0-alpha2"
|
||||
_integrity "sha384-291pOdLqD0RmU6d5pyz/xmHmZZPhEv465X4AJDWvc8n0KrWrD65qaf2fk0xmsrJe"
|
||||
_crossorigin "anonymous" ] []
|
||||
|
||||
/// Script tag to load the unminified version from unpkg.com
|
||||
let unminified =
|
||||
script [ _src "https://unpkg.com/htmx.org@1.9.12/dist/htmx.js"
|
||||
_integrity "sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS"
|
||||
script [ _src "https://unpkg.com/htmx.org@2.0.0-alpha2/dist/htmx.js"
|
||||
_integrity "sha384-4Owd2qj8qFNBZ8QiR2ItYnNuMGgpOxaDT1uuRJXziuB1lvvKGYA/Lxy/oVM6q3h1"
|
||||
_crossorigin "anonymous" ] []
|
||||
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine.
|
||||
|
||||
**htmx version: 1.9.12**
|
||||
**htmx version: 2.0.0-alpha2**
|
||||
|
||||
_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
|
||||
|
||||
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`.
|
||||
|
||||
### Use
|
||||
|
||||
Reference in New Issue
Block a user