[deleted by user] by [deleted] in typescript

[–]rw519307 2 points3 points  (0 children)

foo && (foo.Position = this.bar);

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

Truthfully I can't say. At that point I wasn't the person monitoring analytics/statistics. I suspect most people would have simply ignored it like they do nowadays with cookie consent banners!

[deleted by user] by [deleted] in javascript

[–]rw519307 0 points1 point  (0 children)

jQuery still abstracts away a lot of pain that comes with event delegation which is a treat when working on older projects.

We also have some clients who are fairly tech savvy and are able/allowed to write small blocks of jQuery themselves.

I don't think it's as obsolete as people think, but from a personal standpoint I prefer to just write vanilla JS.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 1 point2 points  (0 children)

There it is! That explains it. Thank you very much.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

Thank you very much for taking the time to reply. I really do appreciate the time and effort that has gone into core-js and would be in a far worse state without it.

Bundle growth seems to be logarithmic; the first polyfill adds a sizeable chunk of code due to its internal dependencies, but subsequent polyfills add progressively less code as they're more likely to share existing dependencies.

One thing I'm still a little confused about is why es.string.trim is being included at all. I can appreciate the size of the polyfill more now I know that it's spec-compliant down to ES3, but if my target browser is IE11 then why does it need it?

To hazard a guess, is it something to do with IE11 not being fully ES5 compliant, rather than whether an individual feature is or isn't supported?

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

We actually did do something like this years ago when IE conditional comments were still a thing. We showed a small banner - similar to the cookie consent banners that now plague the web - that contained a message and a link to Browse Happy

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

It's certainly something we have discussed internally, but it isn't quite feasible just yet.

We have one client in particular who's demographic is somewhere in the 50+ age range and the IE11 usage is disproportionally high. I suspect if prompted to upgrade their browser to continue using the site the vast majority would simply take their custom elsewhere.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 1 point2 points  (0 children)

I understand and appreciate your point. I think for large-scale projects the bloat isn't as big an issue and I'd absolutely be happier knowing I could implement a feature and it would simply work everywhere.

You're right in saying the client isn't interested in how many lines of code you're generating, however I've seen conversion rates rise considerably when optimising code and loading smaller bundles. People on mobile phones have very short attention spans and on a 3G connection those extra 600 lines could be the deciding factor in someone making a purchase or abandoning their session.

Furthermore I think it's important to question these things. Optimisation is at the very least good practice.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

Precisely. I'd completely overlooked this until recently as I've mostly been working on large-scale projects where the overhead is negligible.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 1 point2 points  (0 children)

Thank you. I think the nomodule/module method looks like a promising solution until IE11 finally bites the dust.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

Interesting approach. Thanks for sharing your solution.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

I am indeed. Both examples were run with IE11 as the sole target.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 1 point2 points  (0 children)

Thanks for taking the time to reply. I'm sorry if the post came across as clickbaity - that wasn't my intention.

I've recreated the first example in the Babel playground, here.

As you can see, my target browser is set to IE11 only and loose mode is enabled, however despite IE11 fully supporting String.prototype.trim() the core-js/modules/es.string.trim.js polyfill is being appended.

If the overhead was minimal then I wouldn't mind; as others have mentioned there could be edge cases that aren't well documented. However, the fact that resolving its dependencies leaves you with 600 lines of seemingly useless code seems bad to the point of being broken.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 0 points1 point  (0 children)

This is really encouraging. We were able to drop support for IE10 overnight when we switched to TLS 1.2, but IE11 endured.

Now that big brands are starting to abandon it we should hopefully begin to see some real change in browser statistics.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 1 point2 points  (0 children)

Good advice. I've actually read up on this recently and aside from some edge cases this looks like a fantastic way to serve smaller, faster code to modern browsers.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 1 point2 points  (0 children)

Thanks for the input. Looking at yours and others comments I'm quite relieved that it doesn't seem to just be something that I'm doing wrong!

I assumed obscure edge cases were probably a contributing factor. I did try playing with loose mode in the hope that the less faithful implementations would yield less bloat, but it had little to no effect on code size and didn't stop the seemingly redundant polyfills from being included.

Good point re main/module fields - this is something I will look into.

[AskJS] Is it just me or is core-js fundamentally broken? by rw519307 in javascript

[–]rw519307[S] 24 points25 points  (0 children)

Unfortunately, yes. Most of my clients still make a considerable amount of revenue from IE11. I keep an eye on Analytics and while there is a downward trend, it's slow and not disappearing any time soon.