John O'Reilly
10/12/2022, 12:58 PMNorbi
10/12/2022, 8:49 PMe: java.lang.IllegalStateException: Provide file symbol
at org.jetbrains.kotlin.backend.common.serialization.IdSignatureDeserializer.deserializeFileIdSignature(IdSignatureDeserializer.kt)
at org.jetbrains.kotlin.backend.common.serialization.IdSignatureDeserializer.deserializeSignatureData(IdSignatureDeserializer.kt:90)
Have you seen something similar, or do you have an idea?
(I use Kotlin 1.7.10 + Compose/Web 1.2.0 + Idea Kotlin plugin 1.7.20)
My workaround is to do a clean build or to disable incremental JS compilation :(David Herman
10/13/2022, 3:15 AMUncaught Error: Error loading module 'site'. Its dependency 'androidx-runtime' was not found. Please, check whether 'androidx-runtime' is loaded prior to 'site'
Anyone else seeing this? I'll drop more details in a 🧵Ivan Prykhodko
10/14/2022, 11:23 AMIvan Prykhodko
10/14/2022, 11:27 AMNorbi
10/14/2022, 12:49 PMmargin: auto
?
Currently I use this:
property("margin", "auto") // Somehow: margin(auto) ???
Thanks.Erik
10/16/2022, 2:05 PMStyleSheet
if I have defined a style class val x by style {}
and I want to apply it to a raw selector, e.g. a <button>
, is that possible? For example:
object MyStyleSheet : StyleSheet() {
val x by style {}
init {
"button" by style {
// Here apply class x from above
}
}
}
My use case: define 1 style class for round corners and apply that class to the various elements that I want to style like that. Maybe I need a different approach, I'm open to suggestions.Erik
10/16/2022, 3:09 PM@Composable
fun MyComposable(vararg composables: @Composable () -> Unit) { /* impl */ }
Now I want to let the caller pass some styling also, so I refactor it to:
@Composable
fun MyComposable(
attrs: AttrBuilderContext<HTMLDivElement>? = null,
vararg composables: @Composable () -> Unit
) { /* impl using a div that applies attrs */
}
Now all my code no longer compiles, because wherever I used to call e.g.
MyComposable(
{ /* Some composable */ },
{ /* Some composable */ },
)
now suddenly the first lambda is used as the attrs
parameter! It doesn't compile, luckily, because it's not allowed to call a @Composable
function from a non-composable context: the AttrBuilderContext
happens to be a lambda that @Composable () -> Unit
fits into... 🤦♂️ A coincidence, but one that will likely happen to more users.
The workaround beats the purpose of using a lambda in the first place:
MyComposable(
composables = arrayOf(
{ /* Some composable */ },
{ /* Some composable */ },
)
)
This works, and is not nice. See also this thread.Sebastien Leclerc Lavallee
10/17/2022, 4:06 PMdata class UserProfile(var name: String, var email: String, var password: String)
Inside my view model, I have something like that:
class ViewModel {
var userProfile by mutableStateOf(UserProfile())
}
And now I use it like that:
fun EditProfileScreen(viewModel: ViewModel) {
TextInput(value = viewModel.userProfile.email, attrs = {
onInput { viewModel.userProfile.email = it.value }
}
}
Now, from what I experienced / understand, if I modify a field from my user profile, I can’t modify it directly like I did.
I would have to do something like that:
viewModel.userProfile = viewModel.userProfile.copy(email = newEmail)
I need to copy the whole object because Compose won’t be able to detect a change and won’t trigger a recompose. And when copying, it’s a new object and this will recompose.
Now is the copy way of doing thing would be the best way? Or should I do expand my UserProfile with multiple state like:
class ViewModel {
private var userProfile = UserProfile()
var email by mutableStateOf(userProfile.email)
var name by mutableStateOf(userProfile.name)
}
And edit them directly and when I click save, I would get the current value from all states.
Or have states as read only and then have setter function to update the main class:
val email by mutableStateOf(userProfile.email)
private set
fun setEmail(newEmail) {
userProfile.email = newEmail
email = newEmail
}
Or is there any other way of doing this that I don’t think of?
Thanks! 🙂Erik
10/17/2022, 8:11 PMjsBrowserDistribution
(produces ./build/distributions/) still the way to publish a compose website? I think so, but it's not very well documented AFAI can findKristian Nedrevold
10/18/2022, 2:01 PMNorbi
10/22/2022, 6:29 PMDragos Rachieru
10/24/2022, 1:56 PMonWasmReady is not defined
I searched the examples and they look like I need to use webpack 4.9.0
When I set that version, I get a new error:
cli.isMultipleCompiler is not a function
Erik
10/29/2022, 8:06 AMMyVariables.contentBackgroundColor(Color("blue"))
seems impossible. Do I need to import anything? I can't find a setter/`invoke` operator in the source either. Was it removed?Erik
10/29/2022, 9:02 AMBig Chungus
11/01/2022, 3:38 PMAndromadus Naruto
11/04/2022, 3:18 PMLoboda Deni
11/07/2022, 10:32 AMandylamax
11/07/2022, 3:45 PMJeff Lockhart
11/09/2022, 5:06 PMSam Stone
11/09/2022, 7:35 PMFunkyMuse
11/11/2022, 8:13 AModay
11/11/2022, 9:22 AModay
11/11/2022, 9:23 AMModifier
, the main goal is to use a Composable component that I made elsewhere, here on webLoboda Deni
11/11/2022, 12:09 PMCLOVIS
11/11/2022, 7:24 PMtheapache64
11/16/2022, 5:27 AMjeff
11/16/2022, 8:09 PMimages.forEach { Img(image.url, ...) }
Now, I change images, and get a recomposition. What's the recommended way to make the Img
s slide into their new position instead of instantly popping? I tried adding some css transitions but no luck.Erik
11/16/2022, 10:40 PMCLOVIS
11/19/2022, 11:37 AMCLOVIS
11/19/2022, 11:37 AMandylamax
11/19/2022, 3:23 PMCLOVIS
11/19/2022, 4:50 PM