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

chore(docs): Bump docusaurus to 3 and update deps #2109

Merged
merged 15 commits into from Jan 21, 2024

Conversation

caksoylar
Copy link
Contributor

This PR updates docusaurus to version 3, while also updating other dependencies to latest where appropriate, following https://docusaurus.io/docs/migration/v3. I think it should resolve the 4 dependabot alerts as well.

When I tried this before I had run into some issues, related to mdx upgrade from v1 to v3. But only one page turned out to be affected so that was easy too fix in d070744.

The refactor commits are updating things under the "Optional Changes" header in the migration guide so while they aren't strictly necessary now, they might be issues later on. I also snuck in a bug fix at 8295d76 since I was touching that line in the following commit.

This still needs extensive inspection to make sure nothing broke. (The migration guide recommends visual regression tests which is something we might want to invest into at some point, but it didn't seem worth it at this point to me.)

@caksoylar caksoylar added the documentation Improvements or additions to documentation label Jan 13, 2024
@caksoylar caksoylar marked this pull request as draft January 13, 2024 05:00
@caksoylar caksoylar marked this pull request as ready for review January 13, 2024 06:09
@caksoylar
Copy link
Contributor Author

caksoylar commented Jan 13, 2024

This is ready for review, but both eslint and typecheck are failing. Will look into how to update things there, but any fix suggestions are welcome since I am not familiar with them.

Edit: I did resolve the issues, but perhaps not in the most ideal way. Please feel free to point out better solutions, especially for 4fc2022 and 41da0db.

Also applies prettier changes in touched files due to precommit
Some links ended up broken after docusaurus 3 upgrade,
especially if they are the second on the same line and have anchors.
Likely due to facebook/docusaurus#9518
eslint-plugin-react is emitting a lot of react/no-unescaped-entities
errors in mdx files, primarily due to apostrophes. It seems not ideal
to have to escape every apostrophe in all mdx text, so this commit
disables the check.

There might be a better way to handle this issue, but I am not aware
of one right now.
Remove unused components, and disable proptype checking for children
in OsTabs custom component since I can't figure out a way to assign
propTypes to it in an mdx file.
Need to make prettier ignore these, because otherwise it splits
them to separate lines and reverts the whole change
@caksoylar
Copy link
Contributor Author

I compared current and PR deploy results side-by-side for most of the pages -- they were all good except for the one issue solved by 33c6a37. I first tried converting those headers to regular markdown headers but that broke the TOC. Looks like facebook/docusaurus#9684 might make creating our own toc unnecessary in the future.

@petejohanson
Copy link
Contributor

@caksoylar All seems reasonable to me, and some pragmatic fixes for the couple sticky issues. No concerns here.

@caksoylar
Copy link
Contributor Author

@petejohanson Thanks! If you are happy with it, do you mind giving a formal review? I can't approve the PR myself.

@caksoylar caksoylar merged commit 1961312 into zmkfirmware:main Jan 21, 2024
7 checks passed
@caksoylar caksoylar deleted the docs/docusaurus-3-prep branch January 21, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants