-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
move swagger-ui to webpack/npm and update it to 3.24.3 #9714
Conversation
Also, this will update |
@silverwind can you add a screenshot |
Screenshot added, but it's kind of pointless because page content has not changed 😉 |
thought it would change more ... 😅 - code change looks good and local test worked :) |
@silverwind doesn't this mean that the swagger.js will be build each time ? For info, by updating swagger-ui this will fix few security issues (but maybe not need a backport since only xss that we shouldn't be affected) |
It will only build once per change in the Not 100% sure if |
I think it rightly belongs in the JS parts and swagger-ui also recommends the bundling approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have doubt if this should be tightly configured to gitea js build but this is an improvement and it could be improved again later if it cause problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR, I’m on mobile and am having difficulty adding a comment so I am blocking this until I can get to a desktop to add review.
Investigating removal of source map for |
@sapk I switched to |
Let's wait on @sapk to approve the latest change to |
Decided to go with Good to go from my side. |
@silverwind It is more the fact that it is in the same build process than gitea js that bother me the most compared to using directly release files but it feel more a personal intuition and not backed by real experience. So I am totally ok with merging this and see if it become a problem (which will be limited since only for builder) or if I was wrong to think so. Otherwise this PR is totally LGTM. |
Okay. When it comes to JS modules, I don't expect release files to be present and many modules do not even provide them because it is generally expected that the user takes care of their bundling/polyfilling needs. |
By release file, I mean like previously, totally outside npm/node_modules but don't bother with that. |
I would also prefer that we build dependencies ourselves as most libraries in npm are provided with idea to be built on end product |
0d57e5a
to
14889ec
Compare
Squashed and pushed a few minor cosmetic tweaks. |
CI failed with unrelated error, please restart.
|
Created a second webpack output file for swagger-ui which is loaded on the /api/swagger route. One notable difference is the absence of the swagger favicon that was previously used which is now the gitea icon. I see no easy way to restore that favicon, so I decided to not keep it.
14889ec
to
fd40e58
Compare
Rebased. @techknowlogick want to lift your block? |
Codecov Report
@@ Coverage Diff @@
## master #9714 +/- ##
==========================================
- Coverage 42.32% 42.17% -0.16%
==========================================
Files 600 592 -8
Lines 78357 78155 -202
==========================================
- Hits 33161 32958 -203
- Misses 41140 41150 +10
+ Partials 4056 4047 -9
Continue to review full report at Codecov.
|
Created a second webpack output file for swagger-ui which is loaded on the /api/swagger route. One notable difference is the absence of the swagger favicon that was previously used which is now the gitea icon. I see no easy way to restore that favicon, so I decided to not keep it.