This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
gatsby-plugin-offline: About options of merge behaviour of workboxConfig.runtimeCaching. (Optios of runtimeCachingMergeStrategy) #29407
Labels
type: bug
An issue or pull request relating to a bug in Gatsby
Description
I'm using gatsby-plugin-offline and I was confused by the merge behavior at first.
I'm not going to write into what I was confused about, because it's the same thing that is talked about in this issue.
#28289
What do you think about incorporating the content of "Proposal A" proposed in this issue (issues/28289) to improve the usability of gatsby-plugin-offline?
I think it will improve the usability of the plugin because it will give users more options without changing the existing behavior.
This is what Proposal A is about.
(The content of issues/28289 is quoted here.)
Give the user an option where one can define how workboxConfig.runtimeCaching should be merged (e.g. "merge" (current behaviour), "replace", or "append" (maybe even "prepend")) + exporting the default handlers object from the module, so that user can require it and doesn't have to copy the code into his own config.
Usages would the look like:
Append a custom handler
Result:
Defining your own handlers
Result:
Modifing default handlers
Result:
I think for this approach, a default value for runtimeCachingMergeStrategy of "append" would be the most intuitive for users. However, a default value of "merge" would preserve the current behaviour
I am trying to create a pull request to add this option.
If you have any comments, please let me know.
@kije I am trying to add an option based on your Proposal A.
Please let me know if you have any comments.
The text was updated successfully, but these errors were encountered: