Yesterday I made a post on Reddit about my Spotify...
# kilua
s
Yesterday I made a post on Reddit about my Spotify Landing Page Clone: https://www.reddit.com/r/Kotlin/s/kVBtwUVPuZ And I got a comment that I don't have an answer to since I haven't used Kobweb yet. So if someone here has used both Kobweb and Kilua, could you please help me with the question asked in the attached image? Basically, how is Kilua different from Kobweb?
r
With Kobweb You Have To Write All HTML Tags Uppercase ;-)
😁 1
s
Haha πŸ˜‚
p
yes, because the tags are Composables?
☝️ 1
I tried Kobweb with this simple landing page: https://www.bumbii.ai/english/
πŸ‘ 1
so far I think it’s good, especially for people from mobile development like me πŸ™‚
r
And seriously, both Kobweb and Kilua do the same thing - you use composable functions to create HTML elements with attributes and styles. Just the API is different. Kobweb uses approach a bit familiar to Android devs (with objects like
Box
,
Column
,
Row
or
Modifier
). It also adopts Compose HTML design (uppercase function names,
AttrsBuilderContext
and
attrs =
). And it packs everything with CLI tool and some nice features like static export, fullstack routes, web workers or markdown. I think Kilua should be easier for web developers (like me). The API is simpler. Most of the time you use composable function calls with simple parameters for everything. You work directly with CSS flexbox / CSS grid for more complex layouts.
πŸ‘ 1
s
Let me know if it exists in Kobweb but I feel that Kilua's API provides a generic non-typesafe access to JS properties as well. Like if something isn't covered by the type-safe Kilua API, it's not really stopping you from accessing those web properties/APIs you want to use
Meaning that Kilua is much more of an enabler rather than a hurdle in someone's way
r
I haven't used Kobweb myself, so I'm not an expert. But even after reading the docs a few times I just still don't understand some concepts like Silk.
s
Gotcha Thank you both Robert and Phuc πŸ™Œ this helps greatly
r
You can access non-typesafe properties as well in Kobweb: https://github.com/varabyte/kobweb?tab=readme-ov-file#attrsmodifier-and-stylemodifier
πŸ‘ 1
s
Oh okay In that case I agree with your first point It's just a preference difference, both frameworks provide the same thing, one is more tilted towards bringing Android Devs onboard, and the other is tilted towards attracting Web Devs to Kotlin.
πŸ‘ 1
r
But of course the API design in not the only difference between Kobweb and Kilua.
While Kobweb is focused on building HTML, Kilua also gives you some additional, advanced components. It's perfect for building complex web applications (with lot's of forms, dialogs and tables). This is something still not highlighted enough, because the docs are not ready and the examples are not covering that aspect.
s
Understood Let me know if I can help out with something Happy to be useful πŸ™Œ
r
Thanks πŸ™‚ The truth is your spotify example is probably more appealing to potential users, even though it doesn't use any components πŸ™‚ Form components and inputs are boring and ugly πŸ˜‰ They are only appreciated when your customer asks you to add the hundredth dialog window to your application πŸ™‚
πŸ˜‚ 2
p
I’ll try Kobweb more and we can come back here after some time πŸ™‚
πŸ†’ 1
I’m not sure but I think Kobweb is also planned for complex app
not just simple landing page like mine
r
I'm sure it is. It just won't let you use an inline calendar date picker out of the box. Kilua does.
πŸ™Œ 2
I've answered the Reddit question as well with a short summary.
s
Awesome! Thank you πŸ™Œ
d
> I haven't used Kobweb myself, so I'm not an expert. But even after reading the docs a few times I just still don't understand some concepts like Silk. Kobweb core is the navigation / routing part. It introduces a fork of the
Modifier
concept from Jetpack Compose, and annotations like
@Page
(for frontend pages) and
@Api
(for backend API routes). Silk is the UI layer. It includes a growing list of widgets, color mode support, and CSS styling blocks. Perhaps the best analogy is that Kobweb is like NextJS and Silk is somethling like Chakra UI (but with an API inspired by Jetpack Compose). You can definitely use Kobweb without Silk. I probably could have chosen to not release both a UI layer AND a core layer and saved myself a bunch of time, but I think the "batteries included" approach is something that helped make Kobweb easier to pick up for new users who just wanted to get started ASAP. Hope that clarifies things. If you confirm that makes sense, I'll revisit the docs and see if I can explain this earlier.
πŸ‘ 1
Kilua also gives you some additional, advanced components.
Silk is still woefully underdeveloped in the components department. Hopefully we see an acceleration of development in that area early next year. You can see the list of components offered by Chakra UI (https://v2.chakra-ui.com/docs/components) and assume that many of these will make their way into Silk eventually.
πŸ‘ 1
Oh and congrats @Shubham Singh on your Spotify clone. It looks like a clean, beautiful project.
πŸ™Œ 1
r
@David Herman Thanks for explanation!
πŸ‘ 1
s
Oh and congrats @Shubham Singh on your Spotify clone. It looks like a clean, beautiful project.
Thanks @David Herman, currently I'm attempting to recreate the YouTube web app using Kobweb to learn more about the framework πŸ˜„
πŸ‘ 2
d
Wow @Shubham Singh I love the way you approach learning! Feel free to ping #C04RTD72RQ8, my discord, or DM me if you have any questions or feedback. ✌️
πŸ™Œ 1