-
Notifications
You must be signed in to change notification settings - Fork 173
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(workbox): New configuration for specifying plugins when configuring a strategy #337
Conversation
The strategy constructor option object can be optional as shown here: https://developers.google.com/web/tools/workbox/modules/workbox-strategies
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
=======================================
Coverage 85.43% 85.43%
=======================================
Files 10 10
Lines 357 357
Branches 108 108
=======================================
Hits 305 305
Misses 48 48
Partials 4 4 Continue to review full report at Codecov.
|
Hi @Yihao-G thanks for efforts on PR i really appreciate it. However it is probably not best way to serialize/genenerate runtime code directly from It is possible to use workboxextensions to inject custom code to generated Shall we directly use plugin and only support subset of json-serializable options? |
@pi0 Done. Let me know if there is anything else that can be improved :) |
Because of the change of the configuration structure, this is a breaking change |
Nice recent refactors @Yihao-G 👍 I have to locally test your changes before merge to also check breaking change possibility. Thanks again ❤️ |
Hi @Yihao-G I have refactored code to a runtime approach to reduce template complexity (1f1b235), merging to refactor/runtime-sw branch to apply this convention for rest of the template. Everything is currently working fine thanks for initiative 👍 |
…ng a strategy (#337) * Initial implementation of #336 * Update types * Fix test The strategy constructor option object can be optional as shown here: https://developers.google.com/web/tools/workbox/modules/workbox-strategies * Fix broken generated sw.js * Remove unused field * Typo fixes * Correct RuntimeCaching type * Added tests * Fix code * Revert "Added tests" partially This reverts commit d467e17 * Do not directly generate runtime code from nuxt.config #337 (comment) * Template formatting and remove unnecessary replace in toCode function * simplify toCode function * refactor: use runtime code instead of codegen Co-authored-by: pooya parsa <pyapar@gmail.com>
Fixes #336