Earlier quoted context omitted.
We were calling it ES6 since before it was called ES2015.
>> We were calling it ES6 since before Who is "we"?
JSC loves ES6
101–110 of 191 posts
Re: JSC loves ES6
#102Earlier quoted context omitted.
> I mean, where are service workers? 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 re…
With service workers you can transparently intercept outgoing XHRs and replace their results with cached values. You can even do a cache race if you want (cancel the xhr if your cache returns first). This is a hugely important feature for making web apps work offline-first. I mean, it's also a big part of progressive web apps, which is the next thing I'm going to complain about. (I don't personally care much about we…
You are privileged to be able to work with Safari.
Imagine if you had to work with its bastard deformed brothers WKWebView and UIWebView.
Re: JSC loves ES6
#103Earlier quoted context omitted.
There never was a browser monopoly on Windows just a bunch of tech illiterates who don't seem bothered by MS's "monopoly" with notepad.exe or anti-competitive moves like taking away the ability to use an alternate graphical shell. Only one popular consumer OS has prevented the installation of alternate browsers and everyone looks the other way.
I'm not entirely interested in relitigating a past I literally lived through. 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 domin…
Re: JSC loves ES6
#104Earlier quoted context omitted.
To serve that requests from local storage if your device or the server is offline.
If the asset is already in local storage, why do you need to create a network request in the first place?
Re: JSC loves ES6
#105Earlier quoted context omitted.
Safari supports Web Notifications: http://caniuse.com/#feat=notifications 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.
http://caniuse.com/#feat=push-api is the interesting notifications API, which allows notifying a user (with their permission) even when the app isn't open. Neither API is supported on iOS Safari, and desktop Safari only supports notifications while the app is open.
https://developer.apple.com/library/content/documentation/Ne...
Re: JSC loves ES6
#106Re: JSC loves ES6
#107Earlier quoted context omitted.
http://caniuse.com/#feat=push-api is the interesting notifications API, which allows notifying a user (with their permission) even when the app isn't open. Neither API is supported on iOS Safari, and desktop Safari only supports notifications while the app is open.
“push notifications can reach your users regardless of whether your website or Safari is open“ https://developer.apple.com/library/content/documentation/Ne...
Hmm, not the open web I'm familiar with.
Re: JSC loves ES6
#108Earlier quoted context omitted.
A vendor is always the fastest when they roll out a new benchmark. It's disingenuous to suggest a browser is '3-6x slower' based on a score on one benchmark, when all the vendors actively compete on and optimize against a large set of benchmarks, and compare each others' performance numbers on individual tests to understand engine weaknesses/strengths. fwiw, Chrome, Firefox and Safari have all been fairly competitive…
The performance difference I see with my own app with Firefox is exactly the benchmark's 3-6x, that's not a benchmark but real world usage. 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, ma…
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.
Re: JSC loves ES6
#109Earlier quoted context omitted.
If the asset is already in local storage, why do you need to create a network request in the first place?
Or why can't this problem be solved with HTTP caching headers and a browser that Does the Right Thing?
Most importantly, though, you can't simply disable HTTP caching when you notice that you're back online. Those cache entries are there now, and they're hard to get out. Service Workers, on the other hand, will just transparently stop intercepting stuff.
With respect to localStorage, I think the idea is that you absolutely can do almost an entire offline mode with it, with the caveat that your content (html, js, css, images) won't get stored there, so you can't load the page at all!
Also I think there are considerations about how difficult it is for many front end architectures to implement this transparent fallback themselves. If you're a Redux or ClojureScript type of programmer it might be utterly obvious and even trivial to implement (just add a simple middleware), but sadly not everyone is, and a lot of the offline logic would have to be implemented everywhere in your codebase. A service worker lets you do it all in one place.
It's a toss-up whether to use localStorage or a service worker if you could viably do either. Blanket logic over all your HTTP calls would be easier in a service worker, and more customized logic would be easier in localStorage, I'm guessing.
Re: JSC loves ES6
#110Earlier quoted context omitted.
I'm pretty sure Safari's features are intentionally crippled to keep their app ecosystem safe. See: web notifications.
Safari supports Web Notifications: http://caniuse.com/#feat=notifications 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!