feat(wrapComponents): new chain configuration option (#7236)
This commit provides a backward compatible mechanism to chain wrap an individual component multiple times `Chain` mode: allow chaining of plugins on a given component `Legacy` mode: last plugin to wrap a given component will supercede others * chore: Add unit test for wrapComponent wrapping * doc: Add documentation about the new pluginsOptions configuration * doc: Add a sidenote on plugin-api page Co-authored-by: Tim Lai <timothy.lai@gmail.com>
This commit is contained in:
@@ -93,6 +93,13 @@ export default function SwaggerUI(opts) {
|
||||
plugins: [
|
||||
],
|
||||
|
||||
pluginsOptions: {
|
||||
// Behavior during plugin registration. Can be :
|
||||
// - legacy (default) : the current behavior for backward compatibility – last plugin takes precedence over the others
|
||||
// - chain : chain wrapComponents when targeting the same core component
|
||||
pluginLoadType: "legacy"
|
||||
},
|
||||
|
||||
// Initial state
|
||||
initialState: { },
|
||||
|
||||
@@ -118,6 +125,7 @@ export default function SwaggerUI(opts) {
|
||||
configs: constructorConfig.configs
|
||||
},
|
||||
plugins: constructorConfig.presets,
|
||||
pluginsOptions: constructorConfig.pluginsOptions,
|
||||
state: deepExtend({
|
||||
layout: {
|
||||
layout: constructorConfig.layout,
|
||||
|
||||
Reference in New Issue
Block a user