ComposeGears/Valkyrie

Incompatible with K2

Closed this issue ยท 9 comments

Plugin 'Valkyrie - SVG to ImageVector' wasn't loaded because it's incompatible with the Kotlin plugin in K2 mode

image

Android Studio Koala Feature Drop | 2024.1.2 RC 1
Build #AI-241.18034.62.2412.12169539, built on August 1, 2024
Runtime version: 17.0.11+0--11852314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
Kotlin Plugin: K2 Kotlin Mode (Alpha)
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 16
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.intellij.marketplace (241.18034.106)
  com.nasller.CodeGlancePro (1.8.5)
  izhangzhihao.rainbow.brackets (2024.2.6-241)
  com.github.copilot (1.5.19.6527)
  mobi.hsz.idea.gitignore (4.5.3)

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.

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.

vkatz commented

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

  1. We have to fix the K2 compatibility, which is the issue reported.
  2. Something else sounds like a new feature should be filed to a new one.

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
image

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)
image

In this version everything works as expected.

Screenshot 2024-08-21 at 16 29 45