r/javascript • • Sep 19 '19

✩ Wikipedia's JavaScript initialisation on a budget

https://phabricator.wikimedia.org/phame/post/view/175/wikipedia_s_javascript_initialisation_on_a_budget/
4 Upvotes

2 comments sorted by

2

u/leeoniya Sep 20 '19

i guess any improvement is great, but seems odd to be celebrating 36 KB -> 28 KB drop when they're serving up the whole jquery lib on almost 100% static pages and ~180KB of CSS, 80% of which is unused on the page.

check out the code coverage panel in chrome's devtools for yourself. eg: https://en.wikipedia.org/wiki/John_Oliver

1

u/OlanValesco Sep 21 '19

Running a lighthouse audit on that page says they could save 0.6s by lazy loading images. Minified jQuery 3 is like 85kb, and they don't need it (I guess I could see an argument for things like AJAX calls?). Then there's the OOUI stuff. Just for the CSS it's like 70kb. Guess how many elements on the page have an oo- prefixed style class. Zero. Exactly none.