Simplify snippets.setLibrary
Background
The ewe.snippets.setLibrary()
function acts as a way for us to pass information from abp-snippets on to the SDK. The way this currently happens is by abp-snippets exposing the two pieces of code as well as the list of snippets to the product, which then passes them as separate arguments via ewe.snippets.setLibrary()
to the SDK.
Unfortunately, this means that the product code has to change whenever either abp-snippets or webext-sdk decide to change that interface (e.g. pass more/less information, pass information in a different format), even though it shouldn't need to, if all it does is pass the information along without changing or looking into it.
Therefore we should simplify this interface between the two dependencies to avoid exposing any unnecessary implementation details between abp-snippets and webext-sdk to the product.
Use case
We want to avoid unnecessary changes to product code, when the interface between abp-snippets and webext-sdk changes.
What to change
Instead of expecting three separate arguments, the ewe.snippets.setLibrary()
function should expect a single object, which must be the same object that abp-snippets provides (see related suggestion in abp-snippets dependency update).