Re: Service workers

Esteban Maringolo <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAJMgPCLEKtDm0QBsXYNfjZOR7p430+So=LeDXML+SqzVyGKorg@mail.gmail.com>
I used Seaside-REST in the past and it is great to "complement"
existing Seaside behavior or reusing some of the code, but if you were
to build a complete app from scratch maybe Teapot/Tealight
<https://github.com/astares/tealight> is a better fit for this case,
since you remove Seaside's server adaptor "middleware" from the stack.

I don't know whether Seaside's strongest feature (stateful server side
rendering) will be a big plus for PWAs, but I'm interested in your
experience nonetheless, since these kinds of approaches are
commonplace these days and might be useful for particular "sections"
of a full-fledged Seaside app.

As for your particular question you should put a breakpoint/halt at
the different entry points:
* ZnSeasideServerAdaptorDelegate>>handleRequest:
* WAServerAdaptor>>handleRequest:
* WARequestHandler>>handleFiltered:

Or to catch any error during the request:
WAServerAdaptor default server debugMode: true


Regards,

Esteban A. Maringolo

On Thu, Jul 25, 2019 at 11:29 AM Dave <[email protected]> wrote:
>
> Hi guys!!
>
> I'm playing with Seaside-REST to implement a PWA
> (https://en.wikipedia.org/wiki/Progressive_web_applications). I don't really
> know if it is feasible, but I try :-)
>
> The first issue I'm facing is the serviceworker, it seems it does not listen
> for fetch requests and I'm guessing because Seaside or Zinc are doing
> something under the hood.
>
> This is my code to register the service worker
>
> mainJs
>         <get>
>         <produces: 'application/javascript'>
>         ^ 'window.onload = () => {
>   "use strict";
>
>   if ("serviceWorker" in navigator) {
>
> *navigator.serviceWorker.register("MyApp/swJs")*.then(function(registration)
> {
>     console.log("Service Worker registered with scope:",
> registration.scope);
>   }).catch(function(err) {
>     console.log("Service Worker registration failed:", err);
>   });
>   }
> }'
>
>
> And this is the code of the serviceworker
>
> swJs
>         <get>
>         <produces: 'application/javascript'>
>         ^ '/* Serve cached content when offline */
> *self.addEventListener("fetch",* function(e) {
>   console.log("Fetch request for:", e.request.url);
> });'
>
> The serviceworker is successfully registered but I'm expecting a log entry
> every time I point to an url on my domain, unfortunately that doesn't
> happen.
>
> I'm mimicking the code of this example
> https://medium.com/james-johnson/a-simple-progressive-web-app-tutorial-f9708e5f2605
> even if I'm trying to further simplifying it
>
> Can you help me, please?
> Dave
>
>
>
> --
> Sent from: http://forum.world.st/Seaside-General-f86180.html
> _______________________________________________
> seaside mailing list
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.