Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
plugins and back compat #212
When we break back compat on levelup all the plugins may or may not break.
A lot of
This works great up and until we change
The core problem is that
It also means that as the ecosystem grows you won't be able to use certain
plugins do not depend on something that can be versioned statically and instead depend on something passed in at run time with a certain interface.
How do you require
I forgot to mention disadvantages of this process
I'm not actually sure whether this is a good idea, but it's an interesting way to avoid breaking plugins with levelup changes.
Just throwing this in... @mikolalysenko's ndarray project is a good example that I think will better avoid the plugin problem. ndarray modules operate on a data object format rather than an instance of ndarray with the APIs attached. So each ndarray module can lock to a specific version of ndarray. ndarray "plugins" will only run into trouble if the format needs to change dramatically. The format is fairly simple though so not likely to happen very often, if at all anymore.
When this happened to me it wasn't because of a breaking change but because of a feature addition, that wasn't supported by modules that were patching levelup.
To prevent this from happening again, we either need to
However I think that this is not levelup's responsibility, as levelup is the lowest-posible-level js api for accessing levelup backends and shouldn't be concerned with those extension needs.
in theory if your module uses sublevel and if the database has been wrapped by the latest version of sublevel by the application user then even if your module uses a really old version of sublevel then new features shouldn't break.
But this raises a good point, I'm not sure how sublevel would be implemented with the seperate functions approach as it would have to monkey patch a leveldown interface or be baked into levelup.