v3.0.0-beta.1 | Component data serialization, removed old declarations
Overview
Added component data serialization, few minor additions and finally removed old declarations.
It has been 84 years...
As a reminder, while the major changes are done, some smaller changes and/or deprecations might be necessary in the future, to always improve the development experience, adopt newer features and better practices.
While there is no complete migration guide, you are welcome to ask in the support server.
Note about the previous release
The meaning of CommandScope#GLOBAL was changed in the previous release; You can learn more about it in the "Breaking changes" section.
Removed all deprecated declarations (#212)
If you're having compilation errors, downgrade to 3.0.0-alpha.24 and:
- Do a full recompile to see the deprecation warnings,
- Or, use your IDE to inspect your project.
Support for component data serialization (#231)
This enables you to pass any data to your component and timeout handlers, as long as they are serializable.
Any serialization library can be used, Jackson, Gson, kotlinx.serialization, Protobuf, Java's serialization (???), you name it.
Breaking changes
- The
Stringargparameter have been replaced with adataargument of typeSerializedComponentData - A
SerializedComponentData serialize(R)method has been added - A new migration script has been added, if you are using a migration tool already, you do not need to do anything
New features
- Added
@SerializableComponentDataand@SerializableTimeoutData- Can be used instead of
@ComponentData/@TimeoutDatato (de)serialize objects usingGlobalComponentDataSerializer GlobalComponentDataSerializerhas a default instance, which can be overridden by creating your own instance.
- Can be used instead of
Breaking changes
Components
- Require >=
42.7.5of the PostgreSQL first party driver (required by #231)- You can still use H2, which does not require a minimum version
- You will be warned when using a third party PostgreSQL driver
Deprecations
Misc
- Deprecated
typeReferenceOf- Replaced by
jackson-module-kotlin'sjacksonTypeRef
- Replaced by
Changes
Dependencies
- Added
jackson-module-kotlinv2.17.2, same version as what JDA uses- Required by #231
New features
Misc
- Added static factories for
KotlinTypeToken- Similar to Gson's
TypeTokenstatic methods, or the JacksonObjectMapper's methods returningTypeReferences
- Similar to Gson's
- Added
ParameterWrapper#typeToken- Return a
KotlinTypeToken, a more general purpose object
- Return a
Don't hesitate to check out the examples and the wiki.
Full Changelog: v3.0.0-alpha.24...v3.0.0-beta.1
Installation
As a reminder, the minimum Java version supported is Java 17.
Kotlin Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.freya022:BotCommands:3.0.0-beta.1")
}Maven
<dependency>
<groupId>io.github.freya022</groupId>
<artifactId>BotCommands</artifactId>
<version>3.0.0-beta.1</version>
</dependency>