318 points · by pizlonator · 9y ago · 185 comments
I mean, where are service workers? Give me a nice, cross-platform way to handle offline-first and I'll be happy. But hey, it isn't like there's some kind of browser monopoly on iOS or anything, like there was in windows.
Safari 11 supports WebRTC, Media Capture API, WebAssembly, WebCrypto API, drag-and-drop, and other interesting new features. If a crippled browser is their goal, they're doing quite an awful job of it.
I emailed the guy in charge of Safari on iOS and he said they have no plans to implement web push notifications on iOS!
Now when we are super close to really supporting progressive web apps, apple is holding back (potentially to protect that golden calf of an app store).
I’m pretty sure you'd be wrong. Apple announced that it's paid over $70 billion to app developers since the App Store became a thing in 2008 at today's WWDC keynote. This is the 30% Apple pays developers; so we're talking about $233 billion in gross transactions in less than 10 years.
Apple is likely to be the first trillion dollar valuation company; I seriously doubt it's worried about web apps encroaching upon a fairly small part of it's revenue: http://fortune.com/2017/03/31/apple-trillion-dollar-company/
If they enabled more progressive webapp features, we'd start to see a lot more cross platform webapps. That would not be in Apple's interest.
Every discussion about anything in Safari on HN, even if not at all related, for the last year or two has included multiple people complaining about the lack of WebRTC.
Now it's here and there is a new complaint /s
I agree with threeseed that it probwont come and frankly I don't see why I'd want it (or web notification, or even WebRTC). They only seem to support the use case of replacing real apps with webpages which I don't want to do and makes no sense to me as an end user (I understand the freedom motivations).
The general point isn't about any one feature in particular. It is about a history safari has with not implementing (or half-heartedly implementing, as with indexeddb for so long) APIs that are important to making the web a useful platform.
Reasonable people can disagree whether or not those features are good, but it seems basically true that my mobile web work is constrained by what iOS safari outright refuses to do, more than anything else.
You are privileged to be able to work with Safari.
Imagine if you had to work with its bastard deformed brothers WKWebView and UIWebView.
> Now it's here and there is a new complaint /s
WebRTC is 6 years old and it's been implemented in Firefox and Chrome for 5 years now ! Since then there's plenty of other DOM API that where introduced and are not supported in webkit, for instance :
- service workers
- push API
- Fetch API
- User Timing API
- Subresource Integrity
On the JavaScript side, the JSC team has been doing a great job for the past two years, leading the way in term of performance and ES2015+ support, but on the DOM side, Safari is really lagging far behind (which is, I guess, probably because they don't want the compete with there native mobile apps).
They also already have Custom Elements v1 support, which is still in progress in Firefox.
Timing and SRI they announced in this release (11).
Service Workers is THE big gap, at this point it feels like they're actually very afraid of progressive web apps.
(That said, the complaint was always lack of WebRTC and ServiceWorker support.)
You have a source for that? To me nobody really started caring about ServiceWorker until the big push recently for PWAs w/ launch of Lighthouse etc. Whereas devs have always wanted browsers to keep up with JS/ES/CSS language standards.
Also "development doesn't really work like that". Who's to say the same devs implementing ES6 features could take on ServiceWorker. Maybe there's something in the codebase blocking ServiceWorker. You just don't know. Assuming one thing is being neglected in favour of the other is a huge assumption.
I feel like the internet getting angry that 'feature 1' is released whilst the 'feature 2' they want isn't, and being all 'why are they spending all their time on feature 1 instead of working on my thing' is such an old trope there should be a term for it.
(But yeah I'd like to see ServiceWorker in Safari too, though please let's not bite the hand that feeds)!
Speed is great and all, really great for some people. I just wish they had different priorities.
But webrtc support is cool.
My room, on the other hand, is definitely not tidy. Haven't cleaned that shit in ages.
Only one popular consumer OS has prevented the installation of alternate browsers and everyone looks the other way.
On the other hand, it is objectively true that there is only one browser platform for iOS. WebKit or nothing. If they actually supported chrome or Firefox instead of requiring them to be wrappers on webkit renderers, I would not have this complaint.
Of course, the reason this isnt being taken up by anti-trust folks is that iOS doesn't dominate the market the way windows did. So: i guess the answer is to convince my users to stop buying idevices. Whee.
No. Monopolies themselves aren't illegal, especially when they're natural monopolies.
It is illegal for a company to use its monopoly to stifle competition in other, unrelated markets.
The classic case is Microsoft using its monopoly in operating systems when Windows had 95% marketshare in the emerging browser market. Remember that Microsoft threatened to cancel HP and Compaq’s Windows licenses if they continued to ship Netscape Navigator instead of IE. That's illegal.
It's not illegal to have a rules and guidelines for a platform a particular company owns. Game consoles are way more restrictive than the iOS App Store and nobody is suing them.
iOS doesn't prevent the installation of alternate browsers. It prevents alternate browsers from running their own HTML renderer. Preventing alternate browsers might be legally actionable if Apple had a monopoly; preventing alternate HTML renderers is decidedly not.
Developer Tools > Application > Service Workers
chrome://inspect/#service-workers
If there was a rogue web site launching service workers to do something nefarious how would I know diagnose what's happening ? How would my grandmother ? Where is the transparency the web is supposed to provide ?
The service worker spec was carefully and deliberately designed to give the browser, not the site, control over resource consumption. The browser is allowed to stop any service worker at almost any time. See https://github.com/w3c/ServiceWorker/blob/master/implementat...
Is there UX work to be done? Sure. But the fundamental problem is that they fill a need that is not met at all by Apple, and not even in a silly "use metal instead of vulkan because reasons" kind of NIH but we'll support some other similar standard fashion, but in a "nope" way.
So, kudos for the speedy es6. I'm still not going to tell people to use safari on macos, and I'm still going to build crazy DIY caches for safari on iOS because I can't do stuff with service workers in a standardized way.
What exactly are you supposing a service worker would be doing? They can't do huge downloads (the worker is shut down when there are no pages using it and it can only be reactivated by another browsing session or push message), can't receive push messages without showing a notification... there really is very little a service worker can do nefariously.
It can, however, help improve battery life by allowing you to better control the offline experience, and not needlessly activate cell radios.
How does your grandmother check if the website she visits isn't doing something nefarious without service workers? Does she run the CPU profiler to see all the JS being executed? That's pretty badass, I wish my grandmother was this cool.
fwiw, Chrome, Firefox and Safari have all been fairly competitive on the major performance benchmark (Octane) for a while, with jsc taking a bit to catch up to the others. Sunspider and Kraken are now relatively outdated because everyone is fast on them:
Octane is on the way out, so I have no doubt that the vendors will all pull close together on this new Apple benchmark set once they have time to optimize for it, since most of these benchmarks are cynical gaming anyway more than they are real applications. (Octane, which is culled from real webapps, had a glaring bug in one of its test cases for a while that happened to make v8 much faster at the cost of the test not actually doing real work.)
It's also silly to judge a browser's performance based on how fast bleeding-edge features are. Bleeding-edge features can't be fully/effectively optimized until there are real-world examples of how they are used.
P.S. it may be interesting to look at https://arewefastyet.com/#machine=36 and note that the JS runtime in MS's Edge is shockingly competitive on these benchmarks as well. You can't count anyone out of the race.
It's enough to make the startup feel slow (3-4 seconds of being unresponsive) and things like animations and drag and drop features to feel janky. Running a non-minified build (about 20MB of JS, minifies to about 1MB) also completely murders Firefox reducing it to a slideshow, making Firefox unusable for development, while Chrome works just fine.
For one thing, minification's impact is largely on parsing, so it shouldn't have any noticeable impact on anything other than startup time and memory usage (the compressed JS source for Function.toString will be a bit smaller if minified). If your app is really slower at runtime when not minified, again, something is wrong.
Is your application written in raw (non-transpiled) ES6 and heavily using generators, async, tail call opts etc in tight perf-sensitive loops that run on the main thread without yielding to the event loop? It's hard for me to come up with a scenario where you could see such a huge performance gap in a well-constructed application.
If computational performance is really important to you, then you're writing asm.js (or webassembly) and shipping that. All of the modern JS engines perform great on that sort of code and you simply cannot see a 3-6x gap there. So something weird is going on with your app that any vendor would be happy to fix if you sent them a repro (or just let them try out your app).
I used to work on an app that was 5 to 10 times slower in v8 than in SpiderMonkey, was it a proof that v8 was slower than SpiderMonkey ? No, we were actually falling in a v8 slow path (using exceptions in a hot section of the code because babel was transpilling `for of` loops to something that used exceptions), after some profiling we found the culprit and fixed it.
When you hit a 5x differences in JavaScript speed, it's almost never a browser performance difference, it's a bug in this specific browser : you're probably hitting a slow paths in this engine and you can probably work around it (or report a bug and wait until they fix it).
Feel free to email me if you'd prefer not to share a link in a public HN comment. See my HN profile for my Mozilla email address.
[Edit: Actually two things: hot loops in the same function as a class definition, and derived classes that use "super".]
Chances are whatever you see on your app is a different issue. I'd be happy to profile and file bugs as needed if you can get me a link that shows the problem on your app.
1) If you have a class definition inside a function, that function doesn't get jitted. The functions in the class definition itself can still get jitted. 2) Class methods that use super don't get jitted at the moment.
So if your class definitions are not in the same function as your hot code and don't use super, you get fast paths. Otherwise some things will run in the interpreter.
The tracking bug for this is https://bugzilla.mozilla.org/show_bug.cgi?id=1167472 and https://bugzilla.mozilla.org/show_bug.cgi?id=1167472#c13 is what the above summary is based on.
Also, all deployed sites and apps today are actually running ES5 transpiled from ES6.
I've had Firefox block more js/elements than Chrome and sometimes I think other bits of the page are busy waiting for some event that will never happen.
I use lot of tabs and well chrome might start faster but if you have 30 tabs open it slows my whole computer. With firefox it seems all fine.
I'm a dev. I'm lazy. I have no particular objection to the idea of moving away from ES6 as a name, but if the new name isn't more useful, it's not going to gain any ground.
But hey, this is Apple which often insists on giving their OS releases both a number and a name and referring to them by each in different places (but hardly ever using both name and number at once), so. I feel like if I were able to tally up all the minutes I've spent cross-referencing "Wait, so 10.6, which one is that? Wait, so 'Leopard', which one is that?", it'd be depressing.
Not judging, but if high profile articles and browser vendors started addressing it correctly we wouldnt have any issues migrating, more syllables or not.
How are these problems alleviated if we change the name we use? Or have I totally misunderstood your point?
Side Note: I'm not a fan of using a year for the same reason we (i.e. most everyone) stopped using it for versioning - That previous iterations have been done on a yearly cycle does not mean that future iterations will follow that schedule. That, however, is a side argument that neither of us touched on.
ES2015/ES6 might be 2 years ago, but feature complete support isn't yet available on all major browsers. I expect, however, that ES2016 will hit complete-or-basically-complete support relatively soon after full ES2015 support. If true (or any other irregularity over time), I might be 2 years behind on ES2015 and 1 year behind on ES2016 according to their names, but I might have, say 3 months until ES2015 is an option and 8 months for ES2016.
And of course, unlike, say, Java, it's not really a yes/no choice. I tend to use const/let, native promises, fetch(), and arrow functions, but haven't yet had/found/realized a need for generators...am I behind ES2015? If 30% of ES2016 is implemented by most browsers, and I use one feature included in that 30% in 2017, am I 1 year behind?
The ES6, ES7, etc labels do an equal job (that is, not a great one) of saying how behind you are, in a more compact package.
"Fifteen" isn't much worse than "seven" and this won't be an issue until for another 80 years.
When you speak it, nobody can hear the apostrophe.
The difference in speed is much lesser. Wonder how this will all change by the time their technical preview actually makes it to stable.
Basically, if there is native support but it's not as fast as compiled/polyfilled we could continue to compile.
Edit... I work at Microsoft (I'm supposed to disclose this), but not on the TypeScript team.
We’ll keep working on more optimizations for ES-6 so there will be more counter examples.
Who is "we"?
Truth is, ES6 is what we've called it, ES2015 is to confusing cool new name!
Given that other languages mandate that additional features have zero overhead if unused, this seems like a particularly bad way of evolving a language.