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

fix(gatsby,gatsby-plugin-offline): register offline plugin when not on preview #30984

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

wardpeet
Copy link
Contributor

Description

Changed the logic in gatsby to filter falsy values from "registerServiceWorker". We check for the length on the array and not which value they return.
With filter(Boolean) we do check if all values are falsy. There is one caveat still that we need to fix in a follow up PR. The code of the service worker that should not be installed will still be present in code as Gatsby api runner is not checking that piece.

Documentation

Related Issues

@wardpeet wardpeet added status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins labels Apr 21, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 21, 2021
@wardpeet wardpeet removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 21, 2021
@wardpeet wardpeet merged commit 17f028d into master Apr 22, 2021
@wardpeet wardpeet deleted the fix/register-service-worker branch April 22, 2021 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants