reactiflux/reactibot

Add message command to search React documentation

Closed this issue · 1 comments

Star helpers frequently reference React documentation to address commonly asked questions. Adding a Reactibot command integrated with the documentation could quickly direct users to relevant sections for resolving their issues. For instance, using the command !react createContext would provide a brief explanation and direct the user to the appropriate documentation section.

Implementation Ideas

  • "Scraping" the react.dev source code from GitHub would allow Reactibot to display <Intro /> from their MDX, along with appropriate documentation links. This extraction can be achieved using simple regular expressions. Link to their GitHub.
    • Example of their MDX.

Challenges

  • In instances where <Intro /> contains references or links to other parts of the documentation, these links should be correctly updated to maintain their functionality.
  • Not always the command would point to react directory and sometimes, we may need to reference react-dom API.
    • Star helpers are often aware which API they are referencing, it could be different command, e.g !react-dom createPortal

Questions

  • Does GitHub have any limitations on the number of requests that can be made and would we surpass them? We may need to consider caching and saving documentation on each new Reactibot version.
    • There is limited subset of developers, which would choose to use the command.

Sounds like an interesting idea! We already have something similar with !mdn, though we reference the React docs in enough commands that this would probably save us more time. I hope we wouldn't need much more infra to consume the React docs, though.

Does GitHub have any limitations on the number of requests that can be made and would we surpass them?

Yes, there are separate rate limits for REST and GraphQL. We already have a GitHub token in our environment though, so I don't think we'd run into issues with this.