Skip to content

Add a function to provide ServiceWorker support without referencing NgModules #47793

Closed

Description

@AndrewKushnir

Which @angular/* package(s) are relevant/related to the feature request?

service-worker

Description

Based on #47754 (comment).

We need to provide a function (like provideServiceWorkerSupport) to replace the ServiceWorkerModule.register call, so that there is no need to import and use NgModule in standalone use-cases.

Activity

  1. added
    featureLabel used to distinguish feature request from other issues
    area: service-workerIssues related to the @angular/service-worker package
    on Oct 17, 2022
  2. modified the milestone: Backlog on Oct 17, 2022
  3. changed the title [-]Add a function to avoid the need to use ServiceWorkerModule (for standalone use-cases)[/-] [+]Add a function to provide ServiceWorker support without referencing NgModules[/+] on Oct 17, 2022
  4. MaximSagan commented on Oct 18, 2022

    @MaximSagan

    Would this function be equivalent to the following?

    importProvidersFrom(ServiceWorkerModule.register(...))
  5. angular-robot commented on Oct 18, 2022

    @angular-robot
    Contributor

    This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

    You can find more details about the feature request process in our documentation.

  6. AndrewKushnir commented on Oct 18, 2022

    @AndrewKushnir
    ContributorAuthor

    @MaximSagan yes, it would be equivalent to the importProvidersFrom(ServiceWorkerModule.register(...)) call and just return the set of providers similar to the one that is returned by the ServiceWorkerModule.register call.

  7. DibyodyutiMondal commented on Mar 19, 2023

    @DibyodyutiMondal

    Is it not possible to have an overload that allows us to provide a custom url for the service-worker?

    That would allow us to use something else (like workbox) to write our own service worker and use that with angular.

  8. AndrewKushnir commented on Mar 19, 2023

    @AndrewKushnir
    ContributorAuthor

    @DibyodyutiMondal the APIs provide a way to define a script location (see https://next.angular.io/api/service-worker/provideServiceWorker). If this is not sufficient, feel free to open a feature request in the Issue tracker.

    I'm going to close this ticket, since the PR that addresses it was merged (#48247).

  9. angular-automatic-lock-bot commented on Apr 19, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: service-workerIssues related to the @angular/service-worker packagecross-cutting: standaloneIssues related to the NgModule-less worldfeatureLabel used to distinguish feature request from other issuesfeature: in backlogFeature request for which voting has completed and is now in the backlog

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions