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

Switched to WorkboxWebpackPlugin.InjectManifest from WorkboxWebpackPlugin.GenerateSW #8011

Closed
wants to merge 2 commits into from

Conversation

MOZGIII
Copy link

@MOZGIII MOZGIII commented Nov 21, 2019

Implementation for #7966

@facebook-github-bot
Copy link

Hi MOZGIII! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@MOZGIII
Copy link
Author

MOZGIII commented Nov 21, 2019

Oh well, I guess It's quite a bit more difficult than I thought to do right.

@neolefty
Copy link

As a simplistic alternative, I've found this to work to exclude API endpoints from caching:

in package.json, add a sed step to build:

"build": "react-scripts build && sed -i -r -f serviceworker.sed build/service-worker.js"

Where serviceworker.sed contains a regex to insert /^\/(api|swagger)/, at the start of the blacklist:

# we can even add comments inside the sed file
s/(^.*blacklist\: \[)/\1\/\^\\\/\(api\|swagger\)\/,/

A hack to be sure, and I doubt it works on Windows.

@MOZGIII
Copy link
Author

MOZGIII commented Dec 17, 2019

This looks good. It fits most of my simpler use cases nicely.
However, I started this work on service workers to address a more in-depth use case, and for that, it, unfortunately, won't be enough.

@stale
Copy link

stale bot commented Jan 16, 2020

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jan 16, 2020
@stale
Copy link

stale bot commented Jan 22, 2020

This pull request has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. Thank you for your contribution!

@stale stale bot closed this Jan 22, 2020
@lock lock bot locked and limited conversation to collaborators Jan 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants