-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
feat(service-worker): add function to provide service worker #48247
Conversation
d5ccc65
to
a6a079a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsaguet thanks for creating this PR, it looks great! I've just left a few comments, please take a look when you get a chance. Thank you.
f885794
to
c8d8ad4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsaguet the changes look good, thanks for addressing the feedback! I'm adding an approval, but since this PR touches public API, it'd require a couple more reviews (you may receive some extra feedback). Thank you.
@alxhub FYI this PR would require your review, since I'm not a part of |
add function `provideServiceWorker` to register a service worker in standalone applications without using `ServiceWorkerModule.register()`
c8d8ad4
to
fb67f8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
Caretaker note: this PR is ready for merge. There are no changes to the underlying ServiceWorker logic, the change is more about exposing a new public API (standalone version of the API to enable ServiceWorker integration). |
This PR was merged into the repository by commit 5e7fc25. |
@jsaguet thanks again for creating this PR and addressing the feedback! 👍 This PR is now merged and will be released as a part of the upcoming v16 in a few weeks. |
…#48247) add function `provideServiceWorker` to register a service worker in standalone applications without using `ServiceWorkerModule.register()` PR Close angular#48247
…#48247) add function `provideServiceWorker` to register a service worker in standalone applications without using `ServiceWorkerModule.register()` PR Close angular#48247
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. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The only way to register a service worker is by using
ServiceWorkerModule.register()
.For standalone applications, we must use
importProvidersFrom(ServiceWorkerModule.register(...))
.Issue Number: #47793
What is the new behavior?
This PR introduces a function
provideServiceWorker
to replace the call toServiceWorkerModule.register()
and hence avoid usingNgModules
to use service workers when building standalone applications.Does this PR introduce a breaking change?
Other information