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 public external JS declarations #42

Closed
hfhbd opened this issue Feb 10, 2021 · 7 comments
Closed

Support public external JS declarations #42

hfhbd opened this issue Feb 10, 2021 · 7 comments

Comments

@hfhbd
Copy link

hfhbd commented Feb 10, 2021

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.

@cortinico
Copy link
Contributor

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

@qwwdfsad
Copy link
Collaborator

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

@hfhbd
Copy link
Author

hfhbd commented Feb 10, 2021

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...

@qwwdfsad qwwdfsad reopened this Feb 10, 2021
@qwwdfsad
Copy link
Collaborator

Good point, I will update the readme

@amal
Copy link

amal commented Feb 16, 2023

@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?

@qwwdfsad
Copy link
Collaborator

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

@amal
Copy link

amal commented May 24, 2023

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 added a commit to fluxo-kt/fluxo-bcv-js that referenced this issue May 25, 2023
Fixes Kotlin/binary-compatibility-validator#42
Kotlin/binary-compatibility-validator#42 (comment)

- Based on the generated TS definitions.
- Has support for Kotlin/JS non-KMP projects.
- Compatible with BCV 0.8+

Initially made for the Fluxo state management framework, now published for general use:
https://github.com/fluxo-kt/fluxo

See README for the usage instructions:
https://github.com/fluxo-kt/fluxo-bcv-js#how-to-use

Signed-off-by: Artyom Shendrik <artyom.shendrik@gmail.com>
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

No branches or pull requests

4 participants