-
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
Consider re-factoring swagger-ui into a component #777
Comments
thanks, we'll take this into account |
I would like to second thegecko's request, trying to integrate AMD functionality has been a hair puller. |
@swbullis have you been able to implement swagger-ui via AMD/require? If not, I would also like to request this feature. |
The only way we can truly package an app like this is web components. I played with the idea of wrapping this app in a web component in this branch. Unfortunately because SwaggerUI relies of global objects and |
@alycda no I finally opted to just use an iframe. |
I'll echo this desire too. Swagger can't be embedded on a site that uses RequireJS (or any AMD loader), because shred.bundle.js overwrites As far as I know, shred.bundle.js is the only barrier. If only shred would look for an existing AMD loader instead of jamming its own into the page, I like to think everything would suddenly play nicely together. :) |
shred is a dependency of swagger-js. Plan is to remove that dependency. Once it's gone we will make swagger-ui.js a UMD compatible (requirejs and commonjs compatible) file. |
Awesome, great to hear! |
IMO, swagger-ui should be a drop-in component which should behave as a module and have external dependencies, but is currently structured as an application.
This causes issues with baked-in dependencies and the need to distribute the project with copies of third party libraries.
Structuring the project as a module following AMD/CommonJS paradigms and utilising a registry such as bower for third-party dependencies could make the project far easier to manage, update and integrate into other applications.
The text was updated successfully, but these errors were encountered: