https://kotlinlang.org logo
#doodle
Title
# doodle
c

Constantin Birkert

10/30/2023, 4:32 PM
somehow a little dumb question. How can i embedd a doodle app into an existing kotlin-react app in a kotlin mpp project? I haven't found any kind of example for this and i couldn't figure out how to get the parent HTMLElement of the right type in the kotlin/js main function.
n

Nick

10/30/2023, 7:15 PM
you can pass an HTMLElement to the application function. this will host the Doodle app within that element. so as you mentioned, you’ll need to figure out how to get an element from within your react app. i don’t have any experience with kotlin react, so i’m not sure how to access the dom with it. but i imagine it’s something like how you do it with react in JS.
🙌 1
c

Constantin Birkert

11/06/2023, 10:02 AM
The issue for my understanding was that you couldn't use the web.dom version of a HTMLElement so you need to use the old org.w3c HTMLElement. Will doodle someday will support both? Or when does doodle get an kotlin version upgrade? 😄 thanks for the fast response!
n

Nick

11/06/2023, 11:05 AM
glad to hear that helped. i’m actually not aware of the HTLMElement type used being old. it seems to be the only one the standard library supports. can you point me to documentation for web.dom version you mentioned? the next version of Doodle (0.10.0) will support the latest Kotlin version. are there specific things you’d like to see adopted with the new version? also, i’d love to hear more about your use case(s). and any feedback (what’s not working well or what is) would be really appreciated.
c

Constantin Birkert

11/07/2023, 3:03 PM
I already build an ISA Emulator for the web, which has a quite complex logic and uses the kotlin-react wrapper for the ui. Besides the kotlin-react wrappers there is another kotlin-browser wrapper which includes some similar functionality (kotlin-wrappers for js) like the kotlin stdlib. The destination for the web app is to unify the logic used by the logic of the emulator and compile it to webassembly to make it more performant and make use of real coroutines. There for i need another ui. The ui can get quite complex to when we talk about pipeline emulation and so i instantly thought of doodle 😄. Right now i'm slowely trying to switch from the react UI to doodle to make the project independent of js wrappers (react, emotion, ...). That would automatically solve my issue but in the mean time to get to know doodle i thought of integrating certain ui components in doodle before fully switching to webassembly. (I'm also a little confused is doodle running in wasm or js rn? :D) Thanks for your time. Really appreciating that project :D
👍 1
n

Nick

11/07/2023, 4:05 PM
got it. this makes sense. let me know what you think of doodle’s performance as you use it more. right now the web target runs in js, not wasm. but there is a desktop (jvm) target as well. is your interest in wasm mainly for performance? might be time for me to start exploring adding wasm support as well.
c

Constantin Birkert

11/07/2023, 4:17 PM
i mean getting the opportunity to render ui vector based on kotlinjs is already a big thing but adding wasm support would open a lot of opportunities for developing complex desktop and web applications at the same time. I would really love seeing doodle as the alternative for desktop and web development besides compose which hardly focuses mobile app development. 😄 For my case besides performance kotlin js is a nice target to use. But i really would love to get a performance upgrade with a more complex UI besides finally having the opportunity to really split ui from other processes with the help of better coroutine support. While i'm integrating doodle for my web app a desktop target besides that is intended. Really looking forward to that framework. : D
👍 1
2 Views