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

Docusaurus v3 #272

Merged
merged 13 commits into from
Nov 6, 2023
Merged

Docusaurus v3 #272

merged 13 commits into from
Nov 6, 2023

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented Jul 13, 2023

Upgrades the docs website to Docusaurus v3 with MDX v3, prism-react-renderer v2 and React 18.
Also includes some minor dependency-cleanup.

Related links:

Lessons learned during migration:

  • Curly-braces outside codefences needs to be escaped as MDX v2 support JS-expressions in curlybraces. Manually fixed here to build.
    • v4 docs are static so probably fine with manual fix
    • @bravo-kernel Should the PS-module escape the rest automatically? Ex. 3cec780
  • MDX v2 doesn't create paragraphs for single-line content (good), but had to fix our "Required Code" <details> elements as summary-element (title) got wrapped in first paragraph.
  • Legacy prefix for versioned sidebar is removed. Just need to remove version-v4.0/ from all keys and links in the json.
  • prism-react-renderer API changed for theme imports and reduced default languages.

Feel free to commit to this with new builds or other fixes. Just thought we could verify early.

Fix #273

@bravo-kernel
Copy link
Collaborator

Thanks for creating this one. We still have some time but this makes it pretty clear what needs to be done. 👍

@bravo-kernel
Copy link
Collaborator

And yes, the Alt3 module should definitely be able escape the curly brackets (especially since that fix is compatible with docusaurus v2)

@bravo-kernel
Copy link
Collaborator

@fflaten would you be able to test the Alt3 module artifact produced in https://github.com/alt3/Docusaurus.Powershell/actions/runs/5829982515?pr=169?

If it generates the expected markdown with escaped curly brackets, I will publish a new version.

@fflaten
Copy link
Collaborator Author

fflaten commented Aug 11, 2023

No diff besides comment in sidebar. All good! 🎉

@bravo-kernel
Copy link
Collaborator

Thank you for testing, much appreciated. If you find anything else feel free to let me know 💃

Released in https://www.powershellgallery.com/packages/Alt3.Docusaurus.Powershell/1.0.35

@fflaten
Copy link
Collaborator Author

fflaten commented Aug 13, 2023

Great work! Will do. Hopefully not more issues to come.

@fflaten
Copy link
Collaborator Author

fflaten commented Oct 20, 2023

3.0-rc.0 adds support for TS config files. Switch or stay with JS? facebook/docusaurus#9317

@bravo-kernel
Copy link
Collaborator

I have been waiting to see how they do the ts config and would (and will) personally go for it.

@fflaten
Copy link
Collaborator Author

fflaten commented Oct 20, 2023

I have been waiting to see how they do the ts config and would (and will) personally go for it.

Cool. I'll let you handle that in a separate PR 🙂

This needs to be fixed in source.

MDX v2 allows expressions inside curly braces
outside of codefences
Manually fixed as v4 docs are not updated anymore

MDX v2 allows expressions inside curly braces
outside of codefences
clsx is faster, has same syntax and is also used in docusaurus
Summary got wrapped in the contents paragraph-element
MDX v2 doesn't produce blocks for single line ocntent. We fix this by
adding a blank line after summary, or just wrap text in ex. div-element
Support removed in 3.0.0-beta.0. Fix was documented in build error
`:::caution` is deprecated in v3. `:::warning` has been updated with
the same styling, so only real change is default title.
Remove xml as additional language
Removes unused url-loader and file-loader.
Adds prism-react-renderer as direct deps to support
strict package manages without hoisting.
@fflaten fflaten changed the title WIP - Docusaurus v3 Docusaurus v3 Oct 31, 2023
@fflaten fflaten marked this pull request as ready for review October 31, 2023 22:01
@fflaten
Copy link
Collaborator Author

fflaten commented Oct 31, 2023

Not sure if we'd like to merge this (when reviewed) or not. Feel free to close if it should be split into multiple PRs :)

@bravo-kernel
Copy link
Collaborator

I have no issues with merging this as it is.

I could not detect any issues in the preview so just let me know if you feel confident as well and I will merge.

@fflaten
Copy link
Collaborator Author

fflaten commented Nov 6, 2023

Nice. LGTM on my end 🙂

@bravo-kernel bravo-kernel merged commit 6fe792e into pester:main Nov 6, 2023
4 checks passed
@bravo-kernel
Copy link
Collaborator

Woohoo 💃

@fflaten fflaten deleted the docusaurusv3 branch November 6, 2023 16:07
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.

Cleanup loader dependencies?
2 participants