Reminder that String.prototype still contains 'link, 'anchor'', 'bold', 'italics', 'big', 'small', 'blink', 'fontcolor', 'fontsize', 'sup', 'sub' and 'strike', all tags deprecated in HTML5. (and some possibly HTML 4) I wonder how many sites rely on these and are actually still visited by users.
@Scio_6 жыл бұрын
Honestly :raises pitchfork: let the people who use sites that use libraries that mess around with prototypes suffer the consequences.
@dassurma6 жыл бұрын
But, as Jake says in the video, that wouldn’t punish the developers but rather the _users_ of those sites.
@Scio_6 жыл бұрын
I wasn't entirely being sincere (hence the pitchforks:) but I _do_ want to punish said users in my mock indignation at this madness! All the solutions are messy, and the breaking one appeals the most to me.
@ColinRichardson6 жыл бұрын
I genuinely think, call it flatten. Then sites break, sites get updated, sites work again.
@holliswu6 жыл бұрын
Colin Richardson That won't work. Users will just yell THE NEW FIREFOX/CHROME BROKE THAT SITE. DOWNED YOUR BROWSER FOR A FIX!
@AndrewBanchich6 жыл бұрын
Surma meh
@MaxArt25016 жыл бұрын
I think a small part of developers thought that smoosh was actually going to be final - it has never been a possibility, to be fair. The source of rage is that Mootools and a lot of legacy libraries are exactly "why we can't have nice things", like decently named methods, or we have dirty hacks like document.all, as you mentioned. It's frustrating and kind of a slippery slope.
@FrameDrumAndFlute5 жыл бұрын
So that's why the Array method is Array.prototype.flat? not flatten?
@wmhilton-old6 жыл бұрын
This is fascinating! Thank you for explaining this.
@JamesCoyle956 жыл бұрын
I personally feel that we shouldn't let anything come in the way of a well written and consistent spec. I don't get why we couldn't just have some sort of doctype for javascript so you could define the version your project is using and then certain features that may cause issues like this can be disabled and trigger a warning in the console.
@jsilvermist6 жыл бұрын
#BreakTheWeb!
@jakearchibald6 жыл бұрын
If video isn't your thing, here's an article covering the same details developers.google.com/web/updates/2018/03/smooshgate.
@DavidsKanal2 жыл бұрын
Video is my thing.
@AkashSunnyChowdary6 жыл бұрын
Guys! Please, more volume.
@CompTutts6 жыл бұрын
Is it just me or it's time to release like a new much cleaner version of JS that removes the exceptions but in order to use it you have to declare in a way similar to "use strict"; "use new js"; or ; and array flatten will be called flatten, stay enumerable, but will only be available in the new JS version, I believe this will result in a much more performant browser experience
@samdenty6 жыл бұрын
But what about browsers that don't support 'use new js'? You're essentially breaking compatibility in order to use new features, which is the reason tools like babel exist.
@CompTutts6 жыл бұрын
Well then and as a fallback which we can setup with babel/eslint to know it works Only sad part will be that in chrome there is and we'll have to use something like which can be kind of tedious
@aduh956 жыл бұрын
What about do that with type="module"?
@CompTutts6 жыл бұрын
Antoine du Hamel we can't, we'll break 0.0000001% of the web
@aduh956 жыл бұрын
Nah, I could bet a fair amount of money that absolutly no website is using MooTools within a ES2015 module. But you never know ^^ So what about type="es2019" then?
@gustavon.23006 жыл бұрын
Is it shmoosh or smoosh? Thumbnail is different from the title.
@omri93256 жыл бұрын
Just call it as an emoji, I bet no library could break from that. I hope I'm not wrong :|
@silentobserver90954 жыл бұрын
I'm quite sure jQuey V2 will use emoji...
@malipetek5 жыл бұрын
I did not get why it has to break web, why not do this: Object.defineProperty(Array.prototype, 'flatten', Array.prototype.flatten || moo.Flatten)
@dwighthouse6 жыл бұрын
Have the considered making new standards not modify the prototype either, and have a standard function library that is imported the same way as any other library? `const { flatten } import 'js.std'; const flattened = flatten(array);` Or what about attaching them as methods on an object named using a currently unused JS reserved word like 'native'? So you could do `native.flatten(array);` You don't get the nice semantics of attaching methods on prototypes, but if it's bad practice for other libraries, it could conceivably be bad for future standards that conflict with existing standards.
@jakearchibald6 жыл бұрын
Give me the bind operator then maybe we can talk.
@dwighthouse6 жыл бұрын
Sounds good to me. 👍
@jincyquones5 жыл бұрын
There is a TC39 proposal for a Javascript standard library, currently in Stage 1. Seems promising, but it's gonna be awhile till it lands, no matter what.
@promatik6 жыл бұрын
Ok, since I'm not English native, I googled "shmoosh", and the first result is the urbandictionary, and the definition says; "verb; to consumate, f**k, have sex". How can this even be an option? :)
@andrewtfluck6 жыл бұрын
Squash, crush, compress, are some other ones
@andrewtfluck6 жыл бұрын
Smoosh sounds the best though lol
@loquek6 жыл бұрын
It was always known as a bad practice, for this very reason, so why shouldn't it happen? Is Mootools really going to force the naming convention of the future by executing bad practice? I am sure in the history of the web browser updates have broken something previously? On the flip side, I think it is very nice and considerate to consider renaming it to ensure some old popular sites work, despite this. Edit: oki I should have watched all of the video before commenting, I like Surma's idea : ) maybe `Moomode`? : D