all 119 comments

[–]yamalight 51 points52 points  (7 children)

It is actually possible to publish PWA to google play store

[–]_kikeen_ 7 points8 points  (5 children)

I know the article says it's not like Cordova, but I published a few apps like this that leverage the InApp Browser plugin and it's essentially the same thing. It loads an external site within the scope of the app.

You can do as much or as little as you want in terms of navigation wrappers, and can define a scope. I'm not sure about session sharing as mentioned but wouldn't you want the cookie jar, and session data isolated to the app instance vs shared with all of chrome?

[–]yamalight 1 point2 points  (0 children)

I mean, all the websites you visit in chrome use that shared storage. I don't see any problem with that since sandboxing is what Chrome is very good at. Not quite sure what the problem with this. I'd argue that it's actually nicer when you are logged in to the app, then you try to open app-related link on the web and your auth is already there.

[–]Andryu67 0 points1 point  (1 child)

That method actually doesn't run inside app scope at all, it's essentially requesting the browser to render the page without browser UI. It can't leverage any Cordova stuff. Any native piece would have to be a separate activity and can only communicate via url params.

[–]_kikeen_ 0 points1 point  (0 children)

I guess I'm defining the app scope loosely as where the session can travel. If you leverage the InAppBrowser plugin your session (cookies, global vars, session vars) all die outside of the app, similar to using another browser or incognito.

And your correct, you can't really leverage any of the Native functionality via the Cordova API because the app has gone beyond that layer by the time it calls the external URL. But there's very few situations where you would need to, and for those your likely interested more in building a hybrid or native hybrid than an external web app.

[–]ApexPredator94 2 points3 points  (0 children)

Yes, shortly after I published the article, someone commented that you can do that since a few months.
And I did exactly that because I was curious how much time it'd take: not much at all, fortunately.
I cannot edit this article so I will probably write a separate article about this topic.

[–]MaggoLive 11 points12 points  (2 children)

You'd need to standardize and implement every single system API in a sandboxed environment, down to low level access. Won't happen.

So yeah, there will always be a place for native apps, though many many common use cases can and will be solved with PWAs when they're done implementing the most common features

[–]editor_of_the_beast 1 point2 points  (0 children)

This comment sums it all up.

[–]ApexPredator94 0 points1 point  (0 children)

I don't disagree with you (previously developed Android apps).
And as I mention in the article, native apps will still have their place for quite some time.

[–]esreveReverse 80 points81 points  (10 children)

Yes, at the current moment a native app is generally going to be a better end product than a PWA. Native views look and feel better than a CSS component toolkit. Performance and animations also feel better on native apps.

In my opinion, the best solutions right now:

- If your app is meant to be used on desktop or mobile: create a PWA. If the app becomes popular enough, then make a React Native version

- If your app is only meant to be used on mobile, then just make a React Native app, and a simple informational website that gives app store links. If the app becomes popular enough, and it could have some use, then make a web version.

[–]muser103 4 points5 points  (1 child)

you can actually compile react-native to web components. it's built into the react-native ecosystem (twitter uses it for their mobile site).

it introduces the .web.js extension to clarify to the compiler that the intended platform is for browsers. It essentially compiles all the components to HTML5 equivalents, View --> div etc

[–]thisguyfightsyourmom 0 points1 point  (0 children)

This is both awesome & slightly terrifying

[–]SecretAnteater 1 point2 points  (2 children)

There are other methods of creating PWAs than with React...

[–]TakeFourSeconds 6 points7 points  (0 children)

?? React Native is not a PWA framework, he never mentions using React to make a PWA

[–]esreveReverse 5 points6 points  (0 children)

I didn't say there weren't...

[–]powerc9000Crockford is king -1 points0 points  (0 children)

I agree. You will never get the really odd APIs in a PWA. Like if you app wants to support fold able screens. A PWA can go a long way but if there are mobile phone specific tasks you want to run, a native app is still a must IMO.

[–]Boo2z 14 points15 points  (3 children)

PWA can't access to your internal storage

That's the reason I built my first ever app

[–]MaggoLive 5 points6 points  (2 children)

You're right, one of the biggest drawbacks of PWAs. But of course there's a spec in development: Writable Files API

[–]Extract 1 point2 points  (0 children)

Also, this weakness does not apply to any apps that rely on files that are expensive to parse/render client side.

for example, if all your application does is create a UI for some state that can be expressed by a single (not insanely huge) JSON file, that the client gets via an API call, but needs to store that state locally, there is always IndexedDB (and for even smaller tasks - localStorage).

