binary-compatibility-validator icon indicating copy to clipboard operation
binary-compatibility-validator copied to clipboard

Support public external JS declarations

Open hfhbd opened this issue 3 years ago • 4 comments

Currently, the validator does not create .api files or api declarations for public external declarations, which results into not checking the JS declarations, which could be called from library consumer in Kotlin.

hfhbd avatar Feb 10 '21 13:02 hfhbd

To add to this, I believe that's the same for native() targets

cortinico avatar Feb 10 '21 13:02 cortinico

Binary-compatibility-validator is intended to be used only with JVM targets.

There is no public notion of "binary compatibility" in either JS or K/N, so they are not supported

qwwdfsad avatar Feb 10 '21 14:02 qwwdfsad

Please make it clear in the Readme. Kotlin does support other targets than the JVM and it would be nice, if others targets could benefit from a binary validator plugin too, although without a built in notation this would be a challenge, I know...

hfhbd avatar Feb 10 '21 14:02 hfhbd

Good point, I will update the readme

qwwdfsad avatar Feb 10 '21 14:02 qwwdfsad

@qwwdfsad Nowadays TS declarations can work as a good public ABI for JS.

Already generated in some setups, maybe you can consider supporting it in the binary-compatibility-validator?

amal avatar Feb 16 '23 14:02 amal

JS is completely of our focus now, we are working on K2 release and stabilization of KMM, so unfortunately I'm neither ready to accept a contribution for that nor to even do my due diligence and see if that's a reasonable addition for the future

qwwdfsad avatar Feb 17 '23 17:02 qwwdfsad

I’ve created a Gradle plugin that adds support for JS APIs to the KotlinX Binary Compatibility Validator. Originally made for the Fluxo state management framework, now released for general use.

  • Uses generated TypeScript definitions to do so.
  • Can be used with any Gradle module with Kotlin/JS target. Either multiplatform or Kotlin/JS.
  • Will be supported until the official Kotlin/JS support is added to BCV itself.

Compatibility tested with:

BCV  Kotlin  Gradle
0.8 — 0.13  1.6.20+  7.4+

See how to use with the JitPack here: https://github.com/fluxo-kt/fluxo-bcv-js#readme Publication on Gradle Plugin Portal is in progress.

Please try to use the plugin. I’d appreciate any feedback.

amal avatar May 24 '23 21:05 amal