What The Smoosh Is That?
And What Does It Have To Do With MooTools?
Well, the last 24 hours of my Twitter timeline is full of smoosh
and MooTools drama. But what the heck is those things?
Disclaimer: I’m not 100 percent sure of what I have written below. If I tell something wrong, please kindly tell me in the comments below!
Array.prototype.flatten
Array.prototype.flatten
is still a proposal of the ECMAScript. So, there are so many polyfills of it available.
MooTools
MooTools is a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer. It allows you to write powerful and flexible code with its elegant, well documented, and coherent APIs.
Well, MooTools implemented the aforementioned Array.prototype.flatten
. Unfortunately, its implementation is incorrect. (I won’t go into details here.) But the thing you need to know is, MooTools will only patch Array
if there isn’t already a flatten
function there.
Firefox
Recently, Firefox developers decided that they will implement native Array.prototype.flatten
into Firefox. It’s currently in the nightly builds. And because it’s already got native flatten
, MooTools decided not to patch it. Well, MooTool’s flatten
and Firefox’s flatten
are different, so some websites are starting to break.
Here comes the smoosh
So, someone suggested to rename the proposed flatten
to smoosh
to avoid implementation conflicts.
And then people started asking: Do we really need to rename it just because of an 8-year-old incorrect implementation? And that’s the starting point for the drama.