Closed lisonge closed 3 months ago
the following is the example that js invoke kotlin code by kotlin multiplatform in my open source project
Hello, will check K2 mode support 🙂
Speaking about WASM, it's not possible right now due to I use https://maven.google.com/web/index.html?q=sdk-common#com.android.tools:sdk-common:31.5.2 jvm only dependency for conversion (the same as used in Android Studio).
Speaking about WASM, it's not possible
What I mean is that we only need to release a Kotlin Multiplatform library with a single function that converts an XML/SVG formatted string into a Compose ImageVector formatted string. It's simply converting one string into another, without involving any platform-specific code.
Speaking about WASM, it's not possible
What I mean is that we only need to release a Kotlin Multiplatform library with a single function that converts an XML/SVG formatted string into a Compose ImageVector formatted string. It's simply converting one string into another, without involving any platform-specific code.
There is not just fun(string)->string
Under the hood there are svg & xml parsers libs that works on jvm and does not support WASM (yet)
So we cant just enable wasm support and make 1 fun (to rule them all)
As option you can wait for CLI (command line tool) feature(#25) and use it
ok thanks
I'm not sure if you can replace the underlying XML parsing library with one that supports Kotlin Multiplatform, but I guess that might be a bit of a big task. So, let's leave it as it is for now. If I'm interested later, I might consider implementing this library myself
K2 should be available in 0.6.1. Please note, plugin can be installed manually and everything will work. Compatibility problem introduced by jetbrains marketplace 😑
issue not fixed
UPD: Based on documentation
Starting from IntelliJ 2024.2.1 (Preview), the following setting in the plugin.xml can be used to declare compatibility with the K2 mode:
this will be available only starting from 2024.2.1 (RC now)
In this version everything works as expected.
Plugin 'Valkyrie - SVG to ImageVector' wasn't loaded because it's incompatible with the Kotlin plugin in K2 mode
first thank your great wrok
I found that this plugin can only be used in Android Studio. Is it possible to use Kotlin/JS or Kotlin/WASM to export the core functionality of this plugin as a library, so that it can be used in a browser? This way, others can perform the conversion online by simply opening a browser.
This is because each user's version of Android Studio is different, leading to compatibility issues. Additionally, on my device, Android Studio often has bugs where it fails to highlight code and shows errors for unused variables. Therefore, if the plugin's conversion functionality could be used in a browser, it would be great.