If React Native is able to recreate "native" UI on...
# compose-web
d
If React Native is able to recreate "native" UI on both Android and iOS, just by specifying the UI once in Javascript, is there any specific reason why Compose Multiplatform wouldn't eventually be able to recreate HTML UI on the Web?
j
Because the DOM, CSS, and even mixing in JS cannot replicate the capabilities of Compose UI
💯 1
React Native's built-in components baseline all functionality to the least-capable platform which is the web.
If you wanted native UI on each platform you would have to abstract components at a much higher level of abstraction than the hyper-reusable, low-level components of today.
d
Thanks for the answer, I see what you mean. In the world of today, where AI is able to understand patterns in a very unseen way, cannot we maybe foresee that Compose-to-HTML compilation will eventually be possible?
j
no
1
😄 2
a
Some people just use Kobweb instead of the Compose Web even in a multiplatform setup: https://www.linkedin.com/posts/dhavalshah53_kobweb-composemultiplatform-kotlinmultiplatform-activity-7337360426235576320-GNWL
a
@Artem Kobzar I wonder can we import kobweb into 1 kotlin compose multiplatform project in idea or it needed to be in 2 projects.
a
@David Herman ^^
d
@Adam Tang I wonder can we import kobweb into 1 kotlin compose multiplatform project in idea or it needed to be in 2 projects.
I might be misunderstanding what you want to do here, but I'll answer the question I think you're asking. If I am answering the wrong question, feel free to clarify further 🙂 It's best to keep your Kobweb site codebase in its own module. The Gradle build scripts are different between a Kobweb project and a C4W project (e.g. they apply different plugins), and Kobweb treats some folders as having special meanings (e.g.
pages
,
resources/public
,
resources/markdown
,
.kobweb
) and it also generates boilerplate (e.g.
index.html
) which might clash with what C4W wants to do. But if you're asking if you could have a Kobweb project in the same workspace as Android, iOS, and Desktop projects using CMP, then sure, of course that's totally fine.
a
@David Herman Thanks for the reply. I am trying to use expect/actual to unify UI for compose multiplatform for Android, iOS and compose HTML. Just wonder can use my libraries inside kobweb and in the same workspace or not out of curiosity.
d
@Adam Tang Ah if you're asking if you can have an CMP module and a Kobweb module in the same workspace, then yes you can. We have a very rudimentary IntelliJ plugin for now, but one day we want to support to it so that you'd be able to create a Kobweb site / library within your workspace inside the IntelliJ IDE. Issue: https://github.com/varabyte/kobweb-intellij-plugin/issues/20 For now, here's the recommended workaround for how to add a Kobweb site to an existing workspace, from the official docs, which unfortunately is a little manual at the moment: https://kobweb.varabyte.com/docs/guides/existing-project
❤️ 2