TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Wikipedia's JavaScript Initialisation on a Budget

96 pointsby abbe98over 5 years ago

10 comments

evmarover 5 years ago
I am surprised to discover that wikipedia appears to not use a standard minifier on their JS, but rather they have a custom one (written in PHP) that appears to just do whitespace-style removal, which they appear to run in part of the critical path of serving (?!) rather than as an offline build step.<p><a href="https:&#x2F;&#x2F;www.mediawiki.org&#x2F;wiki&#x2F;ResourceLoader&#x2F;Architecture#Resource:_Scripts" rel="nofollow">https:&#x2F;&#x2F;www.mediawiki.org&#x2F;wiki&#x2F;ResourceLoader&#x2F;Architecture#R...</a><p>You can &#x27;view source&#x27; on a page to confirm that their JS doesn&#x27;t even do &quot;safe&quot; transformations like local variable renaming.
评论 #21020351 未加载
评论 #21020694 未加载
评论 #21025634 未加载
评论 #21020418 未加载
评论 #21025516 未加载
pugioover 5 years ago
&gt; Wikipedia&#x27;s startup payload now neatly fits into the target budget of 28 KB – chosen as the lowest multiple of 14KB we can fit within subsequent bursts of Internet packets to a web browser.<p>But (according to their linked article) 14KB is only the max size of the _first_ burst of packets, after which TCP will usually double the size in each subsequent burst. So two bursts equal 14 + 28 = 42 KB, not 28.<p>Are they doing this to assume a connection limited to only its initial burst size? I imagine this might be relevant in low-data areas (developing countries, etc.), but they don&#x27;t go in to it.
andrethegiantover 5 years ago
The &quot;Startup manifest size&quot; graph is misleading. The Y-axis doesn&#x27;t start at zero, which makes the Sep 2019 size look like it is multiple times smaller than the Sep 2018 size. In reality, it&#x27;s only ~22% smaller.
评论 #21020795 未加载
scarmigover 5 years ago
This is the kind of Javascript work I love. All too often we see terrible, overly-engineered Javascript monstrosities that actively make the web worse for everyone, and that can make some of us anti-JS zealots. But JS can improve users&#x27; experiences as well, and the folks at Wikipedia are good at it.
bo1024over 5 years ago
Tangential, but wikipedia without javascript enabled is a great experience.
评论 #21024292 未加载
评论 #21020811 未加载
herpderperatorover 5 years ago
What is &quot;the size of two 14 KB bursts of Internet packets&quot;? MTU is 1500 bytes before overheard. How did they get 14 KB? What significance does that have? And what is &quot;burst&quot;?
评论 #21020213 未加载
评论 #21020299 未加载
kickover 5 years ago
This is a great article. Wikipedia is the only site I have used in a long time that works better with Javascript turned off.
评论 #21020040 未加载
shanselmanover 5 years ago
Dat Y-axis.
badrequestover 5 years ago
Kudos to the Wikipedia&#x2F;Wikimedia teams for all this hard work!
iforgotpasswordover 5 years ago
Not to abuse this post&#x27;s comment section but I recently noticed that on IE11 mobile, image captions overlap with the article&#x27;s text. I don&#x27;t think this is relevant enough to formally file a bug report (browser seems to be grade c) but in case someone working on the site&#x27;s CSS reads this and feels overly bored, well..... ;-)
评论 #21019138 未加载