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

Consider using @angular/service-worker and ng-pwa-tools #68

Open
Splaktar opened this issue May 23, 2017 · 9 comments
Open

Consider using @angular/service-worker and ng-pwa-tools #68

Splaktar opened this issue May 23, 2017 · 9 comments

Comments

@Splaktar
Copy link

This project is using sw-precache instead of the latest @angular/service-worker and ng-pwa-tools.

At Google I/O last week, they announced that https://github.com/GoogleChrome/workbox would be the preferred option over sw-precache going forward.

However, Angular seems to be creating a better integrated SW and PWA story using the tools mentioned above. That said, it would be interesting to see if these tools actually reduce the size of the config and improve performance or load time.

@webmaxru
Copy link

I have the documentation in a form of workshop currently: https://bit.ly/pwa-angularsummit-2017
Will be happy to contribute

@webmaxru
Copy link

webmaxru commented May 23, 2017

Unfortunately, there is no way to go for simplest default option to set up NGSW (to use serviceWorker: true + Angular CLI), because CLI was ejected, so I'm going for ng-pwa-tools one.

@housseindjirdeh
Copy link
Owner

@Splaktar Thank you so much for logging this, I've been meaning to set up an issue to use Angular's built in tools instead of sw-precache

@webmaxru <3 thank you!! Yep I decided to eject in order to modify the build output so we can't unfortunately rely on setting serviceWorker: true. Let me know how setting up ng-pwa-tools goes and don't hesitate to let me know if I can help in anyway.

@webmaxru
Copy link

I wrote a special notice on ng-pwa-tools compared to serviceWorker: true: https://docs.google.com/document/d/1F0e0ROaZUnTFftmC0XovpREHWHjcXa4CggiFlmifjhw/edit#heading=h.yoinubqorb1g

For now I'm struggling with ts-node part of manifest generation.

@Splaktar
Copy link
Author

@webmaxru very helpful, thank you. There is indeed quite a bit of confusion and the presentation didn't do enough to mention how experimental ng-pwa-tools is at this point.

@housseindjirdeh
Copy link
Owner

Agreed that is extremely helpful @webmaxru <3 Thank you for taking the time to look into the tools deeper and explaining it clearly!

@housseindjirdeh
Copy link
Owner

@webmaxru although we can't simply use serviceWorker: true since this is ejected, could we be able to leverage AngularServiceWorkerPlugin to create a ngsw-manifest.json file on the fly with all the compiled assets? Just throwing ideas around but I think that might be a viable solution 🤔

@Splaktar
Copy link
Author

Splaktar commented Jun 7, 2017

ng-pwa-tools doesn't seem like an option for this project since it's using SCSS and that's not supported by those tools yet: alxhub/io17#8

I haven't tried the AngularServiceWorkerPlugin for Webpack yet, but it looks promising.

@alfredoperez
Copy link

I created an application using ng-PWA-tools, most of the code from @housseindjirdeh and setting up gulp to do some performance adjustments; since I didn't eject the angular-cli.

Can all of you take a look and tell me how I can improve it?

https://www.webpagetest.org/result/170710_YC_e36dbf524b1105e6a05b9c7b90d20668/
https://github.com/alfredoperez/ngx-hn

@jeffbcross

  • I tried to put the async and defer, but it was causing intermittent bad scores on Lighthouse.
  • How can I remove the pollyfills file if I am still using angular cli?
  • Do you have a recommendation on how should I concat all js files and update HTML after ng deploy has executed?

Any help is appreciated!

My goal is to make it faster using some of the techniques other apps used, like Firebase functions, compression, server rendering, while still keeping the angular cli intact.

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

4 participants