GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — feat(aio): Convert AIO to use the new Service Worker 5.0.0. by alxhub · Pull Request #19795 · angular/angular Conversation
Member
AIO is currently using a beta version of @angular/service-worker.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gkalpak
reviewed
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nit: Update event --> Activation event
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will the ServiceWorker still be registered on production only?
(How does it know which environment it is in?)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The module is only added if environment.production is set.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will that work fine if the SW support doesn't exist at runtime (e.g. ios)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, the module itself does feature detection to decide whether to register the SW.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be https too?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
How does the new ServiceWorker handle routing? (For reference this was our previous config.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, it is possible to follow the previous config more closely (if not exactly) wrt to what gets cached and when.
Have you intentionally deviated from it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, couldn't you use assets of the CLI?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The SW script has to be registered at the root of the page's origin, it can't come from a subdirectory.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do you mean installMode?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd move this block with fonts to a separate group, because it will not follow prefetch rule anyway
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's conceptually part of the site.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
My IDE says we have to add import 'rxjs/add/operator/do';
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do(ne).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This will be a really useful 'real world' example once it gets to production!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Need to rebase to master to pick up 6b74883 and then update this to 5.0.0. It probably also worth using the Angular CLI 1.6.0-beta.0 release that supports Angular Service Worker.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@alxhub can you please resurrect this PR and get it into a mergable state? thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
fb0cbb6 to
35707ab
Compare
|
@IgorMinar PTAL. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about the impact on ergonomics, let's discuss how we can resolve that - I'm afraid that this will require an API change/addition unless you have other ideas. Otherwise this looks good after the nitpicks are resolved.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
can't you update to cli@next and use the new build integration?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, I could. But I don't want to make more changes to AIO's build system than I need to.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
FWIW, we should soon upgrade to the latest-ish cli in #18428. So, maybe after that is merged you can use the build integration.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
FWIW, we are now on [email protected].
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
odd.. why the change to polyfills size?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No idea - it was failing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It couldn't be failing for a 2B diff 😕
(FWIW, I think the polyfills size has been 37070 for a while, but it wasn't updated in the limits, since it is a small changed - much lower than 1%).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
remove
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's not fixed. Did you forget to push the change?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd expect the main size to decrease. Isn't that the case or is it less than 1% so the size check in CI doesn't fail?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean. It's probably less than 1%, this doesn't change much code.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this is a bit odd, because it means that now you have to conditionally or optionally inject the ngsw services which makes the application code not very ergonomic.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will fix that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
ouch. that's ugly. can we do better? either inject it optionally, or even better always register the providers and inject them, but if we are on browser without SW support or in Dev mode, then make the services inert.. or something like that. We should really rethink this, because the current ergonomics are bad. I believe that this is what Stephen was pointing out as well...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will that work fine if the SW support doesn't exist at runtime (e.g. ios)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
please rename this to "app-shell"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
there are actually two docs content groups - the ones that are available offline, and those that are lazy downloaded.
The offline docs include all marketing pages and images under generated/marketing/ I believe - check what the current site is fetching: https://angular.io/ngsw-manifest.json
The the remaining docs and assets should be downloaded on as needed basis. Your proposal changes the update behavior (compared to current angular.io) - I'm fine experimenting with the prefetch mode. We'll see how well this user experience works.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
As discussed, the docs group has been moved to prefetch.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It couldn't be failing for a 2B diff 😕
(FWIW, I think the polyfills size has been 37070 for a while, but it wasn't updated in the limits, since it is a small changed - much lower than 1%).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent spacing inside {...}.
I don't like the whitespace either, but... ¯\_(ツ)_/¯
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Did you mean "Not fixed"? 😁
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
IIRC, we added this to improve TTI or something.
Is this now handled by the ServiceWorkerModule internally?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Exactly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7e7d935 to
9d4d9d4
Compare
|
You can preview 1d82ed3 at https://pr19795-1d82ed3.ngbuilds.io/. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You can preview 1896fa8 at https://pr19795-1896fa8.ngbuilds.io/. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Note to caretaker: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
`%%DEPLOYMENT_HOST%%` has been assumed to be the host prefix for sitemap URLs since bf29936, but afaict this was never the case.
AIO is currently using a beta version of @angular/service-worker. Since that was implemented, the SW has been rewritten and released as part of Angular 5.0.0. This commit updates AIO to use the latest implementation, with an appropriate configuration file that caches the various AIO assets in useful ways.
…vkit/build-angular to 0.7.0-rc.3
The is a bug in versions 0.6.8+ that breaks when trying to use Jasmine's mock clock. Related to angular/angular-cli#11626.
This allows URLs to be passed through to the server (where they are properly redirected), instead of serving `index.html` from the SW. Known issue: `/docs/` will be passed through to the server. `/docs` (without the trailing slash) will be correctly treated as a navigation URL and handled by the SW. We don't link to `/docs/` from within the app, but if there are external links to `/docs/` they will require a round-trip to the server and will not work in offline mode.
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You can preview 0832d58 at https://pr19795-0832d58.ngbuilds.io/. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.