Skip to content

Fix: cleanup old polyfills#3524

Merged
josdejong merged 5 commits into
developfrom
fix/cleanup-polyfills
Sep 5, 2025
Merged

Fix: cleanup old polyfills#3524
josdejong merged 5 commits into
developfrom
fix/cleanup-polyfills

Conversation

@josdejong
Copy link
Copy Markdown
Owner

@josdejong josdejong commented Sep 3, 2025

Fixes #3523.

Removes redundant polyfills in the mathjs bundle included by js-core. This reduces the (minified, non-zipped) bundle /lib/browser/math.js from 677 KB to 628 KB. It also removes polyfill code like new ActiveXObject("htmlfile"), which could trigger security issues.

The bundle is still es2020 compatible. This is the minimum version required since mathjs@13.0.0. This is validated using the es-check library. You can test this by adding some code that uses a newer method like .toSorted, and then execute npm run build-and-test and see that a compatibility error is reported.

@josdejong josdejong merged commit 69b991f into develop Sep 5, 2025
8 checks passed
@josdejong josdejong deleted the fix/cleanup-polyfills branch September 5, 2025 08:21
@josdejong
Copy link
Copy Markdown
Owner Author

Published now in v14.7.0.

@Bozzzo
Copy link
Copy Markdown

Bozzzo commented Sep 6, 2025

Great.

F.Y.I : as asked publication of corresponding version in new WebJar - see: webjars/mathjs#7
that has just been published, and should be soon available in Maven Central repositories.

Thanks for your impressive reactivness anyway.

@josdejong
Copy link
Copy Markdown
Owner Author

Thanks. I'm not always fast though but this was indeed quickly resolved 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minified version includes large amount of dead code !

2 participants