#5639 freeipa ships minified javascript without minifying it at build time
Opened 8 years ago by tbabej. Modified 7 years ago

Ticket was cloned from Red Hat Bugzilla (product Fedora): Bug 1296665

The Fedora packaging guidelines require that javascript files be minified at
build time, instead of being shipped in a pre-minified fashion directly from
upstream.  See
https://fedoraproject.org/wiki/Packaging:JavaScript#Compilation.2FMinification:

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.

A quick and dirty check:

> file $(find . -name \*.js)|grep long
./install/ui/util/uglifyjs/lib/parse-js.js:               UTF-8 Unicode text,
with very long lines
./install/ui/util/build/build.js:                         ASCII text, with very
long lines, with no line terminators
./install/ui/src/libs/bootstrap-datepicker.js:            ASCII text, with very
long lines
./install/ui/src/libs/qrcode.js:                          ASCII text, with very
long lines, with no line terminators
./install/ui/src/libs/jquery.js:                          ASCII text, with very
long lines
./install/ui/src/libs/patternfly.js:                      ASCII text, with very
long lines, with no line terminators
./install/ui/src/libs/bootstrap.js:                       ASCII text, with very
long lines
./install/ui/src/libs/d3.js:                              ASCII text, with very
long lines
./install/ui/build/dojo/dojo.js:                          ASCII text, with very
long lines, with no line terminators

upstream contribution is welcome

Who is "upstream" here?

Freeipa has now been removed from Debian, because this issue prevented me from getting new versions uploaded (which would have fixed bugs, so it was basically unmaintainable and stuck at 4.0.5).

Debian requires that the source ships unminified copies of the minified javascript, so it doesn't require that they'd have to be recreated during package build. So this requirement should be pretty easy to fulfill. It just needs that someone who knows the ui stuff would commit the unminified source, and keep it in sync with the minified ones.

FYI, putting these in debian/missing-sources is what I believe should appease Debian ftpmasters, but of course it would be great to have them included in upstream source:

./patternfly.js[[BR]]
./jquery-2.0.3.js[[BR]]
./qrcode.js[[BR]]
./build[[BR]]
./build/rhino[[BR]]
./build/rhino/fs.js[[BR]]
./build/rhino/process.js[[BR]]
./build/fileHandleThrottle.js[[BR]]
./build/fileUtils.js[[BR]]
./build/plugins[[BR]]
./build/plugins/domReady.js[[BR]]
./build/plugins/loadInit.js[[BR]]
./build/plugins/querySelector.js[[BR]]
./build/plugins/i18n.js[[BR]]
./build/plugins/require.js[[BR]]
./build/plugins/text.js[[BR]]
./build/plugins/has.js[[BR]]
./build/main.js[[BR]]
./build/node[[BR]]
./build/node/fs.js[[BR]]
./build/node/process.js[[BR]]
./build/process.js[[BR]]
./build/version.js[[BR]]
./build/fs.js[[BR]]
./build/argv.js[[BR]]
./build/transforms[[BR]]
./build/transforms/depsDeclarative.js[[BR]]
./build/transforms/depsScan.js[[BR]]
./build/transforms/report.js[[BR]]
./build/transforms/writeOptimized.js[[BR]]
./build/transforms/hasFindAll.js[[BR]]
./build/transforms/dojoReport.js[[BR]]
./build/transforms/hasFixup.js[[BR]]
./build/transforms/insertSymbols.js[[BR]]
./build/transforms/hasReport.js[[BR]]
./build/transforms/writeCss.js[[BR]]
./build/transforms/depsDump.js[[BR]]
./build/transforms/dojoPragmas.js[[BR]]
./build/transforms/copy.js[[BR]]
./build/transforms/writeDojo.js[[BR]]
./build/transforms/optimizeCss.js[[BR]]
./build/transforms/trace.js[[BR]]
./build/transforms/write.js[[BR]]
./build/transforms/writeAmd.js[[BR]]
./build/transforms/read.js[[BR]]
./build/replace.js[[BR]]
./build/buildControlBase.js[[BR]]
./build/buildControl.js[[BR]]
./build/stringify.js[[BR]]
./build/messages.js[[BR]]
./build/discover.js[[BR]]
./build/v1xProfiles.js[[BR]]
./build/removeComments.js[[BR]]
./bootstrap.js[[BR]]
./bootstrap-datepicker.js[[BR]]
./dojo[[BR]]
./dojo/router.js[[BR]]
./dojo/topic.js[[BR]]
./dojo/dom.js[[BR]]
./dojo/keys.js[[BR]]
./dojo/dom-prop.js[[BR]]
./dojo/dojo.js[[BR]]
./dojo/query.js[[BR]]
./dojo/_base[[BR]]
./dojo/_base/lang.js[[BR]]
./dojo/_base/declare.js[[BR]]
./dojo/_base/array.js[[BR]]
./dojo/hash.js[[BR]]
./dojo/dom-class.js[[BR]]
./dojo/NodeList-dom.js[[BR]]
./dojo/io-query.js[[BR]]
./dojo/on.js[[BR]]
./dojo/domReady.js[[BR]]
./dojo/promise[[BR]]
./dojo/promise/all.js[[BR]]
./dojo/dom-style.js[[BR]]
./dojo/store[[BR]]
./dojo/store/Observable.js[[BR]]
./dojo/store/Memory.js[[BR]]
./dojo/Evented.js[[BR]]
./dojo/string.js[[BR]]
./dojo/dom-construct.js[[BR]]
./dojo/Stateful.js[[BR]]
./d3.js[[BR]]

the above was from build.profile.js and dojo.profile.js, but what was missing was modules from webui.profile.js so here it is:

dojo/Deferred.js[[BR]]
dojo/_base/Deferred.js[[BR]]
dojo/_base/config.js[[BR]]
dojo/_base/connect.js[[BR]]
dojo/_base/event.js[[BR]]
dojo/_base/kernel.js[[BR]]
dojo/_base/sniff.js[[BR]]
dojo/_base/window.js[[BR]]
dojo/aspect.js[[BR]]
dojo/dom-attr.js[[BR]]
dojo/dom-geometry.js[[BR]]
dojo/errors/CancelError.js[[BR]]
dojo/errors/create.js[[BR]]
dojo/has.js[[BR]]
dojo/mouse.js[[BR]]
dojo/promise/Promise.js[[BR]]
dojo/promise/instrumentation.js[[BR]]
dojo/promise/tracer.js[[BR]]
dojo/ready.js[[BR]]
dojo/router/RouterBase.js[[BR]]
dojo/sniff.js[[BR]]
dojo/store/util/QueryResults.js[[BR]]
dojo/store/util/SimpleQueryEngine.js[[BR]]
dojo/when.js[[BR]]

This issue should be addresses sooner than later, or at least have a plan - for both Fedora and Debian.

I guess including un-minified versions of d3, jquery, qrcode.js, bootrap.js, bootstrap-datepicker in git repo/tarball is possible.

Dojo is a question. I'd rather avoid having it in FreeIPA source.

Timo, if we come up with a process where we can use system packages somehow(e.g. use system dojo libs, run build on top of it, use the built version), is it OK?

Moving to 4.5 backlog for consideration.

Yes, using packaged versions is fine. Debian seems to have dojo 1.11.0 now (libjs-dojo-core), but dojo-util (build) is not packaged.

Metadata Update from @tbabej:
- Issue assigned to pvomacka
- Issue set to the milestone: FreeIPA 4.5 backlog

7 years ago

Login to comment on this ticket.

Metadata