How Twitter deploys its widgets JavaScript
blog.twitter.com
blog.twitter.com
I'm intrigued by this hole in the process. At Twitter scale, how is it that these bugs make it past testing, QA, CI, and staging?
I know the Dijkstra quote[1], but still: Twitter AFAIK has as organized and talented a code practice as any company of that size needs in order to do any programming and maintenance, and still they get the kinds of problems that even freelance clients gripe about costing them thousand$/hour. I also realize that I'm playing a little No True Scotsman here, but again: still.
1. http://www.brainyquote.com/quotes/quotes/e/edsgerdijk201165....
The devs at Pinterest and TripAdvisor are jerks about this. Try following this one:
<script src="https://www.jscache.com/wejs?wtype=certificateOfExcellence&uniq=847&locationId=307144&lang=en_US&year=2016&display_version=2"></script>
After the redirects, they serve you a file that is unminified and with 20% comments. I'm not sure if the engineers at these places hate their users, or are just incompetent.EDIT:
You're right, I went to far. Not hatred, disregard and carelessness. Contempt maybe.
It would take them a couple of hours at most (testing included) to add minification to their build process if they have one (a this stage, one can't be too sure since they don't follow basic web dev best-practice).
> 1.4 KB
That is for one badge. This is even more madness; they make you download the same js file from a different URL for each badge you want to display. Resorts like to show as many badges as they have to show that they've been highly ranked for a long time. A client of mine who wants to show her little resort has been the topped rank in her area for the past five years has to add 7KB of JS to do it.
> This world of large retina images
Not outside the first world, and tripadvisor is a global company supporting multinationals and tiny little 2-hut resorts alike. It's very likely they made the same assumptions that you did... which is basically my point... that they have no respect for their users (resorts and web devs). A little internet cafe in Timbuktu doesn't have 7KB of data to waste.
https://blog.twitter.com/2016/embedding-twitter-timelines-ju...
Widgets no longer worked. So basically if you had widget IDs on data elements in HTML, the code no longer executed. Forced upgrade of the frontend code to match the JS requirements.
src="foo.js?v=1", then src="foo.js?v=2", etc.
I'm sure people consider this a hack, so I'm open to hearing other suggestions.
It doesn't work for unversioned library code though where you want to automatically upgrade all users of your code as is the case with Twitter it looks like.
found that write up extremely comical.
(We do say a 'small number' of reposts, which 5 is probably over, but not that much over.)