bit-badger / giraffe.htmx Goto Github PK
View Code? Open in Web Editor NEWExtensions for Giraffe to support development with htmx
License: MIT License
Extensions for Giraffe to support development with htmx
License: MIT License
hx-replace-url
attributeHX-Replace-Url
headerHX-Reswap
header (takes same values as hx-swap
attribute)hx-select-oob
attribute_hxPushUrl
to become an attribute rather than a flagHX-Push
header, implement HX-Push-Url
htmx 1.6.1 added an HX-Retarget
response header, allowing the user to override the hx-target
attribute of the initiating request. Add support for this to Giraffe.Htmx.
Hey all, love the package but can't seem to get it to work.
Context
Using in simple page:
div [] [
(
if props.Page < 1
then emptyText
else
button [
_hxGet $"/sentinels?page={props.Page - 1}"
_hxTarget $"#{sentinelTableId}"
_hxPushUrl "true"
] [
str "Previous"
]
);
(
if not props.HasNext
then emptyText
else
button [
_hxGet $"/sentinels?page={props.Page + 1}"
_hxTarget $"#{sentinelTableId}"
_hxPushUrl "true"
] [
str "Next"
]
)
]
Problem
So my app builds fine but when I try to actually use one of these Giraffe.ViewEngine.Htmx
imports it fails at runtime with this error:
fail: Microsoft.AspNetCore.Server.Kestrel[13]
2023-12_fsharp-htmx-giraffe-view | Connection id "0HMVLM56KO179", Request id "0HMVLM56KO179:00000001": An unhandled exception was thrown by the application.
2023-12_fsharp-htmx-giraffe-view | System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
I can reproduce this by trying to use any of these imports like this:
printfn "hamytodo: this is an _hxget %A" _hxGet
Hypothesis
I think I'm missing Fsharp.Core 8 so this may just be a me problem. But it seems odd that I can DL and use this package without any errors being thrown until runtime.
Also, I can't seem to update my Fsharp.Core to 8. I'm wondering if Fsharp 8 requires dotnet 8 so this package says it can run on dotnet 6 and 7 but actually requires 8?
idk.
Q1: Any ideas as to how this happened / ways to fix?
Q2: Any ways to prevent this from happening in the future?
htmx has released v1.7.0 - update this library to incorporate those changes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.