Earlier quoted context omitted.
...since you don't know whether there is a new version available on the server or not. To not make the user wait, you show him/her the - potentially - outdated version of your data until a new version is available. It's especially useful in situations where users lack internet connection.
I'm interested in this as well, as I haven't dove into service workers. But I'm still failing to see why you can't pull the local data from local storage and show it, then render the data from the server (should you get new data)?
JSC loves ES6
161–170 of 191 posts
Re: JSC loves ES6
#162Earlier quoted context omitted.
This benchmark is only representative for websites built with lots of new ES6+ features. On general JS performance, Firefox isn't quite that far behind (but still behind to the best of my knowledge).
And that's all fine...in a lab. In the real world, all I have to do to experience Firefox's performance is click "Home" on my Twitter account. More often than not I'll get an alert that "A script has stopped responding [...] Continue / Stop Script," and it will still take 60+ secs to finish refreshing the page. Meanwhile, all Firefox tabs and window instances are frozen.
Re: JSC loves ES6
#163It seems weird to focus so much on es2015 features, when so many of them are polyfillable (not optimal, sure, but still) when there is such uneven support for DOM (and related browser) API features in safari. 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…
I'm pretty sure Safari's features are intentionally crippled to keep their app ecosystem safe. See: web notifications.
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).
Re: JSC loves ES6
#164Earlier quoted context omitted.
To serve that requests from local storage if your device or the server is offline.
Can't this be solved by a library? It seems like you could easily build a facade in front of requests that queried local storage...you would just need to figure out whether the device/server is online or not.
Re: JSC loves ES6
#165Earlier quoted context omitted.
Or why can't this problem be solved with HTTP caching headers and a browser that Does the Right Thing?
I'm pretty sure HTTP caching headers don't provide a guarantee that they will be stored for any length of time at all, the browser is free to empty it at will. They also don't guarantee that all your cached assets will be valid with respect to each other (ie your browser might cache an HTML file but not the content it refers to). Most importantly, though, you can't simply disable HTTP caching when you notice that you…
Using HTTP caching for saying how long online clients should keep a value becomes impossible if you want to tell browsers to store things forever in offline mode. HTTP caching makes no distinction between whether you're online or offline.
Re: JSC loves ES6
#166Earlier quoted context omitted.
“push notifications can reach your users regardless of whether your website or Safari is open“ https://developer.apple.com/library/content/documentation/Ne...
"Registration requires an Apple developer license." Hmm, not the open web I'm familiar with.
Re: JSC loves ES6
#167Earlier quoted context omitted.
I'm interested in this as well, as I haven't dove into service workers. But I'm still failing to see why you can't pull the local data from local storage and show it, then render the data from the server (should you get new data)?
That works fine for your xhr data (and is what I do now), but is idiosyncratic to your library (note that detecting online state, responding to online state changes, etc all add complexity to this seemingly simple module, as does managing cache expiry). You can't do anything about your top level index.html file (or the main js and css assets) though. If the user starts offline the second time they use your app, there…
That said I do understand that avoiding this could be desirable.
Re: JSC loves ES6
#168It seems weird to focus so much on es2015 features, when so many of them are polyfillable (not optimal, sure, but still) when there is such uneven support for DOM (and related browser) API features in safari. 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…
> 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…
Re: JSC loves ES6
#169Earlier quoted context omitted.
> 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 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 :…
Fetch is supported in 10.1 (only 2 years after Firefox and Chromium!) 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.
Re: JSC loves ES6
#170Earlier quoted context omitted.
$400 million looks like a lot until you remember that Apple have $267 billion in cash reserves. The Mozilla Foundation's entire annual revenue isn't even a fifth of a percent of what Apple have just sitting around because they can't find a better use for it. The fact that Mozilla are able to punch even this far above their weight is kind of impressive.
But Mozilla really only has one big thing they make, which is Firefox. Apple's software portfolio on just one of their multiple hardware platforms (let's not forget that they make that hardware, too, including designing their own processors) completely dwarfs Mozilla. I agree with jonas21 - for $400m a year you ought to be able to build an amazing browser.