Skip to content

feat: components v2 in v14 #10781

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

Open
wants to merge 9 commits into
base: v14
Choose a base branch
from
Open

feat: components v2 in v14 #10781

wants to merge 9 commits into from

Conversation

Qjuh
Copy link
Contributor

@Qjuh Qjuh commented Feb 23, 2025

Please describe the changes this PR makes and why it should be merged:

Implements Components v2 into mainlib v14.
Only raw JSON data is supported yet, builders not included.

Depends on

Will need a builders v1 release too, since that discord-api-types PR is breaking and some types builders use have been renamed. But since builders v1 is on another branch it has to be another PR.

TODO: uncomment the currently commented type tests that fail because of wrong builders version once builders PR is done, merged and released; also bump builders version to that release.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

Copy link

vercel bot commented Feb 23, 2025

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 7:35pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 7:35pm

@Qjuh Qjuh marked this pull request as ready for review February 24, 2025 08:55
@Qjuh Qjuh requested review from a team and iCrawl as code owners February 24, 2025 08:55
@Qjuh Qjuh requested review from vladfrangu, kyranet and SpaceEEC and removed request for a team February 24, 2025 08:55
@Qjuh Qjuh added the blocked label Feb 24, 2025
@Qjuh Qjuh force-pushed the mainlib-v14/v2-components branch from e6541fb to 8835fd6 Compare February 24, 2025 12:06
imnaiyar

This comment was marked as resolved.

@Qjuh Qjuh requested a review from imnaiyar February 27, 2025 15:28
@vladfrangu vladfrangu changed the title feat: components v2 feat: components v2 in v14 Mar 4, 2025
@Qjuh Qjuh removed the blocked label Mar 8, 2025
@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js Apr 23, 2025
@Qjuh Qjuh requested a review from sdanialraza April 23, 2025 11:06
@Qjuh Qjuh added the blocked label Apr 23, 2025
@Qjuh Qjuh requested a review from a team as a code owner April 24, 2025 16:50
@Qjuh Qjuh requested review from ckohen, didinele and Jiralite and removed request for a team April 24, 2025 16:50
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.51%. Comparing base (8702978) to head (d413e63).
Report is 5 commits behind head on v14.

Additional details and impacted files
@@           Coverage Diff           @@
##              v14   #10781   +/-   ##
=======================================
  Coverage   35.51%   35.51%           
=======================================
  Files         228      228           
  Lines       14317    14319    +2     
  Branches     1255     1255           
=======================================
+ Hits         5084     5086    +2     
  Misses       9189     9189           
  Partials       44       44           
Flag Coverage Δ
brokers 31.44% <ø> (ø)
builders 91.58% <ø> (ø)
collection 100.00% <ø> (∅)
formatters 97.43% <ø> (∅)
guide 0.54% <ø> (ø)
proxy 66.27% <ø> (∅)
rest 88.02% <100.00%> (∅)
util 41.42% <ø> (∅)
utilities 100.00% <ø> (∅)
voice 63.64% <ø> (∅)
website 0.00% <ø> (ø)
ws 36.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Qjuh Qjuh added this to the discord.js 14.19 milestone Apr 24, 2025
return this.components.flatMap(row => row.components).find(component => component.customId === customId) ?? null;
return (
this.components
.flatMap(component => {
Copy link
Member

@didinele didinele Apr 24, 2025

Choose a reason for hiding this comment

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

This flatMap callback pops up twice, maybe worth considering making it a helper somewhere

@github-project-automation github-project-automation bot moved this from Review Approved to Review in Progress in discord.js Apr 24, 2025
@Qjuh Qjuh requested a review from Jiralite April 24, 2025 19:35
Comment on lines +188 to +191
/**
* @external APIMessageTopLevelComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessageTopLevelComponent}
*/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
* @external APIMessageTopLevelComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessageTopLevelComponent}
*/
/**
* @external APIMessageTopLevelComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIMessageTopLevelComponent}
*/

@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review Approved
Development

Successfully merging this pull request may close these issues.

6 participants