Skip to content

toggled Swagger UI representation in spec designer #5895

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

Merged
merged 3 commits into from
Apr 24, 2023

Conversation

jackkav
Copy link
Contributor

@jackkav jackkav commented Apr 17, 2023

changelog(Improvements): Add back UI preview mode alongside OpenAPI/Swagger spec editor

Goal: bring back swagger ui preview as a closable window alongside the spec editor.

Approach: attempt to use swagger-ui-dist to avoid coupling the app to swagger-ui dependency versions.

Result:

  • adds swagger-ui-dist to node_modules increasing total size by 9.6M
  • manages lifecycle with a useeffect triggered on spec contents changes, or toggle button conditional render

Issues:

  • doesn't support theming, never did
  • was previously hardcoded to dark mode, now its hard coded to light since the dark mode was more custom css to maintain
  • root loader is running sync functions on every fetch with a half second debounce, which runs in this component every key press which means updates to the swagger ui run afterwards, this could be problematic to timing issues

Closes INS-2566

@jackkav jackkav force-pushed the spike/swagger-ui-revenge branch from bf9ff83 to 19fff2f Compare April 20, 2023 10:28
@jackkav jackkav changed the title Swagger UI but easier to maintain toggled Swagger UI in designer Apr 21, 2023
@jackkav jackkav changed the title toggled Swagger UI in designer toggled Swagger UI representation in spec designer Apr 21, 2023
@jackkav jackkav requested a review from a team April 21, 2023 15:46
@jackkav jackkav marked this pull request as ready for review April 21, 2023 15:46
@jackkav jackkav added this pull request to the merge queue Apr 24, 2023
Merged via the queue into Kong:develop with commit 12d027f Apr 24, 2023
@jackkav jackkav deleted the spike/swagger-ui-revenge branch April 24, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants