Skip to content

React Native Flowtype API Docs Generator

Ayush Jain edited this page Jun 22, 2020 · 2 revisions

Mission

Ensure React Native API and Components documentation is always up to date by automatically generating documentation site pages from Flowtypes and code comments.

Core team

Background

The React Native team has historically struggled to keep the website updated with API changes, causing confusion internally and externally for what our API surface actually is. Fortunately, we have flow types that specify our exact API, and we have prototyped a system to update the website based on the flow types in code.

This project is to implement a system to automatically update the website API docs based on the flow types in the code. This will ensure that our website is always accurate and up to date, reducing our support load and reducing the amount of time we need to spend updating the documentation on the website.

Milestones

  • Step 1: Update code comments and examples to reflect the website
    • The website and the source code have diverged. Website is source of truth (but might be out of date in parts)
    • Good first task to start understanding docs structure
    • Start with Components
    • Native Modules / API docs are more varied and may require editorial work
  • Step 2: Manually generate the entire API reference from the code
    • Should cover Components & Native Modules
    • Run a script to generate it
    • Human editor accepts changes and builds the website
  • Step 3: Automatically submit PRs to React Native Website
  • Step 4: Integrate to the React Native project CI
    • This phase may have to be descoped, as we may need to test step 2 for a few releases before integrating it as part of the CI
    • Consider creating a cloned CI job on CircleCI and implementing the automation without turning it on for the master branch

Success: Complete goals 1-3 and prove that the mechanism and approach works over long term.

Repositories

Prior art

Moti's experimental website branch has a partially working prototype using a customised fork of react-docgen