[webphone-discuss] Update to Angular 5; ServiceWorker needs backend support

  • From: Emil Kroymann <emil.kroymann@xxxxxxxxx>
  • To: "webphone-discuss@xxxxxxxxxxxxx" <webphone-discuss@xxxxxxxxxxxxx>, Marcos Gutierrez <gmarcos87@xxxxxxxxx>
  • Date: Thu, 01 Mar 2018 14:15:15 +0000

Hi list, hi Marcos,

I started updating webph.one to Angular 5. My work in progress can be
viewed at github.com:ekroymann/webph.one.git.

I started with following the instructions at
https://angular-update-guide.firebaseapp.com/w. This is mostly done. There
are some new optional features, which we might want to start using. I did
not get into this yet.

It seems, that the material design dependencies still need to be upgraded,
since when compiling I get warnings about incompatibility.

However, the main problem is the service worker used for push. The previous
implementation relied on extending @angular/service-worker@^1.0.0-beta.16,
a pretty old version as we can see. This version is not compatible anymore
with Angular 5. The new version of @angular/service-worker has a completely
different interface and also does not allow extension anymore. The
extension of the previous version implemented receiving the push
notification and displaying a notification to the user. The new version of
@angular/service-worker comes with a generic service worker, that has built
in support for receiving push notfications and displaying notifications to
the user.

BUT: this relies on the backend sending a notification payload to be
displayed as is in the push notification.

We now have two options: either implementing the ServiceWorker completely
our selves and not using @angular/service-worker, or changing the backend
to include the notification payload in the push notifications.

I can work on this, but I wanted to know what is the preferred way to go
forward. I think, when changing the backends, we will have some problems
with testing, since we need a new version of the backend deployed
somewhere, along with the old version of the backend for the previous
versions of the app.

What is your opinion?

Cheers!
Emil

Other related posts: