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

Add support for components V2 #2809

Open
wants to merge 156 commits into
base: master
Choose a base branch
from

Conversation

freya022
Copy link
Contributor

@freya022 freya022 commented Mar 7, 2025

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

This adds the new component system (aka Components V2).

[Waiting on API docs]

This is not released yet, you will not be able to send messages using components V2, however you can include the snapshot to see what code changes will be required and what the usages with future components will be. If you do try it out, make sure to give your opinion on the JDA dev thread

Note: While there are tests, the OpenRewrite recipe has not been tested on an actual project yet

Supersedes #2806.

DV8FromTheWorld and others added 30 commits February 23, 2025 00:19
- Remove generic from the ComponentReplacer parameter;
  I don't think it's possible to get the correct type
- Refactor the replacing logic, move to IReplacerAware
Also add mutators, add to JSON
- Removed generics
- Logic now applies the replacer regardless of type
  As the replacer receives a Component, it's their job to check,
  though facilitated by provided factories
- Avoid recursing into new components by checking reference equality
@freya022 freya022 marked this pull request as ready for review March 9, 2025 12:33
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