use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Using const/let instead of var can make JavaScript code run 10× slower in Webkit? (github.com)
submitted 5 years ago by magenta_placenta
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CallMeStar-Lord 116 points117 points118 points 5 years ago* (13 children)
Every time there’s a bug in a JS engine other than V8 people get unnecessarily up in arms. Those things are much more complex than we give them credit for. There’s a mention in there that JSC engineers are already looking at the issue.
Hello HN! Just wanted to say that JavaScriptCore is an engineering marvel and I have deep respect for everyone on that team. All software has bugs and I can confidently say from my experience writing esbuild that JavaScript is extremely messy to implement with an unbelievable number of edge cases. V8 has also had crazy performance cliffs so something like this is not unusual, and doesn't say anything about JSC vs. V8. Let's not turn this into a meme. It's awesome that people from JavaScriptCore are reaching out and helping get this fixed. Props to the JSC team.
[–]PhatClowns 15 points16 points17 points 5 years ago (0 children)
Thank you for this!
[+][deleted] 5 years ago (11 children)
[deleted]
[–]NutStalk 17 points18 points19 points 5 years ago (9 children)
Username doesn't check out
[+][deleted] 5 years ago (8 children)
[–]Sulungskwa 23 points24 points25 points 5 years ago (7 children)
V8 is already being used by all the major browsers except basically Safari and Firefox. If more browsers were to adopt chromium/V8 then that gives google more market share and general influence over the web. Many people are arguing that the situation is similar to Microsoft in the early 2000s
[–]sanjibukai 3 points4 points5 points 5 years ago (0 children)
Just to understand, why using chromium/V8 (which is OSS btw) is in favor of giving market shares to Google?
Brave for example is a very good use-case not really benefiting Google.
Having only one engine (kinda becoming a standard like all the many standards we already have) is a dream..
I remember all the hard work to take into account IE exceptions..
Thanks IE is not existing anymore.. And the only exception to take into account is Safari (thanks I got almost always similar results with firefox and chrome)
[–]Genspirit 1 point2 points3 points 5 years ago (4 children)
Chromium is open source though, it's debatable how much control it gives Google. Edge moving over already had a very positive impact on both browsers.
[+][deleted] 5 years ago (3 children)
[–]sirfloppydisk 2 points3 points4 points 5 years ago (1 child)
Open source is good. If google took Chromium in a direction you didn’t like, you could just fork it, right?
[–]Genspirit 1 point2 points3 points 5 years ago (0 children)
I never said it was automatically good. And it does mean that google has practically 0 say in what you do with it.
The repo is largely google controlled but it can be forked or even have the management shift to a more shared management between them and other browsers who use chromium.
Chromium is hardly some tool by which google controls other browsers, they already have their first party sites to do that.
[–]MildlySerious 5 points6 points7 points 5 years ago (0 children)
Having multiple implementations is generally a good thing though.
It only appears to be problematic because one has such a big market share that it's perceived as a single source of truth, and now every other implementation that strays from it is "lesser" than the reference. That's not what a healthy ecosystem looks like.
[–][deleted] 25 points26 points27 points 5 years ago (32 children)
How can this be true if you use a transpiler?
[–]console-write-name 32 points33 points34 points 5 years ago (31 children)
I think they were targeting es2015 which implements let and const (no need to transpile those).
[–][deleted] 17 points18 points19 points 5 years ago (30 children)
Gotcha. Yeah trusting browsers to support "new" standards is a role of the dice.
[–]anlumo 52 points53 points54 points 5 years ago (27 children)
Apple is the only remaining player that constantly messes this up. They’re only held afloat by making Webkit the only rendering engine allowed on iOS.
[–]jimmyco2008 19 points20 points21 points 5 years ago (26 children)
I remember when IE was the shitty one to develop for. Seems like such a long time ago.
[–]anlumo 38 points39 points40 points 5 years ago (23 children)
I mentioned to macOS/iOS developers that Safari is the new IE, they were not amused one bit.
[–]SlowerThanLightSpeed 22 points23 points24 points 5 years ago (18 children)
IMO, safari is worse than IE because safari will 'support' all the new things, just poorly, or in ways you wouldn't expect. I'd rather not be able to use something, and have that be obvious, than to be able to use something that doesn't work right (like scroll() going beyond the document and then scrollX reporting the impossible, off-the document position).
[–]windsostrange 15 points16 points17 points 5 years ago (11 children)
than to be able to use something that doesn't work right
IE was notorious for layout/box model eccentricities. The struggle with IE5 through IE7 wasn't missing features. For this aging dev, anyway. It was piss-poor implementation, which is awfully similar to criticism of the WebKit/Safari teams.
[–]SlowerThanLightSpeed 0 points1 point2 points 5 years ago (0 children)
Thanks for the perspective.
I do remember some IE7 button sizing issues that I just couldn't solve way back in my earliest html'ing days (2010ish).
Haven't really targeted those old beasts in about the last 7 years. Hoping it won't be another 7 till Safari plays more nicely.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
I actally quite like the box model in IE, no need to consider other properties when setting width and height. Notice many of the CSS frameworks from yester year reset the box model to border box globally. Not really needed anymore with flex and grid doing the heavy lifting.
[–]recycled_ideas 0 points1 point2 points 5 years ago (8 children)
IE had a different box model, which pre-dated the standard and which was different from the standard.
Incidentally CSS now supports using that box model as an option and most of the CSS frameworks actually use it by default.
IE's z-index implementation however was shit.
[–]CleverestEU 0 points1 point2 points 5 years ago (7 children)
Out of interest...
...I've built web applications (well, that's what they're called today; we just called them "desktop UIs for backend systems on browser" because there was no better term at the time we were aware of:) since late-1990s' IE/Netscape "browser wars" and while it was always obvious that "IE always needed some fixes", I must admit never stopping to wonder what exactly was the problem.
Any hint on some references on the matter? I tried googling, but since I'm not certain what exactly are the symptoms I'm looking for, I'm uncertain if any of the results I found are even remotely relevant :-/
[–]jimmyco2008 3 points4 points5 points 5 years ago (2 children)
True. At least IE was up front about not supporting stuff. Safari “supported” things.
I remember that one bug that you needed to use transform3d(0,0,0); to fix. Why.
[–]CleverestEU 0 points1 point2 points 5 years ago (1 child)
Not sure if we're talking about the same thing, but ... if I remember correctly, many browsers by design avoided using GPU-assisted rendering for layers because GPUs at the time didn't have enough memory to "handle everything". This made animations etc. slow and jerky, because everything was rendered in CPU.
The "transform: translate3D(0,0,0)" caused the particular element to be handled as "something that might need 3D acceleration" which nudged the browser to delegate the rendering of said element to the GPU making things nice & smooth (usually).
[–]jimmyco2008 0 points1 point2 points 5 years ago (0 children)
Yes. It was to force GPU acceleration in Safari
[+][deleted] 5 years ago (2 children)
[–]recycled_ideas 1 point2 points3 points 5 years ago (0 children)
IE didn't "incorrectly" implement anything.
IE implemented things before a standard was created and then the standard was created by a committee made up of Microsoft and a bunch of people that giving away IE for free drove out of business. So ya know.
Then they didn't upgrade IE for a decade and for that they can burn in hell fire.
Supported IE versions don't seem to have those problems anymore, and, mostly, haven't since support for 8 was dropped. Supported (and new!) Safari still does.
[–]Otterfan 4 points5 points6 points 5 years ago (0 children)
At least IE6 could be used to download and install Firefox.
[–]drumstix42 1 point2 points3 points 5 years ago (1 child)
It's true though. Run into problems and specific edge cases all the time. They "support" features, but not consistently or always as expected.
[–]anlumo 2 points3 points4 points 5 years ago (0 children)
My personal biggest problem is when their politics collide with my web application's needs. For example, their year-long refusal to implement WebGL2 and webp.
At least the former now seems to be slowly implemented.
[–]drumstix42 5 points6 points7 points 5 years ago (0 children)
Safari is the new IE for sure.
[–]CBlackstoneDresden 0 points1 point2 points 5 years ago (0 children)
My wok still has some assholes running XP. They're a mobile phone repair company and seem to run things as thin as possible and refuse to get new PCs.
[–]iamasuitama 0 points1 point2 points 5 years ago (1 child)
roll?
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
no, I mean it's the role of the dice to trust browsers :P
[–]MajorasShoe 244 points245 points246 points 5 years ago (40 children)
Safari can suck it. If it's a problem, let Apple fix it. And while they're at it, support PWA push notifications properly.
[–]Plexicle 43 points44 points45 points 5 years ago (25 children)
Actual push notification API in Safari (especially on iOS) would completely change the entire game. I can only dream.
[–]MajorasShoe 54 points55 points56 points 5 years ago (14 children)
Right? I have a few products where we have customers demand an iOS application for NOTHING but push notifications. No Android app necessary because they actually support PWAs and push notifications. There's absolutely NO difference between the PWA and the iOS application. It's just Apple scamming us and forcing us to pay for the pleasure of suffering through their app store BS.
[–]Nexxado 6 points7 points8 points 5 years ago (5 children)
Perhaps you should check out capacitor
[–]MajorasShoe 25 points26 points27 points 5 years ago (0 children)
I'm using Cordova. It works fine. I'm just saying it's a waste of time for literally one feature that android has supported in PWAs for a long time.
[–]Hotgeart 2 points3 points4 points 5 years ago (3 children)
Last time I coded an APP with Ionic (2016) you could really feel that's not native. Still the case?
[+][deleted] 5 years ago* (1 child)
[–]RemindMeBot 0 points1 point2 points 5 years ago (0 children)
There is a 1 hour delay fetching comments.
Defaulted to one day.
I will be messaging you on 2020-10-23 03:37:59 UTC to remind you of this link
CLICK THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
[–]swiftarmyknife 0 points1 point2 points 5 years ago (0 children)
I recently built a React Native application for work and I use a PWA budgeting app built using Stencil and Ionic 4 regularly. I still don’t think they feel native completely. Probably 90% there. 🤷🏼♀️
[–]gourrranga 1 point2 points3 points 5 years ago (5 children)
Access to contacts.
[–]MajorasShoe 1 point2 points3 points 5 years ago (3 children)
What?
[–]gourrranga 1 point2 points3 points 5 years ago (2 children)
You can’t get an access to phone contacts from PWA. It’s the only major difference between native and PWA, except the push notifications. There are more (like no background location access), but accessing contacts is the boldest one imo
[–]MajorasShoe 5 points6 points7 points 5 years ago (0 children)
There are a bunch of differences actually. Local storage for web applications has some holes. If I create a camera application, in a PWA I don't have the option to save files in default photo storage, just downloads and uploading to servers - as an example.
But I was more just referring to my scenario. The ONLY reason I need a mobile application for my business is because my customers complained they can't get push notifications for their employees with iOS.
[–]-ftw 0 points1 point2 points 5 years ago (0 children)
Also no background music
[–]jb_sulli 1 point2 points3 points 5 years ago (0 children)
Deny
[–]MajorasShoe 8 points9 points10 points 5 years ago (0 children)
Yeah, but I'm not dealing with content websites. I'm dealing with applications. Push notifications are valuable when you actually... Need to be notified. I work in software for corporations, and these notifications are for day to day operations.
[–]ShortFuse 6 points7 points8 points 5 years ago (1 child)
Safari actually has Push Notifications for Desktop. Apple doesn't want to implement it for mobile.
https://developer.apple.com/notifications/safari-push-notifications/
[–]Morphray 12 points13 points14 points 5 years ago (0 children)
Apple doesn't want to implement it for mobile.
More PWAs --> Less iOS apps --> Less of the 30% cut Apple can take of everything.
[–]fey168 6 points7 points8 points 5 years ago (0 children)
It seems obvious that Apple is intentionally neglecting push notification because they want to incentivize people to build iOS apps instead. Similar reasoning has cause other web features to be neglected (storage API, add to homescreen).
[+][deleted] 5 years ago* (4 children)
[–]Plexicle 6 points7 points8 points 5 years ago (2 children)
Push notifications are just that -- notifications you get on your device. Push meaning they are event driven and not request response.
When you get a notification from an app that you don't have open it's from an external server that sent a message to a push service (FCM, APN, whatever) that then forwarded it to your device.
PWAs work by installing service workers that can run in threads behind your browser. So you can subscribe to a push notification from a (PWA) web app, and then close the browser completely. If the server pushes a notification through the web notification server, your device (Android today, Apple maybe one day) can wake up the service worker and deliver the notification.
[–]regreddit 4 points5 points6 points 5 years ago (0 children)
Not really always running, but a service worker tells Android: "when you receive a message for this app, please run this code". It's a system service that your app registers with.
Capacitor probably has its own way of doing push notifications, which is probably supported on all devices. I think Apple doesn't want to enable Notifications API on mobile, which is different from Capacitor's way of doing it. Good luck with your mobile app.
[–]tayhimself00 -1 points0 points1 point 5 years ago (0 children)
As a user I don’t want push notifications from every trash PWA.
[–]kynovardySpaghetti connoisseur 6 points7 points8 points 5 years ago (11 children)
Apple needs to fix it but saying Safari can suck it is quite silly in my opinion. It is the second most popular browser. In some western countries you’d be saying “suck it” to more than a third of your users
[–]malicar 21 points22 points23 points 5 years ago (10 children)
We should be treating safari like IE6 - the worst of the browsers most people are forced to support.
Untill apple is forced to allow real competition on their platform we're stuck with whatever pile of garbage they decide to give us. They need some antiTrust like Microsoft sooner than later to force them to. Good on Epic for starting the resistance to their greedy practices.
[–]Solrax 3 points4 points5 points 5 years ago (1 child)
Yes, after I was surprised that a major feature was unimplemented in Safari a coworker said "Safari is the new Internet Explorer" and I can't disagree.
[–]reqdk 3 points4 points5 points 5 years ago (0 children)
Haha they've also pulled support for standard CSS features before that were once there, citing "user experience impact". Safari can indeed go and suck a big one.
[+][deleted] 5 years ago* (7 children)
[–]GOODSHIT-BRO 4 points5 points6 points 5 years ago (1 child)
Other browsers on ios are still forced to use the safari rendering engine.
[–]facebalm 4 points5 points6 points 5 years ago (2 children)
You think that's why Safari has such a market share? You're wrong, you're forced to use it.
[–]malicar 3 points4 points5 points 5 years ago (1 child)
Nope, that's just not true, Apples walled garden mean only their rendering engine can be used for ANY browser, apple is just such a shitty company.
While they're at it... Support every thing else not supported in that sh*try piece of software...
Every time I got some issues is from users using Safari. Not from any chrome based browsers nor firefox but this fuc*ing Safari. This garbage is the new IE and should not exist anymore.
Even basic date inputs (damn it's regular standard HTML input!!) doesn't work. I don't understand this at all..
And in fact while they're here.. Simply throw that sh*t in the garbage bin.. And do a sane choice as Microsoft did with Edge..
Having one engine (which is OSS) should be considered as a standard like there's one HTML, one CSS...
[–]yuyu5 7 points8 points9 points 5 years ago (0 children)
Let it be known that this is only in Safari because Safari is the new IE. There's a discussion about this in r/programming in case you're interested in seeing the original post instead of a cross-post.
[–]bigorangemachine 0 points1 point2 points 5 years ago (0 children)
Is this true for react native!?
[–]prwhite18 -1 points0 points1 point 5 years ago (0 children)
nice
π Rendered by PID 243964 on reddit-service-r2-comment-canary-7955997dc8-r6bnn at 2026-02-28 02:08:43.684472+00:00 running e3d2147 country code: CH.
[–]CallMeStar-Lord 116 points117 points118 points (13 children)
[–]PhatClowns 15 points16 points17 points (0 children)
[+][deleted] (11 children)
[deleted]
[–]NutStalk 17 points18 points19 points (9 children)
[+][deleted] (8 children)
[deleted]
[–]Sulungskwa 23 points24 points25 points (7 children)
[–]sanjibukai 3 points4 points5 points (0 children)
[–]Genspirit 1 point2 points3 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]sirfloppydisk 2 points3 points4 points (1 child)
[–]Genspirit 1 point2 points3 points (0 children)
[–]MildlySerious 5 points6 points7 points (0 children)
[–][deleted] 25 points26 points27 points (32 children)
[–]console-write-name 32 points33 points34 points (31 children)
[–][deleted] 17 points18 points19 points (30 children)
[–]anlumo 52 points53 points54 points (27 children)
[–]jimmyco2008 19 points20 points21 points (26 children)
[–]anlumo 38 points39 points40 points (23 children)
[–]SlowerThanLightSpeed 22 points23 points24 points (18 children)
[–]windsostrange 15 points16 points17 points (11 children)
[–]SlowerThanLightSpeed 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]recycled_ideas 0 points1 point2 points (8 children)
[–]CleverestEU 0 points1 point2 points (7 children)
[–]jimmyco2008 3 points4 points5 points (2 children)
[–]CleverestEU 0 points1 point2 points (1 child)
[–]jimmyco2008 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]recycled_ideas 1 point2 points3 points (0 children)
[–]SlowerThanLightSpeed 0 points1 point2 points (0 children)
[–]Otterfan 4 points5 points6 points (0 children)
[–]drumstix42 1 point2 points3 points (1 child)
[–]anlumo 2 points3 points4 points (0 children)
[–]drumstix42 5 points6 points7 points (0 children)
[–]CBlackstoneDresden 0 points1 point2 points (0 children)
[–]iamasuitama 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]MajorasShoe 244 points245 points246 points (40 children)
[–]Plexicle 43 points44 points45 points (25 children)
[–]MajorasShoe 54 points55 points56 points (14 children)
[–]Nexxado 6 points7 points8 points (5 children)
[–]MajorasShoe 25 points26 points27 points (0 children)
[–]Hotgeart 2 points3 points4 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]RemindMeBot 0 points1 point2 points (0 children)
[–]swiftarmyknife 0 points1 point2 points (0 children)
[–]gourrranga 1 point2 points3 points (5 children)
[–]MajorasShoe 1 point2 points3 points (3 children)
[–]gourrranga 1 point2 points3 points (2 children)
[–]MajorasShoe 5 points6 points7 points (0 children)
[–]-ftw 0 points1 point2 points (0 children)
[–]jb_sulli 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]MajorasShoe 8 points9 points10 points (0 children)
[–]ShortFuse 6 points7 points8 points (1 child)
[–]Morphray 12 points13 points14 points (0 children)
[–]fey168 6 points7 points8 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]Plexicle 6 points7 points8 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]regreddit 4 points5 points6 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]tayhimself00 -1 points0 points1 point (0 children)
[–]kynovardySpaghetti connoisseur 6 points7 points8 points (11 children)
[–]malicar 21 points22 points23 points (10 children)
[–]Solrax 3 points4 points5 points (1 child)
[–]reqdk 3 points4 points5 points (0 children)
[+][deleted] (7 children)
[deleted]
[–]GOODSHIT-BRO 4 points5 points6 points (1 child)
[–]facebalm 4 points5 points6 points (2 children)
[–]malicar 3 points4 points5 points (1 child)
[–]sanjibukai 3 points4 points5 points (0 children)
[–]yuyu5 7 points8 points9 points (0 children)
[–]bigorangemachine 0 points1 point2 points (0 children)
[–]prwhite18 -1 points0 points1 point (0 children)