bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
38.3k stars 1.31k forks source link

Include a librejs licence comment in the HTMX source so that it gets recognized as free and open source #1914

Open saolof opened 1 year ago

saolof commented 1 year ago

What it is according to the manual:

GNU LibreJS —an add-on for GNU IceCat and Mozilla Firefox— detects and blocks nonfree nontrivial JavaScript while allowing its execution on pages containing code that is either trivial and/or free. Many websites run nontrivial JavaScript on your computer. Some use it for complex tasks; many use it gratuitously for minor jobs that could be done easily with plain HTML. Sometimes this JavaScript code is malicious. Either way, the JavaScript code is often nonfree. For explanation of the issue, see The JavaScript Trap.

Essentially, it is a browser extension to block javascript, together with a standard format for a licence comment that you can add at the top of your javascript files and script tags (example of use here). HTMX has a BSD-2 licence, so according to the instructions the comment string should be this at the top of the file:

// @license magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt BSD-2-Clause
<code goes here>
// @license-end

There are pros and cons to it, such as slightly increasing bundle size, but it does look like a good way to include the licence for the unminified code at least, and it would make HTMX available in one environment where most javascript is blocked by default.

alexpetros commented 12 months ago

sigh another GNU thing that I agree with conceptually but in practice... idk. It's kind of obnoxious to ask libraries to put a special "this is okay" tag in their code for your browser extension (obnoxious of GNU, not you, it's a perfectly reasonable issue to raise).

@1cg let me know what you think. I don't have a strong opinion either way.

saolof commented 11 months ago

Well in practice, many projects end up concatenating the licences of all their dependencies to ensure they don't miss copying a licence. This at least creates a standard for marking code as licenced by including a compressed link instead of plain text, and the current licence used by HTMX does require the user to include the licence.

The 0-clause BSD licence on the other hand does not require including the licence text, though adopting that is basically intentionally equivalent to making your code public domain without confusing corporate lawyers.