I've read <https://github.com/JetBrains/kotlin-wra...
# react
r
I've read https://github.com/JetBrains/kotlin-wrappers/blob/master/CHANGELOG.md, but I'm still not sure if I should migrate away from
kotlin-react-dom-legacy
...
Are there any examples of using new (non-legacy) api?
t
p
@Robert Jaros, I just finished migrating two private repos, so I can give you my feedback. Overall the process was tedious, with over 4 000 lines edited (about 50/50 auto / manual). I had several generic functional components, and did not find out any way to use them with the new syntax (i.e. I either have to use attrs like in legacy, to define children myself with some custom builder, or to use render props). I think this is due to the lack of multiple receivers in Kotlin but it seems this could be solved soon (https://youtrack.jetbrains.com/issue/KT-42435#focus=Comments-27-4466122.0-0). I really like the new syntax and I find it much cleaner. I also appreciate that HTML elments' props and events are much more nicely typed and are all defined (e.g. there is aria). It also seems that this migration could lead to some improveements towards conditional rendering. So overall, I am satisfied with the migration even if I can't deny it was quite tedious. I now cross fingers to get multiple receivers asap or an other solution from Jetbrains' team to improve generic functional components usage.
🙏 2
😜 1
s
@Paul SOUTEYRAT thank you for feedback, we appreciate it
👍 1
t
For IR -
pre.284
is prefered (released today)
Additional bonus of new API - bundle size
csstype
- zero* runtime wrappers (all types are
external
) Intrinsic types - inlined In my project (legacy compiler) total optimization -
~300KB
😉
K 2
SVG components also here