Skip to content

Conversation

@reidbarber
Copy link
Member

@reidbarber reidbarber commented Dec 23, 2025

The markdown docs generation script (yarn workspace @react-spectrum/s2-docs generate:md) was pretty slow due to repetitive sync glob and file reads. Now, we build an index of symbols and read from that instead.

On my machine:

Before: 113s
After: 5s

Also includes some improvements to the markdown output in some areas where we had gaps:

  • fixed missing jsdoc descriptions
  • fixed union type member ordering to be consistent (and match docs)
  • added function signatures in Related Types

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Smoke test markdown docs outputs.

🧢 Your Project:

@reidbarber reidbarber changed the title chore: speed up markdown docs script WIP: chore: speed up markdown docs script Dec 23, 2025
@reidbarber reidbarber changed the title WIP: chore: speed up markdown docs script chore: speed up markdown docs script Dec 23, 2025
@rspbot
Copy link

rspbot commented Dec 23, 2025

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

I ran the command yarn workspace @react-spectrum/s2-docs generate:md on main and then on this branch (which appears to be up to date with main)

The output is different for the md files. I ran diff -r /Users/robsnow/Desktop/dist-main /Users/robsnow/Desktop/dist-new to verify

It looks like the new md files contain a lot more information? (although that any seems wrong in the function signature)

Image

Also, sometimes the order of the values changes? I had to sort for tsdiffer otherwise it was random to an extent.

Image

@rspbot
Copy link

rspbot commented Jan 5, 2026

@rspbot
Copy link

rspbot commented Jan 5, 2026

@reidbarber
Copy link
Member Author

@snowystinger Thanks for checking that! Fixed the any issue and stabilized the union member ordering. Everything else should be an improvement (fixed some missing descriptions).

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.

4 participants