Skip to content

Add back BuildableComponent#1432

Merged
kezz merged 1 commit into
main/5from
fix/expand-legacy-component-builder-abi-fix
Jun 27, 2026
Merged

Add back BuildableComponent#1432
kezz merged 1 commit into
main/5from
fix/expand-legacy-component-builder-abi-fix

Conversation

@jpenilla

@jpenilla jpenilla commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Restore binary compatibility for 4.x-compiled component builder calls that expect build(): BuildableComponent.

Adventure 5 changed ComponentBuilder#build’s erased return type from the old BuildableComponent hierarchy to Component. Code compiled against Adventure 4.x can therefore fail at runtime on Adventure 5.x with:

NoSuchMethodError: TextComponent$Builder.build():BuildableComponent

Fixes #1431.

Changes

  • Reintroduce BuildableComponent as a deprecated, for-removal compatibility type.
  • Make component interfaces assignable to BuildableComponent again.
  • Extend the existing legacy ABI patch plugin to inject a synthetic bridge:
ComponentBuilder.build():BuildableComponent

in addition to the existing build():Object bridge.

The public source API remains based on ComponentBuilder<C extends Component, ...>, so normal newly compiled 5.x code continues to target the modern ABI:

build():Component

To emit bytecode referencing the restored legacy bridge, code must explicitly use the deprecated compatibility type, for example:

BuildableComponent<?, ?> component = Component.text().build();

That usage produces deprecation/removal warnings and is not intended for new code.

Compatibility notes

This supports:

  • 4.x-compiled code running on Adventure 5.x

It does not make 5.x-compiled code run on Adventure 4.x, and it does not make BuildableComponent a supported long-term API again. The restored type and bridge should be removed in 6.x.

Verification

  • Verified that 4.26.1-compiled bytecode calling:
TextComponent$Builder.build():BuildableComponent

runs successfully against the rebuilt 5.x jar.

  • Verified that normal newly compiled 5.x code still emits:
TextComponent$Builder.build():Component

for Component.text().build().

  • Verified that bytecode only references BuildableComponent when source explicitly uses the deprecated BuildableComponent type.

@jpenilla
jpenilla requested review from kashike and kezz June 23, 2026 18:30
@jpenilla
jpenilla marked this pull request as ready for review June 24, 2026 16:07
@kezz
kezz removed the request for review from kashike June 27, 2026 08:42
@kezz
kezz added this pull request to the merge queue Jun 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 27, 2026
@kezz
kezz force-pushed the fix/expand-legacy-component-builder-abi-fix branch from 09f7add to 1cb2550 Compare June 27, 2026 09:16
@kezz
kezz enabled auto-merge June 27, 2026 09:16
@kezz
kezz added this pull request to the merge queue Jun 27, 2026
Merged via the queue into main/5 with commit a2beec3 Jun 27, 2026
5 checks passed
@kezz
kezz deleted the fix/expand-legacy-component-builder-abi-fix branch June 27, 2026 09:28
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.

ComponentBuilder#build BuildableComponent ABI compatibility

3 participants