Hi everyone :wave: I wanted to share a small proo...
# compose-desktop
u
Hi everyone 👋 I wanted to share a small proof of concept: using native WebViews in Compose. ComposeWebiew I’d really appreciate any feedback you might have. I haven’t published it to Maven yet. I’m not sure I can realistically support another heavy library on my own, since ComposeMediaPlayer and Compose Native Tray already take most of my free time. That said, for a proof of concept it’s already fairly functional. One known issue: on Linux, input events don’t seem to be detected correctly. Curious to hear your thoughts 🙂
👍 3
🚀 3
a
why not share code here (instead of links)? if you want to have a discussion, it only makes sense to share here
🤔 1
u
@Alex Styl I don’t quite understand, I don’t have any issue with the code. I was rather wondering whether, now that we have a functional proof of concept, it might interest someone to collaborate with me on it
a
you are asking for feedback, but you are not asking for specific feedback. This makes it difficult for people to provide you with any feedback (other than giving this a 'thumbs up') ie you just mentioned you are looking for someone to collaborate with you. that sounds important to mention on the OP if that's what you are after, as the feedback people will provide is different to say API design
s
There is an issue with Linux input events
He clearly stated that.
👍 1
My feedback: It looks pretty decent to me on first glance. Using the Tauri WebView is a new approach - normally we only had kcef or JavaFX WebView. I know of some Tauri projects and their WebView works great as far as I know, so this makes a lot of sense for me. I just wonder how big are the native libs. What size does this lib add to our apps?
u
800-900kb per platform
and per architecture
s
That's great! Kcef adds 100 MB, JavaFX needs the whole ecosystem… So 1 MB is great.
🙃 1
💯 1
You could release it to maven as a snapshot and I'm willing to give it a try.
👍 1
u
Alternatively, you can just clone the project and launch the demo 🙂 I don't think I'll do it before tomorrow.
m
This looks interesting for MacOS and Windows but the long list of dependencies and pitfalls for Linux mentioned here https://github.com/tauri-apps/wry makes me shudder 🫤.
u
@Michael Paus I measured it, it creates a .so file of approximately 900kb, so it's not important
m
I am not concerned about the size of the generated lib. I am concerned about what a user of the final program might have to install before he/she can actually use the program. See: https://github.com/tauri-apps/wry#platform-considerations or did I misunderstand that part?
s
Isn't
so
a static lib, so the user doesn't need to install something? 🤔
I may misread the documentation, but I would assume this requirements are necessary if you want to build the lib, not to run it.
@אליהו הדס Does the user have to install WebKitGTK on their system first?
u
Yes, exactly, it's just for the build, but the user doesn't need to install anything. A Hello World installation in Tauri is 2.5MB and it works out of the box.
🎉 2
s
On old versions of Windows 10 users might need to install Edge WebView2 as it wasn't always part of the standard installation.
u
Yes, it's possible, but I don't think we should worry about it.
m
But that would mean that every Linux System must already have some WebView library installed by default because you can't squeeze that into 2.5MB. Is that the case?
u
@Michael Paus exactly
m
OK, good to know.
s
🤔 Ok, so it won't run until the user installed WebKitGTK?
Should the library maybe check if it's installed and prompt the user to do so?
Or provide a method to check it, so the hosting app can tell the user to install it.
u
It's already pre-installed by default on all distributions, but otherwise yes, you can link dynamically via my Gradle module.
s
Ah, okay. If it's a default we shouldn't worry.
u
Only hardcore users with Arch, but they'll manage lol
s
Haha, yeah, that's fine.
m
It's the first time that I hear about this ComposeDesktopLinuxDeps plugin. I'll have to have a look at it.
u
use 0.2.4 version, not 0.2.5
I have to support rpm to
s
Not all heroes wear capes. Elie somehow has a solution for everything.
🙃 1
u
Actually, what's funny is that I spend a crazy amount of time supporting Linux even though 0% of my users are Linux users; it's just so I don't have to develop from a Windows or Mac machine.
😄 1
It's just that I love compose !
s
I feel it! 🙂
I hunt impossible problems and turn them into elegant solutions.
Your slogan, that's so true. 💯
🤗 1
u
Before Compose, I hated creating UIs, whether it was Android's awful XML, or even worse, Swing, or even JavaFX. I'm not even going to mention Qt or GTK; everything else is rubbish in comparison. Compose made me love UI creation.
☝️ 1
same 2
m
For me it's just the opposite. I love to use and develop on my Mac and I support Linux only because there actually are a few Linux users of my software :-)
😂 1
u
I think it’s possible to replace that AWT dinosaur with Tao from Tauri. It would really be a revolution for us. I think it would be possible to build with GraalVM and support Wayland natively.
👍 1
m
With "GraalVM" you mean native-image or what?
u
of course native image
m
When you are such a Linux expert you might also have a solution for this problem: https://kotlinlang.slack.com/archives/C01D6HTPATV/p1766915837962569?thread_ts=1766738581.639339&cid=C01D6HTPATV
u
No, because I don’t support that format. 😑
😢 1
I’m planning to add Flatpak support, but not AppImage.
m
That would be even better but I didn't dear to ask :-)
u
I’ve already managed to do it in Flatpak format, it’s nothing special. I just need to find it again. The tricky part is getting it accepted on Flathub, because they want all dependencies to be preloaded and the build to be fully offline.
s
u
ah yes
You have to look in the old commits. I had managed to make Flatpak builds; it’s just that after they gave me too much hassle to upload it to Flathub, I stopped.
I really have a lot to contribute to the Compose desktop ecosystem, I just don’t have enough free time. I’d really like to create a modern packaging module: MSIX, Flatpak, automatic updates, etc. In any case, if someone wants to fund me so things can move faster, I’m available 🙂 ETH Zurich already trusted me for Compose Native Tray.
👍 2
s
Maybe try to make this offer in #CPKD2EGSY. I don't know if we have a better spot for "kickstarter" projects here.
u
Yes, that could be a good idea to open a Kickstarter for each of my ideas.
s
Yes, that came to my mind. I don't know what the current hottest platforms are for that.
Okay, according to ChatGPT it's still the platform to do such a funding.
k
Interesting to see tauri there, I had used javafx in some projects but this is pretty interesting