Norbi
10/02/2021, 7:27 AMNorbi
10/03/2021, 3:11 PM@Composable
`fun`s work with Compose/Web?
I get internal compiler error in case of this function:
@Composable
fun <T> MySelect(
options: List<T>,
onChange: (T?) -> Unit
) ...
If I remove the generic type parameter (and replace T
with Any
in the parameters) then it compiles.
Kotlin: 1.5.31
Compose/Web: 1.0.0-alpha4-build366
Error message:
java.lang.IllegalStateException: FULL: FUN name:MySelect$composable visibility:public modality:FINAL <T> (options:kotlin.collections.List<T of ...component.MySelect$composable>, onChange:kotlin.Function1<T of ...component.MySelect$composable?, kotlin.Unit>, $composer:androidx.compose.runtime.Composer?, $changed:<http://kotlin.Int|kotlin.Int>) returnType:kotlin.Unit
Ir: ...component#MySelect$composable(kotlin.collections.List<0:0>;kotlin.Function1<0:0?,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int){0�<kotlin.Any?>}
Descriptor: ...component#MySelect$composable(kotlin.collections.List<0:0>;kotlin.Function1<0:0,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int){0�<kotlin.Any?>}
Norbi
10/07/2021, 3:48 PMjulien lengrand-lambert
10/08/2021, 1:56 PM> Task :jsBrowserDevelopmentRun FAILED
[webpack-cli] Unable to load '@webpack-cli/serve' command
[webpack-cli] TypeError: options.forEach is not a function
[webpack-cli] TypeError: options.forEach is not a function
julien lengrand-lambert
10/08/2021, 1:57 PMjulien lengrand-lambert
10/08/2021, 5:00 PMsalomonbrys
10/11/2021, 9:00 AMLeoColman
10/11/2021, 12:23 PMindex.html
file.David Herman
10/15/2021, 5:53 PMjava.lang.AssertionError: No such value argument slot in IrCallImpl: 4 (total=4).
So my question: Am I just publishing my library wrong? (Because with multiplatform, maven-publish just worked, but with Kotlin/JS, I'm setting it up myself). Or is this a fundamental requirement of all Compose library artifacts that they need to be multiplatform modules, for technical reasons behind the scenes that require a common artifact AND a JS artifact be created?LeoColman
10/17/2021, 2:24 PMTomáš Hubálek
10/18/2021, 1:04 PMkotlinx.browser
classes. So should i use js()
to all the stuff?Scott Kruse
10/19/2021, 11:16 PMSean Proctor
10/20/2021, 12:38 AMGreg Steckman
10/23/2021, 2:11 AMText(" ")
it gets rendered as
That's not an unreasonable thing to do - but how can I insert a non-breaking space?Draget
10/23/2021, 7:55 AMMarius Ailinca
10/24/2021, 9:31 AMLeoColman
10/24/2021, 12:08 PM@font-face
?David Herman
10/26/2021, 11:10 PMSam Michael
10/27/2021, 6:11 AMhover()
and
onMouseOver { println("moused over") }
but neither seem to be working. Anyone have any experience with this?paoloconte
10/30/2021, 12:20 PMOmar Miatello
10/30/2021, 1:12 PMjsRun
• the Offset class is missing in the SVG api, it would be useful in the Polyline
• transformations cannot be applied (rotate, translate, ...)
• positioning text correctly is always complicated, it’s different from Compose for Android, and even there, it’s not easyAlexander Suraphel
11/02/2021, 3:23 PMBrian G
11/04/2021, 10:37 AMexternal interface BwipJs {}
external fun <Module : Any> import(path: String): Promise<Module>
@Composable
fun Barcode() {
val bwip = remember { mutableStateOf<BwipJs?>(null) }
LaunchedEffect(Unit) {
bwip.value = import<BwipJs>("bwip-js").await() // ClassCastException
}
}
Outside of Compose, in plain Kotlin/JS, the import works fine, and I'm successfully calling functions (rendering barcodes) using the BwipJs handle, e.g.
val canvas = document.createElement("canvas") as HTMLCanvasElement
import<BwipJs>("bwip-js").then { bwipjs ->
bwipjs.toCanvas(canvas)
}
Tomáš Hubálek
11/04/2021, 2:33 PM.css
file into StyleSheet()
. Most of the stuff works, but I don't know how to correctly convert rules like this
.classA.classB {
}
which means element that has both .classA
and .classB
assigned.
I looked into https://github.com/JetBrains/compose-jb/blob/master/tutorials/Web/Style_Dsl/README.md but it looks like it can only be achieved in init{}
section using string names of the classes.
Any clue? ThanksBrian G
11/04/2021, 4:24 PMTomáš Hubálek
11/05/2021, 9:18 AMAppStyleSheet
produced? In Chrome developer I can see this, but when I click on <style>
it shows empty element. When using .css
files then it is clearly visible from where concrete rule comes.Tomáš Hubálek
11/05/2021, 2:47 PM@import
into AppStyleSheet
?LeoColman
11/05/2021, 5:07 PMandylamax
11/07/2021, 9:53 AMTomáš Hubálek
11/08/2021, 10:00 AMStyleSheet
class ?
Or I have to use
width("calc(" + AppStyleSheetVariables.myVar.value() + " ... )")
?Tomáš Hubálek
11/08/2021, 10:00 AMStyleSheet
class ?
Or I have to use
width("calc(" + AppStyleSheetVariables.myVar.value() + " ... )")
?Brian G
11/08/2021, 2:56 PMcalc
will be used automatically if you add incompatible units together, like: `
width(100.percent + 10.px)
Akif Abasov [JB]
11/08/2021, 3:23 PMTomáš Hubálek
11/08/2021, 3:50 PM