Skip to content

Conversation

Gijsdeman
Copy link
Contributor

@Gijsdeman Gijsdeman commented Dec 15, 2023

Description

Removed (almost) all javascript files from the docusaurus-theme-openapi-docs and converted them to typed react components. Also fixed the highlighting of codeblocks and a small issue with the clean method.

There are still a few TODOs regarding code that did not work anymore due to typing. I could not figure out what this code did so I left it commented out with //TODO Gijs for now. Will take a look at it later. Furthermore, there are a few properties that have not been typed completely as I wanted to prevent copying typing from the docusaurus-plugin-openapi-docs as much as possible (and was unsure how to do this properly).

Some of the updated code has been gotten directly from the official Docusaurus repository which now fully supports Typescript.

Still has to be rebased properly.

Motivation and Context

How Has This Been Tested?

Behaviour of the refactored components was compared to those of the original ones. No difference in functionality could be noticed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@Gijsdeman
Copy link
Contributor Author

Checked the clientWidth condition on setShowTabArrows. This used to be offsetWidth, but that is a value that is not actually available on items from the ResizeObservers. The differences between clientWidth and offsetWidth are minimal, so this still seems to work fine.

The flattening of children now has been fixed as well. Typing makes me think this might not be necessary, but it has probably been introduced with a reason (I cannot find more information on why it was introduced).

Everything seems to be working fine, and the small bugs mentioned have been fixed as well.

@Gijsdeman
Copy link
Contributor Author

I also noticed an issue with d805ac9 where the sidebar typing is not actually exported from Docusaurus. Fixed this in the last commit.

Copy link

github-actions bot commented Dec 19, 2023

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

https://docusaurus-openapi-36b86--pr684-bsjeg26x.web.app

(expires Sat, 03 Feb 2024 20:44:04 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata sserrata merged commit 677381d into PaloAltoNetworks:v3.0.0 Jan 5, 2024
@sserrata sserrata mentioned this pull request Jun 24, 2024
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.

2 participants