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

Support Kotlin/JS #775

Merged
merged 141 commits into from
Apr 5, 2023
Merged

Support Kotlin/JS #775

merged 141 commits into from
Apr 5, 2023

Conversation

DRSchlaubi
Copy link
Member

@DRSchlaubi DRSchlaubi commented Feb 28, 2023

This PR attempts to provide Kotlin/JS support for Kord (see #69)

Breaking Changes

  • The following member functions were replaced by extension functions. Importing the extension functions should fix this breaking change.
    • dev.kord.common.Locale.asJavaLocale -> import dev.kord.common.asJavaLocale
    • dev.kord.core.cache.KordCacheBuilder.lruCache -> import dev.kord.core.cache.lruCache
    • dev.kord.rest.builder.message.create.MessageCreateBuilder.addFile -> import dev.kord.rest.builder.message.create.addFile
    • dev.kord.rest.builder.message.modify.MessageModifyBuilder.addFile -> import dev.kord.rest.builder.message.modify.addFile
    • dev.kord.rest.request.RequestBuilder.file -> import dev.kord.rest.request.file
  • The type of the following declarations was changed from java.util.Locale to dev.kord.common.Locale (if you really need to use the Java class, use the asJavaLocale extension):
    • dev.kord.core.entity.Guild.preferredLocale
    • dev.kord.rest.builder.guild.GuildModifyBuilder.preferredLocale
  • All annotations in dev.kord.common.annotation and the dev.kord.gateway.PrivilegedIntent annotation now have BINARY instead of RUNTIME retention. This means they are no longer visible for reflection.
  • All maven consumers must append -jvm to their artifact IDs for kord-common, kord-rest, kord-gateway and kord-core.
  • The core-voice capability has been removed, please use the kord-core-voice artifact instead.

@DRSchlaubi DRSchlaubi mentioned this pull request Mar 15, 2023
@lukellmann lukellmann changed the base branch from 0.8.x to 0.9.x March 25, 2023 17:40
@lukellmann
Copy link
Member

@DRSchlaubi we should update the PR description to include migration issues/steps (artifact changes, member to extension conversions), then it's good to go

@lukellmann
Copy link
Member

about annotation retention, this is how kxser does it, should we do it like this too?

@MustBeDocumented
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS, AnnotationTarget.TYPE)
//@Retention(AnnotationRetention.RUNTIME) // Runtime is the default retention, also see KT-41082
public annotation class Serializable(
    val with: KClass<out KSerializer<*>> = KSerializer::class // Default value indicates that auto-generated serializer is used
)

it would mean that it's still available at runtime on jvm at least, i.e. no breaking change

@DRSchlaubi
Copy link
Member Author

IMO these annotations shouldn't have been on runtime to begin with

@lukellmann
Copy link
Member

IMO these annotations shouldn't have been on runtime to begin with

but now they are, so why not keep it that way?

@lukellmann
Copy link
Member

#659

@DRSchlaubi
Copy link
Member Author

I don't really see the benefit of keeping it

@lukellmann
Copy link
Member

alright, it's fine for me

@lukellmann lukellmann changed the title Support Multiplatform Support Kotlin/JS Apr 5, 2023
lukellmann added a commit to lukellmann/kord-extensions that referenced this pull request Apr 5, 2023
@lukellmann lukellmann merged commit 64f6636 into 0.9.x Apr 5, 2023
@lukellmann lukellmann deleted the feature/mpp branch April 5, 2023 15:32
@lukellmann lukellmann removed the request for review from HopeBaron April 20, 2023 00:27
@DRSchlaubi DRSchlaubi linked an issue Aug 6, 2023 that may be closed by this pull request
8 tasks
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.

Support kord-voice on Kotlin/JS and Windows
2 participants