I've just tested out a very simple React app modul...
# javascript
e
I've just tested out a very simple React app module. Overall it feels good with typesafe HTML and CSS. With 1.9.20-Beta2, I can't seem to get auto/live-reload to work with
jsBrowserDevelopmentRun
tho. Is this a known issue?
t
Is it fine with
1.9.10
?
Do you use
-t
flag?
e
@turansky with 1.9.10 I just use
gradle jsBrowserDevelopmentRun
. It seems Webpack handles reloading? I can see it printing stuff on the console. With 1.9.20 it doesn't work anymore, and I'm forced to use
-t
Although thinking about it now, Webpack can't really reload changes by itself. It needs a kotlinc pass first, so the
-t
makes sense to be there always
@turansky one thing the kotlin-wrappers readme doesn't mention is the various ways CSS can be used. What I've seen is only "inline" CSS via DSL, but what if I want to include a
.css
or
module.css
file, to keep styles separate? Is that possible using kotlin-react?
t
It's possible via
import
function, but with zero IDE support
e
With this one? Zero IDE support seems what you'd have with a TS React project too, so no big deal
t
With this one?
Yes
Zero IDE support seems what you'd have with a TS React project too, so no big deal
You can configure plugins, which will help you with class names autocomplete
e
That's something I can have a look at. Do you have a reference plugin in mind? Shouldn't be hard to adapt it and offer autocompletion based on Kotlin PSI elements
t
PSI looks like redundant, you can generate
.kt
files with class names instead
e
Seems too elaborate to me. With an IJ plugin it is fairly straightforward to add reference resolution (and thus autocompletion)
Maybe with the new K2 compiler integration for IDEA, a compiler plugin to generate fields on the fly is a better idea tho
t
File generation works fine right now
👀 1
e
@turansky another approach could be to have global/shared CSS styles in Kotlin code, with kotlin-css or kotlin-emotion. Would that be possible?
t
Example required