Skip to content

Make code more compatible with typedoc#2178

Draft
TheLazySquid wants to merge 49 commits into
BetterDiscord:developmentfrom
TheLazySquid:changes-for-docs
Draft

Make code more compatible with typedoc#2178
TheLazySquid wants to merge 49 commits into
BetterDiscord:developmentfrom
TheLazySquid:changes-for-docs

Conversation

@TheLazySquid
Copy link
Copy Markdown
Contributor

This PR is on top of #2134, and changes BD's code to be friendlier to typedoc for this docs PR. Changes include:

  • Boundable apis have been split up into a bound and non-bound version so the signature is readable
  • Things like ReactUtils and Webpack have been converted into classes so they get documented better
  • Function arguments have all been given names
  • All namespaces on BdApi instances are getters for consistency
  • API classes now have @ignored constructors
    • The eslint rule "no-useless-constructor" has been disabled to accommodate this
  • Parameter names have been changed to match jsdoc

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request performs a major TypeScript migration and refactoring of the BetterDiscord API, introducing 'Bound' class variants for plugin-scoped instances and a new build process for bundled type declarations. The changes involve extensive type annotations across core modules, stores, and UI components. Feedback identifies a potential runtime error in the context menu builder due to a missing label check and critiques a risky pattern in the BdApi class where prototype getters return unbound instances despite being typed as bound ones.

Comment thread src/betterdiscord/api/contextmenu.ts
Comment thread src/betterdiscord/api/index.ts
@zerebos zerebos marked this pull request as draft May 19, 2026 17:54
@zerebos
Copy link
Copy Markdown
Member

zerebos commented May 19, 2026

Converted to draft since it is awaiting a prerequisite PR

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.

2 participants