Can I have preview for the UIs which I am going to...
# jewel
m
Can I have preview for the UIs which I am going to build with jewel for making a Intellij Idea plugin? I am asking this because creating UIs is a time consuming process and it's kind of hard to compile and execute runIde for every single small change
s
You can use the Compose Multiplatform ide plugin, although your mileage may vary
m
Thank you for your quick answer Sebastiano. Do you know any sample on Github that I could get some idea how to create an Intellij Idea plugin with compose preview using Compose Multiplatform?
s
The plugin is an ide plugin
Not a gradle plugin
I'm on the phone right now so don't have a link handy but just search Compose Multiplatform in the IDE plugins page
m
Oh that one. Yeah I already installed. So means by only having this plugin I am able to preview the composables. Great
s
In theory yes :D
🙌 1
c
One tip is if you are just focused on UI, you can iterate faster by creating a desktop standalone module and sharing code there. Running the desktop app is much faster.
yes black 1
🙌 1
t
I am currently developing a multiplatform preview system. And i implemented it using Jewel. It can also preview itself. If you want to have a look: https://github.com/timo-drick/Multiplatform-Preview It can also preview Jewel plugins. But there is a catch. In the preview currently i can not access the jewel-bridge things. So you need to use the Jewel Standalone version for previewing. https://github.com/timo-drick/Multiplatform-Preview/blob/main/intellij-plugin/src/[…]compose/hotpreview/plugin/ui/preview_window/selfpreview_base.kt:60
❤️ 1
image.png
s
That's very neat! Thanks for sharing ❤️ In 251 the bridge is in the IJP, so you should be able to access it in the previews I think?
t
I am not sure. It is just because i do use a separate classloader to render the previews. And it do not have access to the API but yes maybe it is possible to support this. But currently my focus is on normal Compose Multiplatform projects.
👍 1
s
Gotcha. It's pretty neat anyway!
t
I think to perfectly support IJP Jewel development it would be nice to support themes maybe from an exported icls file. So you can preview for different themes. In theory i could also use the currently selected theme and than serialize it and send it to the preview code with a special interface.
s
In the IDE, Jewel uses whatever theme the IDE is using. In standalone mode, it's technically possible to customise the theme, but it's not a high priority nor particularly convenient. Jewel's aim is to implement the Int UI design system, which is fairly inflexible itself. Contrary to Material, which is designed to be customised, neither Int UI nor Jewel have that goal.
c
I also thought ICLS is limited to editor schemes while UI themes are JSON…
s
I think you're right, yeah. And, IDE themes also contain icons, and other data (they can even contain code) which we're not going to support.
t
@Chris Sinco [G] Yes sorry you are right. I mixed it up. @seb Thanks to Junie AI i found some serialization code in the build system of Jewel to generate themes. Do you think i could generate a plugin and than provide a library that can be used to import the theme into a IntUiTheme. But at the end every one can do it. For my plugin the default IntUiTheme is also working well to have a proper preview. I will add a documentation section to my HotPreview project for Jewel how to get it working for IJP plugin development.
s
@Timo Drick IIRC the serialisation code we have is only reading the colour palette from the theme, not much else. It won't get you very far in terms of themeability...