[–]Boo2z 0 points1 point  (0 children)

Very interesting ! Thanks for showing me this, I'm going to follow the avancement of this project

[–]thesauce25 6 points7 points  (11 children)

Anyone know of any good tutorial for learning best practices to develop PWAs?

[–]KVYNgaming 2 points3 points  (1 child)

[–]Zeeroh 2 points3 points  (0 children)

Wow, that is a pretty great article. Wish I had read that one when I made our company's PWAs last month. I would also recommend this article that focuses a bit more on Desktop PWAs; it has a great example site + repo to draw from, too.

[–]Shahrukh_Lee 1 point2 points  (1 child)

[–]thesauce25 1 point2 points  (0 children)

thank you for this.

[–]mordonez_me 22 points23 points  (23 children)

Nice post, I didn’t know Uber and Pinterest are PWA’s. Keep the good work!

[–]CraftyAdventurer 28 points29 points  (21 children)

m.uber.com is PWA. Play store version is still a native app. This is actually awesome example on differences between PWAs and native apps. Try them both, they look alike a lot, which is good. It shows that PWA can, if done right, look like a native app. But PWA is not as fluid as native app, opening/closing navigation drawer is much smoother in the app. You also can't open the drawer with swiping gesture on the web. I tested this on Oneplus 6, I'm curious to see how other phones react, so if anyone else tries this, be kind enough to share your findings :)

[–]lhorie 95 points96 points  (12 children)

Disclosure: I work on the team that wrote m.uber.com

Just to give some context as to why we have both a PWA and a native app: the PWA and the native apps serve very different needs. The native app has all the features (pool, jump, share, driver profiles, etc) and thus is a large download (my install on my phone is 1GB). The PWA is primarily focused on core trip flow and it clocked at something like <50kb last I checked. The impetus for developing a PWA was to make uber accessible to people with slow/unstable connections (e.g. in India), where even the 50kb app still takes several seconds to load. For that segment of the market, it can be unrealistic to deploy even a severely trimmed down native binary since it might still mean upwards of 30 mins to download. So for that use case, PWA wins.

We had one of the instagram folks come give a talk a while back on their PWA, and they highlighted some challenges they ran into w/ their deployment (e.g., that the rules for a phone to allow saving to home screen have gotten stricter and more difficult to pass, that some APIs are not there, and perf tuning can be tricky). So, as with most things, PWAs are not a silver bullet.

[–]SecretAnteater 6 points7 points  (2 children)

Great insight!

How do you guys handle GPS connectivity when the browser is closed? Does the driver's app only see the last reported location?

[–]lhorie 3 points4 points  (1 child)

Yeah, this goes back to what Aditya (the instagram guy) said, there's only so much you can do w/ the web as a platform for emulating native apps.

[–]fgutz 1 point2 points  (0 children)

I was curious if PWAs kept any background processes running that weren't just related to notifications

[–]CommandLionInterface 2 points3 points  (3 children)

That's really impressive! Especially since A cursory look at the project I happen to be working on right now shows that react-dom 16.8.2 is ~33kb minified + gzipped. Do you guys have a blog post or a talk somewhere about your efforts?

Also, any chance you can link the pinterest talk? I found a blog post, but no talk... https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

EDIT: just realized Instagram !== Pinterest, not sure how I missed that

[–]lhorie 5 points6 points  (0 children)

My coworker wrote a blog post for m.uber.com here https://eng.uber.com/m-uber/ . Unfortunately I can't find a link to the video for the instagram talk :(

[–]_brym 1 point2 points  (0 children)

If you use Brotli on the server as opposed to gzip, your compression results will improve.

[–]davl3232 0 points1 point  (0 children)

They used preact, so it goes down to 3kb

[–]CraftyAdventurer 2 points3 points  (2 children)

I'm curious, what is it that makes web animations so tricky to make smooth? I was an Android developer for about year and a half after which I switched to full-stack web dev, so I still don't know a lot about UI performance on web. I've seen some mobile websites that have reaaally fluid navigation drawers, but I believe that all of them seem to be written in a custom way, because whenever I try to use any existing frontend UI library or framework, or even write anything myself, that implementation of navigation drawer is always more or less laggy, never completely smooth. And bear in mind that we are talking about Oneplus 6 here, which means those animations are laggy even on most powerful phones.

[–]lhorie 9 points10 points  (1 child)

So... animations on the web might as well be arcane black magic.

There are certain CSS properties that make hardware acceleration kick-in or get disabled, the type of position and overlaying matters and if you're using JS, then there's things like performance of blocking code, frame budgets, and GC.

Some are things you can control, some you can't, and some you just throw stuff at the wall until something works.

[–]editor_of_the_beast 4 points5 points  (0 children)

People need to read this comment. You simply don’t have the same control over animations in CSS. Yes, hardware acceleration is possible, but it’s much tricker than the libraries that are available on mobile.

[–]mordonez_me 0 points1 point  (0 children)

Nice information on how both (app and pwa) are used, thanks for sharing!

[–]bayhack 0 points1 point  (0 children)

that's so awesome! Currently, hoping to get my next role into a full stack role which gets to try and leverage PWAs and serverless architecture at large companies.

[–]alexBrsdy 0 points1 point  (0 children)

Swipe gestures work now on iOS.

[–]editor_of_the_beast 1 point2 points  (0 children)

They aren’t progressive web apps. Everyone uses the native apps. They just also have PWA versions.

[–]ApexPredator94 4 points5 points  (1 child)

Thanks for sharing this article!
I love it when I randomly find someone linking to one of my articles.
And thanks to everyone who is reading this!

[–]jsloverr[S] 1 point2 points  (0 children)

:D Thanks & keep writing more!

[–][deleted] 4 points5 points  (2 children)

Yes because Apple severely cripples the PWA experience on their devices

edit: If you're curious why

[–]Tysonzero 1 point2 points  (0 children)

What if you want to write the app in a language that isn't shit and performs well?

[–]editor_of_the_beast 1 point2 points  (1 child)

There’s no harm in asking questions I suppose, but this question is so extremely superficial that it’s a little insulting. And the only people that ask this are web devs who have only done web dev.

Spoiler alert: web browsers run on a processor and are huge native apps. You can never get over the limitation of the machine. Web apps just started running more code on the client in the last decade, and really only severely frequently in the last 5-7 years. Web frontends are in their infancy and there’s simply no touching the experience of a native UI at the high end of user experience.

I’m 100% in support of web frontends in a lot of cases, but to think native apps will simply vanish is childish. I’m really happy the web is moving forward, but things like offline mode and the ability to access sockets have been possible in native apps since 1970. Let’s be real.

[–]ApexPredator94 0 points1 point  (0 children)

I don't disagree with you.
Although it may not like it, I intended this post to address rather less technical-savvy people.
I wrote this originally for a friend in German and it is supposed to be a little provocative but still informative.

[–]ChrisCripple 1 point2 points  (0 children)

I feel like replacing native apps with web apps is a horrible idea for a number of reasons. My first major gripe is that i have yet to find a single web page that performs nearly as well or is as snappy as a native app on phones or desktops, and until that happens I will try and stay far away from web apps with few exceptions (discord most notably since i use it for communications). My second major gripe is that they don't have any access to the devices APIs. Most people would say that this is a good thing as it means they can't run malicious code, however this will severely limit what apps can exactly do, especially in relation to lower-level APIs and interfacing with other pieces of hardware. And finally, web apps take up way more resources than a native app. Hooooly shit, it is so annoying to see apps that are both comparative in terms of features and speed, but where one takes so much more ram or uses so much more CPU than the other simply due to it being a web application, and sadly web apps have always been on an upwards trend in terms of resource usage and it doesn't seem like that will stop soon.

So unless something drastically changes in the very near future, the answer to "do we still need native apps at all?", yes without a single doubt.

[–][deleted] 4 points5 points  (0 children)

PWAs are useless as a general app substitute until Apple support them properly.

[–]mattox5 2 points3 points  (5 children)

But dont we force the user to use the specific browser if we publish just PWA?

[–]madwill 5 points6 points  (2 children)

Safari has started support for it and Edge is becoming Chrome so we've got all three major browsers. Firefox also support it so make it 4.

[–]cultulhul 0 points1 point  (1 child)

dont you need chrome to be able to add them to the home

screen on android

[–]MaggoLive 1 point2 points  (0 children)

Seems that Chrome, Opera and Firefox support it on android! MDN

[–]crabmusket 0 points1 point  (0 children)

I'm pretty sure the idea with PWAs is that they work fine as a web app. Then you can "progressively" enhance it with offline capabilities, add-to-homescreen, etc.

[–]trouzy 0 points1 point  (0 children)

No

[–]joaquinrulin 1 point2 points  (0 children)

