Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1950780 - The uglify-js version in Fedora does not understand newer javascript versions. [NEEDINFO]
Summary: The uglify-js version in Fedora does not understand newer javascript versions.
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: uglify-js
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Ben Rosser
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-18 16:26 UTC by Mattias Ellert
Modified: 2021-04-26 07:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:
mattias.ellert: needinfo? (rosser.bjr)
mattias.ellert: needinfo? (tchollingsworth)


Attachments (Terms of Use)

Description Mattias Ellert 2021-04-18 16:26:37 UTC
Description of problem:

I am trying to update js-jsroot to version 6, which is a major update where the developers have started using syntax from newer versions of javascript.

This new syntax is not understood by the uglifyjs version in Fedora.
For example:

<mock-chroot> sh-5.1# uglifyjs --version
uglify-js 3.10.4

<mock-chroot> sh-5.1# uglifyjs JSRoot.core.js -c -m -o JSRoot.core.min-1.js 
Parse error at JSRoot.core.js:7,10
      let jsroot = factory({}),
          ^
ERROR: Unexpected token: name «jsroot», expected: punc «;»
    at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/node_modules/uglify-js@3/tools/node.js:18:1), <anonymous>:71:23)
    at fatal (/usr/lib/node_modules/uglify-js@3/bin/uglifyjs:394:27)
    at run (/usr/lib/node_modules/uglify-js@3/bin/uglifyjs:343:9)
    at Object.<anonymous> (/usr/lib/node_modules/uglify-js@3/bin/uglifyjs:259:5)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

<mock-chroot> sh-5.1# uglifyjs JSRoot.latex.js -c -m -o JSRoot.latex.min-1.js 
Parse error at JSRoot.latex.js:4,44
JSROOT.define(['d3', 'painter'], (d3, jsrp) => {
                                            ^
ERROR: Invalid assignment
    at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/node_modules/uglify-js@3/tools/node.js:18:1), <anonymous>:71:23)
    at fatal (/usr/lib/node_modules/uglify-js@3/bin/uglifyjs:394:27)
    at run (/usr/lib/node_modules/uglify-js@3/bin/uglifyjs:343:9)
    at Object.<anonymous> (/usr/lib/node_modules/uglify-js@3/bin/uglifyjs:259:5)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

If I build an updated package from the latest version of uglify-js, and use that it works:

<mock-chroot> sh-5.1# uglifyjs --version
uglify-js 3.13.4
<mock-chroot> sh-5.1# uglifyjs JSRoot.core.js -c -m -o JSRoot.core.min-2.js 
<mock-chroot> sh-5.1# uglifyjs JSRoot.latex.js -c -m -o JSRoot.latex.min-2.js 

But for packaging of packages in koji, I can't use my own private updated package, but need the update in Fedora proper.


Version-Release number of selected component (if applicable):

uglify-js-3.10.4-1.fc34
uglify-js-3.10.4-2.fc34

How reproducible:

Always.

Steps to Reproduce:
1. Try minifying a script using mor modern javascript syntax (see example above)

Actual results:

Minifying fails.

Expected results:

Minifying works.

Additional info:

As a minimum I would like this updated in Fedora releases using uglify-js version 3 (i.e. Fedora 34 and above).
Preferably for all current releases (i.e. 33 and maybe 32 - though 32 is soon EOL so it is not super important).
In EPEL 8 uglify-js is provided by RHEL/CentOS and not by EPEL, so there a parallel installable uglify-js3 package will be needed.
As the maintainer of the main uglify-js package, do you wish to maintain such a package or do you prefer someone else to do it?
In EPEL 7 uglify-js is provided by EPEL, so in priciple it can be updated. But having a newer version in EPEL 7 than in RHEL 8 might be odd - so possibly adding the uglify-js3 package there too might make more sense. What do you think?
If you prefer to keep Fedora 33 on version 2, the uglify-js3 package can be added there too.


Note You need to log in before you can comment on or make changes to this bug.