> Not registering component style `val Style`, ...
# kobweb
f
Not registering component style
val Style
, as only top-level component styles are supported at this time
I was trying to make namespace for variants with top-level
object
😢
d
Yeah I want to allow object namespacing eventually, but keep in mind the names would still need to be globally unique
f
And what is the reason for this restriction? That objects are lazily initialized?
d
Oh, just code complexity
Er wait
You mean the name restriction?
f
Nono, the
Not registering component style
val Style
, as only top-level component styles are supported at this time
d
Yes that's just laziness
f
😄
Fair enough
d
Basically the code I have now needs to check that the property is a singleton
If defined at the top level, that's fine! We're done
If it's defined in a class or in a method, that's not ok
But I should check that IF I have parents AND of they are all objects, that should be ok. Then I have to pass the fully qualified path (including objects) on
f
Ah, makes sense. I thought you need all the styles executed eagerly and
objects
are problematic
d
After you run
kobweb run
do a search in your
build
directory for
main.kt
You'll see what I'm doing then 🙈
f
Oooh, I see. You register everything on start to global context
d
Yep!! 🔨