papegaaij opened a new issue, #1835:
URL: https://github.com/apache/wicket/issues/1835

   ### Description
   
   `wicket-core` and `wicket-extensions` minify their JavaScript and CSS at 
build time with `org.primefaces.extensions:resources-optimizer-maven-plugin`. 
It runs Closure Compiler over JavaScript and its own compressor over CSS. This 
setup has not changed in years and has fallen behind current practice:
   
   - **Java baseline.** Every 2.7.x release of the plugin brings in a Closure 
Compiler compiled for Java 21. `wicket-10.x` builds on Java 17, so Dependabot 
has to keep the line on 2.6 (#1817, #1827). The minifier's Java version 
dictates ours.
   - **No source maps.** An error in production points into a single 31 KB line 
of `wicket-ajax.min.js`. The only way to debug is to turn off minified 
resources, which changes what is being debugged.
   - **The minified output is never tested.** The QUnit suites load the sources 
from `src/main/java`, so a minifier bug would ship unnoticed.
   - **The license header is stripped** from every minified file.
   - **Closure changes what it is given.** It injects ~3.4 KB of `$jscomp` 
polyfills into `wicket-veil.min.js`. In `wicket-autocomplete.js` it renames 
local variables around a direct `eval` of the `onselect` handler, so a handler 
that refers to `input` works against the sources but fails in production.
   - **Gaps.** `wicket-native-websocket-core` and `wicket-devutils` ship their 
JavaScript and CSS unminified.
   - **No stated browser target.** `languageIn=ECMASCRIPT_2015` describes the 
input, not a decision about which browsers Wicket supports.
   
   ### Suggested fix
   
   Minify with esbuild, run from Node through `frontend-maven-plugin`, which 
the JavaScript tests already use. esbuild handles JavaScript and CSS, writes 
source maps, keeps license comments and takes an explicit target. Cover every 
module that ships JavaScript or CSS, and keep the `.min.js` / `.min.css` naming 
so nothing changes at runtime.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to