Live data from Hacker News

Speeding up the JavaScript ecosystem – Polyfills gone rogue

marvinh.dev

31–40 of 112 posts

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#31

There is some interesting [drama][1] with this, since this article noticeably doesn't mention any PRs they opened to remove some of these older polyfills. The reason those PRs were never opened/merged is the maintainer of many of those libraries [has a strong stance on "breaking" changes][2] in software: > I have developed an intense avoidance for breaking changes in all of my packages, because I don't want to inflic…

Ljharb is harmful to the ECMAScript community

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#32
post #28

Earlier quoted context omitted.

Back in 2011ish or so when npm was just getting started and Ruby on rails was all the rage. "Do not repeat yourself" was seen as a gold standard for programming. The end result has been a mess, particularly for npm. There were FAR too many articles talking about how "there's no such thing as too small a dependency" and talks given about how much a virtue it was to create "is-odd" or "is-even" "look you saved 3 lines…

> "Do not repeat yourself" was seen as a gold standard for programming. I remember this era. I’ve been using nodejs before npm existed and so many silly things have happened in that time. I think the core problem the JS ecosystem has always had is that most JS developers are relatively inexperienced. (JS is very beginner friendly and this is the price we pay). I still vividly remember being at nodecamp in 2012 or som…

> The JS ecosystem just suffers disproportionately from this kind of thing because so many packages in npm are written by relatively new developers.

I think it also suffers because it grew in the age of Internet and Open Source, which made the problem compounding. Programmers write a lot of stupid code when learning, it's part of the process - but it used to be that the stupidity was constrained to your machine and maybe a few poor souls who ended up reading or using your code. In JS ecosystem, all that stupidity gets published, and ends up worming its way, through dependency chains, into everything.

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#33

I maintain a few JavaScript libraries that I manually verify compatibility against IE6 (and have lints to catch violations). I manually polyfill a few necessities and quality-of-life improvements up top in the script. Out of curiosity, I removed my polyfills and tried swc and babel both, followed by an eslint pass, and the results were absolutely atrocious. Everything gets polyfilled, even stuff that has been support…

Why are you supporting IE6?

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#34

I maintain a few JavaScript libraries that I manually verify compatibility against IE6 (and have lints to catch violations). I manually polyfill a few necessities and quality-of-life improvements up top in the script. Out of curiosity, I removed my polyfills and tried swc and babel both, followed by an eslint pass, and the results were absolutely atrocious. Everything gets polyfilled, even stuff that has been support…

> I maintain a few JavaScript libraries that I manually verify compatibility against IE6

Genuinely curious why anyone would target IE6 in 2023. Is it a personal goal to have massive coverage for your library?

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#35

There is some interesting [drama][1] with this, since this article noticeably doesn't mention any PRs they opened to remove some of these older polyfills. The reason those PRs were never opened/merged is the maintainer of many of those libraries [has a strong stance on "breaking" changes][2] in software: > I have developed an intense avoidance for breaking changes in all of my packages, because I don't want to inflic…

Is there not a config for minimum supported JS version? That would appease everyone, while maintaining backwards compatibility.

Docs should show the recommended version (modern) and show what options are available to go deeper.

Obviously adding those settings for every pollyfill in non-trivial, but burdening everyone with every pollyfill ever is also suboptimal. If anything, this would make cleanup easier going forward since it would all be classified

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#36

I maintain a few JavaScript libraries that I manually verify compatibility against IE6 (and have lints to catch violations). I manually polyfill a few necessities and quality-of-life improvements up top in the script. Out of curiosity, I removed my polyfills and tried swc and babel both, followed by an eslint pass, and the results were absolutely atrocious. Everything gets polyfilled, even stuff that has been support…

> I maintain a few JavaScript libraries that I manually verify compatibility against IE6 Genuinely curious why anyone would target IE6 in 2023. Is it a personal goal to have massive coverage for your library?

It was used in the checkout flow on our website and the marginal cost of supporting IE6 wasn’t worth a lost sale. That was many years ago, and since then I don’t think we have anyone on less than IE8 due to TLS version issues with CloudFront, but the code already supported IE6 and there aren’t many polyfills extra compared to IE10, so :shrug:

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#37

I maintain a few JavaScript libraries that I manually verify compatibility against IE6 (and have lints to catch violations). I manually polyfill a few necessities and quality-of-life improvements up top in the script. Out of curiosity, I removed my polyfills and tried swc and babel both, followed by an eslint pass, and the results were absolutely atrocious. Everything gets polyfilled, even stuff that has been support…

Why are you supporting IE6?

I replied to a sister comment to yours but it’s an old library that started off with IE6 support maybe 10 years ago and just kinda never lost it.

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#38

There is some interesting [drama][1] with this, since this article noticeably doesn't mention any PRs they opened to remove some of these older polyfills. The reason those PRs were never opened/merged is the maintainer of many of those libraries [has a strong stance on "breaking" changes][2] in software: > I have developed an intense avoidance for breaking changes in all of my packages, because I don't want to inflic…

Ljharb is harmful to the ECMAScript community

I'm thankful for his work, but I do agree, this polyfill madness has to stop.

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#39

Earlier quoted context omitted.

Second that, I would definitely buy a book based on this series.

Thanks for the kind feedback! It's definitely something in the back of my mind. I feel like I need to collect a little more content to fill a whole book, but I'm enticed by the thought of writing one nonetheless.

Part 3 send me down a debugging route of eslint performance in the GitLab project and we were able to move from 25 min of listing time in CI, down to 5. So, thanks for the inspiration!

Re: Speeding up the JavaScript ecosystem – Polyfills gone rogue

#40
post #23

Earlier quoted context omitted.

Back in 2011ish or so when npm was just getting started and Ruby on rails was all the rage. "Do not repeat yourself" was seen as a gold standard for programming. The end result has been a mess, particularly for npm. There were FAR too many articles talking about how "there's no such thing as too small a dependency" and talks given about how much a virtue it was to create "is-odd" or "is-even" "look you saved 3 lines…

jQuery is the one that’s outlasted them all, but yes - there were absolutely other frameworks in use. It also discounts the detour into the Backbone era before Angular and React took off.

MooTools springs to mind
Post reply on HN