-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Adding multiple plugins with wrapComponents on the same core component seems broken #7232
Comments
I agree :) In the meantime, can we expect a small fix on this point and the one in the related issue or is it out of scope for now ? |
@DayS I added some comments to your PR #7236. Pending some tweaks, this specific issue can get fixed. I do agree that it is safer to add a config option to change the current default behavior. @mathis-m fyi, I did a quick experiment with both this issue and #7157. The PR associated with this ticket does not address the |
fixed via #7236 |
Hi everybody, The expected behavior described in this issue has always been intended. It shouldn't matter if whether the plugins have been registered via In #7236, the remediation was provided, but unfortunately it also contains hidden bug, where the original components objects is being mutated by the combined plugins because of this line: const dest = pluginOptions.pluginLoadType === "chain" ? toolbox.getComponents() : {} Action: we're gonna revert 516e666 and replace it with non-configurable solution. We're going to fix the mutation bug introduced by the line above. |
Addressed in #9919 |
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition is not relevant for this issue bug here is a sample:
Swagger-UI configuration options:
Describe the bug you're encountering
When multiple plugins are configured with
wrapComponents
entry on the same core component (info
for example), only the last one is applied.I was expected all of them to be applied in a chain pattern. They should end up being embedded according to where the
Original
component is applied.So, in this example I should see both my titles before and after the info content.
Fix
I pinpointed the issue on system.js where plugins are combined.
As
systemExtend()
is called with an empty object fordest
, we can't retrieve the existing components.I was able to fix this issue by replacing
.reduce(systemExtend, {})
with.reduce(systemExtend, toolbox.getComponents())
on system.jsWDYT ?
The text was updated successfully, but these errors were encountered: