News for hackers. Stuff that matters.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by walterbell on Sunday January 28, 2018 @12:46PM (#16252274)
In which cases are native still better than PWA?
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by matthewmacleod on Sunday January 28, 2018 @03:15PM (#16253201)
All of them, in my opinion.

I have not encountered a single case where a web app offered a better experience than a native app.

There is a reasonable argument that it's cheaper to develop, allowing support for more platforms to be rolled out with less development time. That's the single reason that might be valid.

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by lern_too_spel on Sunday January 28, 2018 @05:30PM (#16253972)
I strongly prefer the Twitter PWA to the Twitter app. It uses only 279 KB storage on my phone. When Firefox 58 finishes rolling out, I'll play around with using web extensions to customize the app, which is something that will likely never be possible with a native app.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by ergothus on Monday January 29, 2018 @03:38AM (#16256211)
Also the case where you have lots if transient users. Far better to have a first-rmtime visitor experience s mobile-friendly webpage that can act as an app than to throw a "download our app" message at them.

For companies with more reliable visitors, Native definitely has an edge in options, but if a company is trying to build feature and experience parity across platforms, much if that edge is dulled.

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by atcole on Sunday January 28, 2018 @12:51PM (#16252304)
In cases similar to desktops with electron vs. native (although with different requirements) where either you need access to significant native features that are not supported in the browser, or if your app is process intensive, i.e. graphics heavy games.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by majewsky on Sunday January 28, 2018 @01:14PM (#16252429)
The analogy to Electron makes me wonder if a possible mass migration to PWAs will make the experience on already-slow low-end phones even more atrocious.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by nfRfqX5n on Sunday January 28, 2018 @01:52PM (#16252707)
it would be the opposite actually, since you don't have to wrap the app in a heavy bundle. avg iOS app size is like 30mb. a web app shouldn't even come close.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by kaycebasques on Sunday January 28, 2018 @02:08PM (#16252808)
Extreme example has been Twitter.

Twitter PWA: 600KB

Native Android Twitter: 23.5MB

https://developers.google.com/web/showcase/2017/twitter#lowe...

This has been a huge differentiator in countries where users are sensitive to data consumption, which is why you see many case studies about countries in India, Africa, etc. getting great traction with PWAs.

Disclaimer: I'm on Google Web DevRel team

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by LocutusOfBorges on Sunday January 28, 2018 @02:28PM (#16252945)
Storage space isn't generally the bottleneck on older devices- it's the CPU/RAM. On that count, native apps are usually overwhelmingly preferable.

If these catch on a big way, it'll be catastrophic for more underpowered devices. Modern web pages are already starting to get acutely uncomfortable to use on older iPhones, let alone older Android devices- we aren't yet at the point where performance levels are high enough that we can slap the equivalent of an electron wrapper on everything, smirk at users' devices' vanishing battery life and call it a day.

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by matthewmacleod on Sunday January 28, 2018 @03:17PM (#16253212)
Apples to oranges. The download size of a native app, while important to keep low, will have minimal effect of the actual user experience post-download. Web applications will in almost all cases be a strictly worse user experience.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by Joeri on Sunday January 28, 2018 @01:23PM (#16252487)
If you need to store non-trivial amounts of offline data then native is your only option.
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by Klathmon on Sunday January 28, 2018 @01:52PM (#16252701)
That's not necessarily true, depending on what your definition of "non-trivial" is.

I currently use IndexedDB to store over 500mb of data on phones successfully in a B2B application.

The biggest issue in my experience is access to native "well optimized" APIs. (If I want a video feed, it causes significantly more battery draw to do it in a webview vs a native camera feed).

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by walterbell on Sunday January 28, 2018 @03:39PM (#16253328)
Is that local data safe from 3rd-party javascript?
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by Klathmon on Sunday January 28, 2018 @04:02PM (#16253460)
I'm not entirely sure what you are asking here.

IndexedDB is subject to the same origin policy, so only javascript executed on my domain can access the data for my domain.

Combined with a good Content-security-policy means I'm in control of exactly what code gets to access those resources.

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by walterbell on Sunday January 28, 2018 @04:14PM (#16253541)
Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by Klathmon on Sunday January 28, 2018 @04:26PM (#16253623)
Ah, so in that case yes, it's safe from the extreme majority of XSS, because I use Content-Security-Policy headers.

Any cookies would also be subject to XSS, unless they have the HTTP-Only flag set, in which case the whole point is not worth discussing because JavaScript cannot access it or even know it exists, so it would obviously be useless to any javascript.

Localstorage (and friends like WebSQL and IndexedDB) and Cookies serve different purposes, and having data in IndexedDB is no less "secure" than having it displayed on the page. In both cases an XSS attack means game over.

Re:Progressive web apps are coming to iOS 11.3: Cupertino, w... by kaycebasques on Sunday January 28, 2018 @02:05PM (#16252786)
Not true, many browsers give decent offline data storage quotas. Although one of the benefits of PWAs is that you often reduce your data footprint on your users devices. The extreme canonical example has been Twitter PWA compared to Twitter native.

See link below for per-browser storage quota: https://developers.google.com/web/ilt/pwa/live-data-in-the-s...

Disclaimer: I work on Google Web DevRel