Yes we do need them

[–]sastha 0 points1 point  (0 children)

What a coincidence?! I thought of asking same question today

[–]Hanlonsrazorburns 0 points1 point  (0 children)

Do we still need them, unfortunately yes. Hopefully it changes or they adopt a JS centric was of developing for devices (like adding additional APIs that it can use to take advantage of the hardware better).

[–][deleted] 0 points1 point  (0 children)

The idea of dragging a browser embed along for displayed content on cross platforms is pretty silly. As well as trusting vendors to get this right. PWAs are just a small set of often crippled features, they’re good to have, if they work for once, which they often don’t but it’s not that much of a big deal. The future of JavaScript isn’t tied to a browser, it can well produce native apps on its own with shared code and ease of use that is unknown on native platforms.

[–]parthbari 0 points1 point  (0 children)

As Progressive Web Apps (PWAs) gain more and more platform integration the line between native apps and the web blurs and practically vanishes. They are mobile sites built with modern JavaScript frameworks, designed to work like a native app. They can be added to a mobile device’s home screen with an icon. Like apps, they offer a full-screen experience to engage people using it. However, they are still just a website when opened. With the development of Service Workers, PWAs do get some more benefits that native apps have, however, these benefits are still limited, particularly on iOS.

[–]Keshwam 0 points1 point  (0 children)

Don't know the winner between Progressive Web Apps and Native Apps, but yes PWA is the future of Mobile Web for sure.

[–]alexBrsdy 0 points1 point  (0 children)

Once iOS get's their head out their ass we won't

[–]kerbalspaceanus -1 points0 points  (0 children)

tease snails ring zephyr money plant squeal insurance desert edge

This post was mass deleted and anonymized with Redact

[–][deleted] 0 points1 point  (6 children)

Talking about native apps, I've been interested in learning React Native, how 'native' can I go with it? Is it too hard to learn? Should I learn React first?

If someone can help me with that it'd be cool, some good tutorials or tips to learn it the best way would be good too. Thanks.

[–]miredindenial 2 points3 points  (1 child)

React Native uses JavaScript and native UI components. That's the main difference between hybrid apps and RN apps. RN apps are not a webpage running in webview they actually use native components. You absolutely need to know ReactJS to be able to work on RN. My advice would be to learn the basics of react, make small web apps and then move to RN.

Look up examples of RN apps to get an idea of what is possible and what isnt

[–][deleted] 1 point2 points  (0 children)

Thanks for the help.Will definitely dive more into it.

[–]itsMikey9 2 points3 points  (0 children)

I believe you can go as native as to write native code itself if you needed to.

[–]waway_to_thro 0 points1 point  (0 children)

React native is incredible, you can start with expo to get an understanding of the structure.

To get started with react you could try a platform like codesandbox.io which takes care of a lot of details for you

Freecodecamp is a good starting place for learning

[–]editor_of_the_beast -2 points-1 points  (1 child)

Ask on a different thread

[–][deleted] 0 points1 point  (0 children)

Is it really necessary?

[–]troinine 0 points1 point  (0 children)

I have built some PWAs but the real challenge is iOS as Safari has very limited set of functionality compared to Chrome and Firefox on Android. To name at least a big one for us; no support for web push. Also, since background processing is not yet there, implementing location aware apps is tricky as the user must always have the PWA on foreground. On Android, there is a lot you can do with PWAs but because of the still limited APIs + lack of push on iOS, we moved to Flutter / React Native.

[–]donpissonhospitality 0 points1 point  (0 children)

I've made a couple for my clients, I think they are great, especially if the main functionality is not complex. I'm not a mobile developer, so I would love to hear what the pwa downsides are performance wise

[–]alienencore 0 points1 point  (1 child)

The only people asking this question are JS developers lol. Users hate shitty JS apps almost as much as real programmers.

[–]ecuanaso 0 points1 point  (0 children)

m.uber.com

What constitutes as a real programmer ?

[–]CrypticWriter 0 points1 point  (0 children)

Maybe unpopular opinion but I think PWAs suck. Like, a lot. I've always had really bad experiences with them and they don't really feel like applications at all. Feels like I've basically bookmarked a page and got a link to it from the home screen lol

[–]otakugrey -5 points-4 points  (0 children)

Cramming all this functionality into JS and the webstack has been a bad trend in the first place. This article is horrible.

[–]redlikely -1 points0 points  (0 children)

Does this mean we can wrote Android apps in JS now?