Fix self-contradictory web assets guidelines #1539

Merged
james merged 2 commits from gotmax23/packaging-guidelines:web-no-self-contradict into main 2026-06-11 16:16:43 +00:00
Showing only changes of commit 6d63f837cb - Show all commits

Clarify JavaScript Compilation/Minification Guidelines

See the previous commit message. The Javascript Guidelines had the same
problem, but it required more textual changes to make the document
internally consistent while still expressing (what I think is) the
intended meaning.
Maxwell G 2026-05-17 23:44:53 -05:00
Signed by: gotmax23
GPG key ID: F79E4E25E8C661F8

View file

@ -20,12 +20,6 @@ Node.js xref:Node.js.adoc[have their own guidelines],
and software like GNOME which embeds JavaScript for extensions
have their own directories and policies as well.
Packages containing JavaScript should make the best effort to regenerate any precompiled/minimized JS wherever possible,
as this leads to more maintainable packages.
Where this would result in a significant hardship,
the bundled pregenerated JS may be shipped with a specfile comment explaining the decision.
This does not eliminate the requirement to validate licenses of bundled code.
== Naming Guidelines
The name of a JavaScript library package MUST start with
@ -106,17 +100,19 @@ or to eliminate needless deviation from upstream.
== Compilation/Minification
If a JavaScript library typically is shipped as minified or compiled code,
it MUST be compiled or minified as part of the RPM build process.
Shipping pre-minified or pre-compiled code is unacceptable in Fedora.
it SHOULD be compiled or minified as part of the RPM build process,
as this leads to more maintainable packages.
Where this would result in a significant hardship,
the bundled pregenerated JS may be shipped with a specfile comment explaining the decision.
This does not eliminate the requirement to validate licenses of bundled code.
The compiler or minifier used by upstream
should be used to compile or minify the code.
When regenerating bundled JS, the same compiler or minifier used by upstream
should be used to compile or minify the code during the RPM build process.
If the minifier used by upstream is unable to be included in Fedora,
an alternative minifier may be used.
See https://fedoraproject.org/wiki/JavaScript/Minification_Issues[this page]
for a list of known problem areas and suggestions for workarounds.
Additionally, the uncompiled/unminified version MUST be included
Additionally, the uncompiled/unminified version SHOULD be included

I'm gonna note for the record that I do not understand exactly what is being asked for here. Should I ship the full-size JavaScript in the same RPM that ships the minified one? Or just include in the SRPM?


Nevertheless, this rule already existed before and now is just MUST->SHOULD, so my curiosity should not block this PR.

I'm gonna note for the record that I do not understand exactly what is being asked for here. Should I ship the full-size JavaScript in the same RPM that ships the minified one? Or just include in the SRPM? --- Nevertheless, this rule already existed before and now is just MUST->SHOULD, so my curiosity should not block this PR.
alongside the compiled/minified version.
Minified JavaScript is not useful for JavaScript run locally,