is there anything like Svelte that compiles down t...
# javascript
b
is there anything like Svelte that compiles down to maybe plain webcomponents that can be called and used from JS code like native HTML elements?
1
a
b
this looks like a react sort of framework
or does kobweb compile down to reusable web components?
a
it compiles down to HTML/CSS/JS without virtual DOM
b
so can you create a component in kobweb and for instance reuse it in a handlebars template inside another JS app?
a
No, you can't, components are just inlined and the JS is mangled in the bundle, I think that you can compile JS to one JS file per Kotlin file, but that's all, and the HTML/CSS isn't separated
But you should ask that to @David Herman
b
thank you
my use case is integrating with some sort of MVC JS frameworks that renders out HTML using handlebars
there is a lifecycle model built in that publishes data over websockets, so interacting with it natively is a bit of a pain
a
you shouldn't try to mix very different technologies in my opinion, if it work it will probably an unstable hack
b
so being able to for example extract a tab component built in Kotlin and reusing it in JS without any sort of interop issues would be the ideal use case I think
the other devs that try to interop with that model are right now looking at svelte because it's self contained and can be used without a massive overhead like vdom
d
Thanks for looping me in @Ayfri. I actually haven't experimented too much with generating JS output that can be used in other projects (outside of being aware that it is possible). That said, I'm not sure if Silk would work for this use-case. Kobweb as a framework is definitely too heavy -- it wants to own and manage your application, You can use Silk widgets without Kobweb, though, and there may be a path forward there. But I haven't tried it.
👍 1
b
thanks, so I suppose the way to do that would probably be to write a small wrapper around web components in that case
d
Are you trying to consume JS in your Kotlin project or the other way around?
b
both; basically I subclass an Application class which renders a popup and return a JS object which is then rendered into an associated handlebars template
d
Maximum pain, got it!
b
since there's not a really good way to control rendering, just including the component in the handlebars template would be completely transparent
d
Yeah apologies then, I'm not sure.
b
still, thank you for answering, that helped me to narrow down what I need
d
NP, good luck!