Is 2024 the year of PWA?

According to DHH: “The hallowed promise of web applications being viable and competitive alternatives to native efforts is finally here.

The big breakthru IHHO is the addition of PWA push notifications to Safari.

The primary mission for <DHH’s> contributions toward Rails 8 is now crystal clear: PWA.

Elixir folk WDYT? Is it time to look at PWA?

3 Likes

I am heading in that direction and adopting web components for a framework free client experience and a Phoenix backend to handle events and ship delta state updates without API ceremony and complexity using live_state and Phoenix channels so the backend is basically the same as LiveView responding to events over a websocket which interfaces with my phoenix contexts to fetch and update data but without html rendering, only state delta rendering.

The next step is to add some simple client side routing like vannila router, and then beyond that is both routing and local state caching strategies so the client doesn’t degrade to useless when disconnected using Google workbox..

4 Likes

Been hoping to see push notifications on Safari for a long time, but we’ve seen quite a few articles like this on DT recently:

Will Safari push notifications be independent of Apple or will they have to go through Apple’s servers?


Edit: Looks like they’ll go through APNs as well:

The delivery of remote notifications involves several key components:

  • Your company’s server, known as the provider server
  • Apple Push Notification service (APNs)
  • The user’s device
  • Your app running on the user’s device

Remote notifications begin with your company’s server. You decide which notifications you want to send to your users, and when to send them. When it’s time to send a notification, you generate a request that contains the notification data and a unique identifier for the user’s device. You then forward your request to APNs, which handles the delivery of the notification to the user’s device. Upon receipt of the notification, the operating system on the user’s device handles any user interactions and delivers the notification to your app.

3 Likes

Its a pain that Apple don’t support the ‘beforeinstallprompt’ event, so you have to guide Apple users on how to install the PWA through ‘Share / Add to Home Screen’ with UI you will design yourself that will probably look different on every PWA.

3 Likes

What I am understand from DHH twitted about PWA, is his actually anticipated about Phoenix Live View more powerfull than Rails.

I am choose Elixir with Phoenix than Ruby with Rails is the cost of architecture. Using Elixir with Phoenix is less cost than Ruby with Rails

1 Like

This morning I turned my hobby app into a PWA. I also made a service worker to handle push notifications. All I needed was the MDN docs (e.g. How to make PWAs re-engageable using Notifications and Push - Progressive web apps | MDN) and this lib: GitHub - midarrlabs/web-push-elixir: Simple web push library for Elixir

I am amazed at how easy it now is to do push notifications. No firebase, no pigeon, no apple certs. The only bit of complexity is persisting the “subscriptions” from the service worker on server so they can be associated with the user and used later. Seems like they are still using, e.g. FCM servers, to make this happen but the complexity is now all “under-the-hood”.

PWAs are super cool and rewarding to learn.

14 Likes

This is probably finally enough motivation for me to finish adding auth to my hobby PWA this weekend. Thanks for sharing your experience and some resources!

2 Likes