Distribute via popular languages' own vendoring? #2867
brackendawson
started this conversation in
Ideas
Replies: 1 comment
-
An example of a user's Go program that uses this would be: go.mod module github.com/brackendawson/kata
go v1.23.0
require (
github.com/bigskysoftware/go-htmx/v2 v2.0.2
) main.go package main
import (
"net/http"
htmx "github.com/bigskysoftware/go-htmx/v2"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("GET /assets/js/htmx.min.js", func(w http.ResponseWriter, req *http.Request) {
_, _ = w.Write(htmx.Bytes)
})
http.ListenAndServe(":80", mux)
} And it would be installed and upgraded with:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When you choose to host the htmx js yourself you copy htmx.min.js into your source and have your application serve it somehow. Keeping track of the version you use is an exercise for the reader. It could be useful to have libraries for popular languags in their native module ecosystems that simply expose the script as a byte array.
For example in Go you would need to provide only two files including the minified js:
go.mod
dist.go
And then users could import htmx using its version number. Vulnerability scanners would be able to report on any potential vulnerabilities. Users would be able to upgrade htmx just like any other module.
Beta Was this translation helpful? Give feedback.
All reactions