Skip to content

Switch to Terser library for minification.#163

Open
sanason wants to merge 2 commits intomasterfrom
introduce-terser
Open

Switch to Terser library for minification.#163
sanason wants to merge 2 commits intomasterfrom
introduce-terser

Conversation

@sanason
Copy link
Copy Markdown
Member

@sanason sanason commented Feb 20, 2025

The purpose of this PR is to demystify the process by which the DAP code is minified. In the repo's current state, it is not clear which tool is being used for minification or how that tool is configured. This PR adds an npm script that specifies how minification is to be performed - by the Terser library and with options described in minify_options.json. Terser is not what has been used up to now - currently the code is minified with the Google Closure Compiler. But the Closure Compiler is a Java app, which makes it awkward to use in our npm environment, and the minified file generated by Terser is the same size as the one generated by the Closure Compiler (29 KB), so we aren't losing any performance by switching tools.

One change resulting from this switch - the sourcemap file has been renamed from Federated.js.map to the more intuitive name Universal-Federated-Analytics-Min.js.map. I'll go through the wiki and update any references to Federated.js.map (I know the self-hosting instructions refer to this file, I'll look for any other places).

@sanason sanason force-pushed the introduce-terser branch 2 times, most recently from cda819b to 1a677d6 Compare February 21, 2025 18:04
Comment thread .github/workflows/ci.yml
@sanason sanason requested review from laurenancona and removed request for ahmedawwad, laurenancona and levinmr February 26, 2026 14:24
@sanason sanason added this to DAP Mar 20, 2026
@sanason sanason moved this to Todo in DAP Mar 20, 2026
@sanason sanason self-assigned this Apr 3, 2026
@sanason sanason removed their assignment Apr 20, 2026
@sanason sanason force-pushed the introduce-terser branch 3 times, most recently from e93547f to 4778864 Compare April 21, 2026 21:37
@sanason sanason moved this from Todo to In Progress in DAP Apr 22, 2026
@sanason sanason self-assigned this Apr 24, 2026
@sanason sanason requested a review from ahmedawwad April 24, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants