Skip to content
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

pluginLoadType: "chain" not working #7730

Closed
Axiloom opened this issue Jan 2, 2022 · 2 comments · Fixed by #7753
Closed

pluginLoadType: "chain" not working #7730

Axiloom opened this issue Jan 2, 2022 · 2 comments · Fixed by #7753

Comments

@Axiloom
Copy link
Contributor

Axiloom commented Jan 2, 2022

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Version: 96.0.4664.110
  • Method of installation: dist assets
  • Swagger-UI version: 4.1.3
  • Swagger/OpenAPI version: OpenAPI 3.0

Swagger-UI configuration options:

const ui = SwaggerUIBundle({
    url: baseRootUrl + "/test/openapi.json",
    dom_id: '#swagger-ui',
    docExpansion: 'none',
    tagsSorter: 'alpha',
    operationsSorter: 'alpha',
    deepLinking: true,
    pluginsOptions: {pluginLoadType: "chain"},
    presets: [
        SwaggerUIBundle.presets.apis,
        SwaggerUIStandalonePreset
    ],
    plugins: [
        CollapsibleInfoPlugin,
        ExtendedInfoPlugin
    ],
    layout: "StandaloneLayout"
});

Screenshots

Screen Shot 2022-01-12 at 3 19 47 PM

How can we help?

When I have pluginsOptions set to pluginsOptions: {pluginLoadType: "legacy"}, the error above does not display, but only one of my plugins works (both my plugins wrap the same component; info). I want to be able to chain load these plugins, but can't seem to do it

@Axiloom
Copy link
Contributor Author

Axiloom commented Jan 13, 2022

I'm have a lot of trouble testing this change. The exception is no longer thrown, however I haven't been able to compile the code with two of the same plugins yet.

I created a simple plugin based on the example here and added it to src/core/plugins. I also added the plugin to the plugins object in src/core/index.js:90, but when I start the dev server, the plugin is never loaded. This happens regardless of my change.

I also tried adding the plugin to dev-helpers/index.html:51, and once again no plugins load. Could I get some guidance on how to actually load plugins that will show when running npm run dev?

@char0n
Copy link
Member

char0n commented Jan 26, 2022

Right, thanks for pointing this out. The problem is in:

import * as configsWrapActions from "./configs-wrap-actions"

This creates immutable objects which cannot be mutated by our plugin system.

char0n pushed a commit that referenced this issue Jan 26, 2022
Co-authored-by: John Bednarczyk <john.bednarczyk@singlewire.com>
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>

Refs #7730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants