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

docs: Remove JSONEncondable #9344

Merged
merged 2 commits into from Apr 8, 2023

Conversation

Jiralite
Copy link
Member

@Jiralite Jiralite commented Apr 7, 2023

Please describe the changes this PR makes and why it should be merged:
I think we should stop referencing this TypeScript interface in our JavaScript documentation.

Look at this:

/**
* Creates a new action row builder from JSON data
* @param {JSONEncodable<APIActionRowComponent<APIActionRowComponentTypes>>
* |APIActionRowComponent<APIActionRowComponentTypes>} other The other data
* @returns {ActionRowBuilder}
*/
static from(other) {
if (isJSONEncodable(other)) {
return new this(other.toJSON());
}
return new this(other);
}
}

JSONEncodable<APIActionRowComponent<APIActionRowComponentTypes>>|APIActionRowComponent<APIActionRowComponentTypes>. Well damn. This is the same type duplicated with JSONEncodable.

The proposed modification: ActionRow|ActionRowBuilder|APIActionRowComponent. Wow, much more understandable, right?

JavaScript users only need to know what they can pass without needing to deeply understand all associated typings. One may pass a received (immutable) ActionRow from the API, an ActionRowBuilder, or use raw API data. This is the exact same behaviour from before but is documented in a simpler way that could be understood with ease.

I believe this change will allow users to understand this part of the documentation better.

Status and versioning classification:

  • This PR only includes non-code changes, like changes to documentation, README, etc.

@vercel
Copy link

vercel bot commented Apr 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Apr 8, 2023 9:52pm

@vercel
Copy link

vercel bot commented Apr 7, 2023

@Jiralite is attempting to deploy a commit to the discordjs Team on Vercel.

A member of the Team first needs to authorize it.

@kodiakhq kodiakhq bot merged commit b2eec5f into discordjs:main Apr 8, 2023
5 of 6 checks passed
@Jiralite Jiralite deleted the docs/remove-jsonencodable branch April 8, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants