Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template for PWA #454

Open
D00mch opened this issue Aug 28, 2019 · 8 comments
Open

Add template for PWA #454

D00mch opened this issue Aug 28, 2019 · 8 comments

Comments

@D00mch
Copy link

D00mch commented Aug 28, 2019

It would be nice to have Progressive web app template.

@yogthos
Copy link
Member

yogthos commented Aug 28, 2019

I'd be open to a PR for this. What would you have in mind specifically for making the progressive template?

@D00mch
Copy link
Author

D00mch commented Aug 29, 2019

I want my web app to run on desktop and mobile devices like native app, offline, with notification support and possibility to distribute it as an anroid .apk. Which is supported by PWA.

To make web project a PWA, you basically need to set up servise worker to get it work offline and add a manifest with icons.

But the devil in the details.

I don't have any experience with js and little experience with cljs, it's a dark forest for me. When I tried to implement PWA with my pet project, I failed. ServiceWorker is saving cache, but the app is not working offline, probably because I haven't cached all the important stuff. I got stuck at this point (commit with worker).

I also implemented the same with clojurscript, but it had problems with servicWorker registration.

May be the PWA will also be a nice feature for you 3rd Web Development with Clojure book.

Ideally I would want to be able to do:
lein new luminus <name> +cljs +reagent +pwa +...

@yogthos
Copy link
Member

yogthos commented Aug 31, 2019

Ah I see, I don't have any experience with PWAs myself either unfortunately. It might be worth checking on Clojurians slack to see if anybody got this working already. And I'll take a look to see if it's something I can add to the book. A +pwa profile seems like a good idea if we get this figured out.

@dijonkitchen
Copy link
Contributor

Maybe a CLJS wrapper around https://github.com/GoogleChrome/workbox ?

@yogthos
Copy link
Member

yogthos commented Sep 14, 2019

Oh I haven't seen workbox before, looks like it would be a good fit.

@D00mch
Copy link
Author

D00mch commented Dec 2, 2019

Good news! There is a library page-renderer that uses GoogleChrome/workbox inside. I was able to pass lighthouse audit (pwa test) which confirmed that my app is a PWA.

Here is the commit with the changes I made.

@yogthos
Copy link
Member

yogthos commented Dec 3, 2019

Nice, that looks really straight forward. Might be best to just add it to the docs then as an example.

@D00mch
Copy link
Author

D00mch commented Dec 3, 2019

Yes, I think docs would be enough. I also created an example project https://github.com/Liverm0r/PWA-clojure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants