[Pkg-javascript-devel] Bug#983190: Bug#983190: datatables.js: upstream versions >1.10.21 do not build with Debian's closure-compiler

Sascha Steinbiss satta at debian.org
Sun Feb 21 08:42:23 GMT 2021


Hi Jonas,

great, thanks for your quick reply and the patch.

>> If you are wondering why there haven't been any updates lately, I am 
>> sad to announce that current versions of datatables.js does not build 
>> anymore with the old version of closure-compiler in Debian.
> 
> Looks like it does not really need to use closure-compiler, so I would 
> suggest to instead use uglifyjs.

I see. Do you think that would be safe to use as a replacement? Both
would generate functionally equivalent minified JS, right? Ignoring
slight size differences, of course -- the uglifyjs output is ~50KB
larger than the closure-compiler one in a previous version.

I also switched the old 'ruby-sass' dependency (which I understand is
deprecated) to sassc, which seems to work nicely.

However, I noticed that uglifyjs complains about the same line
closure-compiler did:

      JS compressing dataTables.bulma.js
Parse error at /tmp/jquery-datatables.23860.03SeC/dataTables.bulma.js:170,5
	let nav = $('<nav class="pagination" role="navigation"
aria-label="pagination">
	    ^
SyntaxError: Unexpected token: name (nav)
    at JS_Parse_Error.get (eval at <anonymous>
(/usr/lib/nodejs/uglify-js/tools/node.js:33:1), <anonymous>:84:23)
    at /usr/lib/nodejs/uglify-js/bin/uglifyjs:384:40
    at time_it (/usr/lib/nodejs/uglify-js/bin/uglifyjs:620:15)
    at /usr/lib/nodejs/uglify-js/bin/uglifyjs:345:9
    at FSReqCallback.readFileAfterClose [as oncomplete]
(internal/fs/read_file_context.js:63:3)

Changing the 'let' to a 'var' here fixes the error, but I fail to see
why 'let' would be a problem here, syntactically. Any ideas?

So I think it would be quite doable to scrap closure-compiler here and
switch to uglifyjs and sassc if you don't see any obvious reasons to
abandon upstream's choice of tools. Given my limited expertise in JS
best practices I would be happy to trust your advice :)

Thanks and best wishes from the Debian Med sprint
Sascha



More information about the Pkg-javascript-devel mailing list