Closed dwickern closed 1 year ago
I think it is a good suggestion, but I suspect that something will not work (such as the name
option) - so we will need a good test suite to cover the use cases
I suspect that something will not work
I do not get what's you mean by name
option would not works?
The name
doesn't matter if it is encapsulated
or not. It will be pushed to the registered list
and plugin chain
in any case.
Prerequisites
🚀 Feature Proposal
Introduce an option
encapsulate?: boolean
. Defaults tofalse
. When set totrue
, keep the plugin encapsulated.Motivation
fastify-plugin
currently makes all plugins accessible by settingskip-override
. It would be nice to have an option to keep it encapsulated, so you can set a plugin's name, metadata, etc without affecting the plugin's scope.Would you consider a PR for this?
Example