Colonel_mortis Posted September 30, 2020 Posted September 30, 2020 XRegExp is 135KB when minified as part of root_library.js (that whole bundle is only 383KB, so it's a significant chunk), but it's only used in two places: In ipsautolink/plugin.js, it's just used to evaluate a native JS regex, which I believe is totally unnecessary (use this.urlRegex.test(text) instead!) In ips.search.results.js, where it's just used to replace using a native JS regex (use $(this).text().replace(new RegExp(...), '...') instead, as you do for each subsequent replacement in that chain) (while you're at it, why does that code replace with HTML, HTML escape everything, then selectively unescape the content you just added?!) Removing those two places that don't, to my understanding, utilise the library in any meaningful way would allow you to slim down the site by a not-insignificant amount, and make certain people happy. Makoto, Ilya Hoilik, Martin A. and 8 others 11
Solution bfarber Posted October 1, 2020 Solution Posted October 1, 2020 Thanks for the feedback. I'll raise this internally for consideration. 🙂 Makoto 1
Recommended Posts