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
ComponentSerializer services #343
Conversation
169ccd2
to
b6ba19f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unkewl
...gacy/src/main/java/net/kyori/adventure/text/serializer/legacy/LegacyComponentSerializer.java
Show resolved
Hide resolved
...in/src/main/java/net/kyori/adventure/text/serializer/plain/PlainTextComponentSerializer.java
Show resolved
Hide resolved
e14baae
to
00d458c
Compare
1f891ce
to
cea0a30
Compare
cea0a30
to
3abfebc
Compare
3abfebc
to
4a984c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, this could change the way certain component serializers are configured, possibly in a way that is not reversible by the API user.
I assume this isn't considered a breaking change for the static helper methods - GsonComponentSerializer.gson(), colorDownsamplingGson(), LegacyComponentSerializer.legacySection(), legacyAmpersand(), and the like - because the exact configuration of those serializers is not specified. (Though perhaps this lack of exact requirements could be documented)
For LegacyComponentSerializer.builder(), however, the component service has the ability to touch the builder before anything happens to it. This could mean that certain options on the LegacyComponentSerializer could be set by the service, but not unset by the user. For example, useUnusualXRepeatedCharacterHexFormat
has no method to undo it.
@@ -471,6 +488,7 @@ private void applyFullFormat() { | |||
private ComponentFlattener flattener = ComponentFlattener.basic(); | |||
|
|||
BuilderImpl() { | |||
BUILDER.accept(this); // let service provider touch the builder before anybody else touches it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically this change could irreversibly affect behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only provides defaults - anything can be changed by using the builder methods like normal.
Correct - not considered a breaking change.
This is true - we could introduce a method to allow this. But as is currently, no platforms do anything except providing the default |
4a984c1
to
5aec9f1
Compare
5aec9f1
to
bb6be19
Compare
No description provided.