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

Implement React components to reduce emitted MDX output from plugin #979

Merged
merged 71 commits into from
Oct 16, 2024

Conversation

sserrata
Copy link
Member

@sserrata sserrata commented Sep 28, 2024

Description

Massive refactor with goal of reducing overall MDX footprint for generated API docs. secondary goals are to improve maintainability, readability and reduce overall bundle size.

Preview: https://docusaurus-openapi-36b86--pr979-fgr4lcvg.web.app/

@sserrata sserrata added enhancement New feature or request DO NOT MERGE v4.0.0 v4.0.0 labels Sep 28, 2024
@sserrata sserrata self-assigned this Sep 28, 2024
Copy link

github-actions bot commented Sep 28, 2024

Size Change: -310 kB (-13.63%) 👏

Total Size: 1.96 MB

Filename Size Change
demo/.docusaurus/globalData.json 37.4 kB +1.18 kB (+3.25%)
demo/.docusaurus/registry.js 55.1 kB +1.71 kB (+3.19%)
demo/.docusaurus/routes.js 50.9 kB +1.64 kB (+3.32%)
demo/.docusaurus/routesChunkNames.json 21.1 kB +682 B (+3.34%)
demo/build/assets/css/styles.********.css 133 kB +1.62 kB (+1.24%)
demo/build/assets/js/main.********.js 672 kB +5.13 kB (+0.77%)
demo/build/assets/js/runtime~main.********.js 14.3 kB +341 B (+2.44%)
demo/build/petstore/add-pet/index.html 23.2 kB -15.7 kB (-40.29%) 🎉
demo/build/petstore/create-user/index.html 22.6 kB -12.7 kB (-35.94%) 🎉
demo/build/petstore/create-users-with-array-input/index.html 22.6 kB -13 kB (-36.4%) 🎉
demo/build/petstore/create-users-with-list-input/index.html 22.6 kB -13 kB (-36.4%) 🎉
demo/build/petstore/delete-order/index.html 22.6 kB -533 B (-2.3%)
demo/build/petstore/delete-pet/index.html 22.7 kB -1.12 kB (-4.68%)
demo/build/petstore/delete-user/index.html 23 kB -455 B (-1.94%)
demo/build/petstore/find-pets-by-status/index.html 23.4 kB -38.6 kB (-62.25%) 🏆
demo/build/petstore/find-pets-by-tags/index.html 24.1 kB -38 kB (-61.21%) 🏆
demo/build/petstore/get-inventory/index.html 21.9 kB -2.77 kB (-11.23%) 👏
demo/build/petstore/get-order-by-id/index.html 22.9 kB -16.1 kB (-41.26%) 🎉
demo/build/petstore/get-pet-by-id/index.html 23.5 kB -37.6 kB (-61.48%) 🏆
demo/build/petstore/get-user-by-name/index.html 23 kB -39.5 kB (-63.18%) 🏆
demo/build/petstore/login-user/index.html 23.6 kB -8.79 kB (-27.14%) 🎉
demo/build/petstore/logout-user/index.html 22.3 kB +157 B (+0.71%)
demo/build/petstore/new-pet/index.html 22.9 kB -7.78 kB (-25.35%) 🎉
demo/build/petstore/place-order/index.html 22.1 kB -24.1 kB (-52.09%) 🏆
demo/build/petstore/schemas/cat/index.html 30.2 kB +36 B (+0.12%)
demo/build/petstore/schemas/dog/index.html 29.7 kB +36 B (+0.12%)
demo/build/petstore/schemas/honeybee/index.html 29.7 kB +36 B (+0.12%)
demo/build/petstore/schemas/pet/index.html 27.9 kB +36 B (+0.13%)
demo/build/petstore/schemas/user/index.html 32.8 kB +36 B (+0.11%)
demo/build/petstore/subscribe-to-the-store-events/index.html 29.2 kB -20.1 kB (-40.75%) 🎉
demo/build/petstore/update-pet-with-form/index.html 22.9 kB -1.92 kB (-7.74%)
demo/build/petstore/update-pet/index.html 23.3 kB -11.1 kB (-32.19%) 🎉
demo/build/petstore/update-user/index.html 22.9 kB -13.3 kB (-36.69%) 🎉
demo/build/petstore/upload-file/index.html 22.7 kB -6.15 kB (-21.3%) 🎉
ℹ️ View Unchanged
Filename Size
demo/.docusaurus/codeTranslations.json 2 B
demo/.docusaurus/docusaurus.config.mjs 13.7 kB
demo/.docusaurus/i18n.json 267 B
demo/.docusaurus/site-metadata.json 1.23 kB
demo/build/index.html 94.5 kB
demo/build/petstore/pet/index.html 24.6 kB
demo/build/petstore/schemas/apiresponse/index.html 21.4 kB
demo/build/petstore/schemas/category/index.html 22.1 kB
demo/build/petstore/schemas/id/index.html 20.8 kB
demo/build/petstore/schemas/order/index.html 22.5 kB
demo/build/petstore/schemas/tag/index.html 21.4 kB
demo/build/petstore/store/index.html 22.5 kB
demo/build/petstore/swagger-petstore-yaml/index.html 29.6 kB
demo/build/petstore/user/index.html 23.5 kB

compressed-size-action

Copy link

github-actions bot commented Sep 28, 2024

Visit the preview URL for this PR (updated for commit ef8b1d9):

https://docusaurus-openapi-36b86--pr979-fgr4lcvg.web.app

(expires Fri, 15 Nov 2024 15:14:40 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata sserrata changed the title Add ParamsDetails component Implement React components to reduce emitted MDX output from plugin Oct 3, 2024
@sserrata sserrata marked this pull request as draft October 4, 2024 16:25
@sserrata sserrata marked this pull request as ready for review October 7, 2024 17:07
@sserrata
Copy link
Member Author

sserrata commented Oct 7, 2024

Just went through a side-by-side comparison between existing demo build and this branch. So far, everything seems to align with some slight differences:

  • Primitives are now rendered as a "tree" SchemaItem
  • Now performing deep merge of resolved of allOf merge and existing schema minus the allOf (previously only shallow merge was performed)

Copy link
Collaborator

@blindaa121 blindaa121 left a comment

Choose a reason for hiding this comment

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

So far the changes look good on my end. Thanks for the huge refactor @sserrata! 🚀

@sserrata sserrata merged commit 893b432 into main Oct 16, 2024
13 checks passed
@sserrata sserrata deleted the params-details branch October 16, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v4.0.0 v4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants