Skip to content

Upgrade Swagger UI to v3 (React inside) #1138

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 5 commits into from
Jun 1, 2017
Merged

Upgrade Swagger UI to v3 (React inside) #1138

merged 5 commits into from
Jun 1, 2017

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented May 23, 2017

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a
  • Fix the CSS
  • Recreate the system to display the current request
  • Recreate the OAuth support

@soyuka
Copy link
Member

soyuka commented May 23, 2017

Those diffs :/. Reminds me of #768.

@dunglas
Copy link
Member Author

dunglas commented May 23, 2017

Yes but the new version improve things, we delete all previous files and there is only 2 JS files now.

@soyuka
Copy link
Member

soyuka commented May 23, 2017

Oh yeah that's nice, I didn't saw that on first look. We may be able to reduce those to 1 file in the update-js.sh script.
https://gist.github.com/soyuka/12a86e1395a9cbf73d44b893c29aec9e

<script src="{{ asset('bundles/apiplatform/swagger-ui/lib/marked.js') }}"></script>
<script src="{{ asset('bundles/apiplatform/swagger-ui/lib/swagger-oauth.js') }}"></script>
<script src="{{ asset('bundles/apiplatform/init-swagger-ui.js') }}"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outch, are we obliged?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should import it... we shouln't need internet to load the Ui

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd still work when offline, the fallback font would just be used.

@dunglas dunglas force-pushed the upgrade_swaggerui branch from 8528ad3 to 5684bae Compare June 1, 2017 12:38
@teohhanhui
Copy link
Contributor

teohhanhui commented Jun 1, 2017

Why are we digging ourselves a new hole?

As I've mentioned in #1149 (comment) and #1149 (comment), I believe this should live in a separate project.

@dunglas
Copy link
Member Author

dunglas commented Jun 1, 2017

Well, I'm not against splitting this piece of code in another project later. But for 2.1 it will stay in core.
We need to have a good documentation system builtin installed with the default distribution. It's one on the added value of API Platform.

@dunglas
Copy link
Member Author

dunglas commented Jun 1, 2017

Btw this PR removes ~ 12k lines of JS and CSS, we're on the good path isn't it?

@dunglas dunglas merged commit 0992790 into master Jun 1, 2017
@dunglas dunglas deleted the upgrade_swaggerui branch June 1, 2017 15:23
hoangnd25 pushed a commit to hoangnd25/core that referenced this pull request Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants