i am working on a Kotlin Multiplatform web framewo...
# multiplatform
s
i am working on a Kotlin Multiplatform web framework and am looking for people who are interested in collaborating / sharing ideas 🙂
n
By multiplatform web framework, are you referring to something like next.js or Remix, but with Kotlin for both front and back?
s
@nschulzke that's exactly what i'm referring to, yes
i love some of the patterns introduced by next.js, namely
getServerSideProps
-- and definitely the patterns introduced by remix
i feel like we should have a powerful equivalent in kotlin!
n
I'm very interested in this space. I haven't learned either of those frameworks, just watched demos and read docs, but I agree that Kotlin deserves one.
s
@nschulzke well i'd love to get your thoughts or if you want to try a code sample and give any feedback, I would be very thankful 🙂
i have a library going and it works, it just isn't quite there yet on the JS layer
providing a shim for Node compatibility is rather difficult
n
I suspect the specifics of the next.js and Remix APIs won't translate well into Kotlin—I think of how bad the boilerplate is it Kotlin React—but I'd love to see a web framework with the same capabilities done in a Kotlin way. Key features I'd like to see: SSR capabilities (but not just a Rails, it should be able to do both SSR and SPA style) A programming style that emphasizes building features over partitioning client and server.
Personally I wouldn't try to shim for node compatibility. I think you can cover a lot more ground a lot faster if you assume jvm on the server and the browser for the client. As much as possible can be written in the common code, but I don't expect a lot of people to want to compile Kotlin to run on node, when the jvm already does such a good job at server code.
But that's assuming that you're not trying to use react or other JavaScript libraries on the server.
s
@nschulzke you are correct about that, they don't perfectly translate
but i think if i share the architecture you'll see what i mean
and yes, it is definitely early for now, as in Kotlin JS only supports ES5 as an output target anyway, which will need to improve to make it a real framework contender.
but the K2 compiler / new JS IR compiler lays the groundwork for that so i think it is time to take the wraps off.
it's actually already working with SSR 🙂 including react
i agree re/node support, and my intent is not to support it wholly, but rather just for the SSR portion of what React or a similar framework needs to execute
and, sorry, to clarify, i am assuming JVM on the server -- but to execute React server side, we need a JS runtime with certain support.
@nschulzke so we agree lol