Martin Gaens
04/22/2022, 7:55 AMList
of `HTMLDivElement`s:
val questionDivs = document.querySelectorAll("div[id^='question']").asList().map { it as HTMLDivElement }
Then, if I print it out to the console, by using console.log(questionDivs)
, it prints out just fine. If I print out the size of this List
, by using console.log(questionDivs.size)
, it prints out the size of the List
(in my case 11).
But if I try to loop over the List
by using either a foreach loop or by using the .forEach { }
method, it isn't being run not even once.
This is what gets printed out when doing `console.log(questionDivs)`:
https://paste.pics/GR0JSMartin Gaens
04/22/2022, 4:50 PMmike.holler
04/22/2022, 9:23 PMNumber
type in Kotlin? Number
is kotlin.Number
, which is not what I want. Is there a javascript.Number
or something?Benjamin Charais
04/23/2022, 11:31 PMAkram Bensalem
04/24/2022, 12:12 PMgabin
04/24/2022, 1:45 PMmike.holler
04/25/2022, 8:24 PMKonyaco
04/26/2022, 10:45 AMimplementation(npm("@types/mojang-gametest", "^0.1.3", generateExternals = true))
implementation(npm("@types/mojang-minecraft", "^0.1.3", generateExternals = true))
implementation(npm("typescript", "^4.4.3"))
implementation(npm("gulp", "^4.0.2"))
implementation(npm("gulp-typescript", "^6.0.0-alpha.1", generateExternals = true))
implementation(npm("del", "^6.0.0"))
Problem 1
Here are excerpts from @types/mojang-minecraft
dependency:
export class MinecraftItemTypes {
static readonly 'air': ItemType;
static readonly 'apple': ItemType;
// ...
static readonly 'item.acaciaDoor': ItemType;
static readonly 'item.bed': ItemType;
}
There are some fields which have a .
in their name. And they are converted to:
external open class MinecraftItemTypes {
companion object {
var item.acaciaDoor: ItemType
var item.bed: ItemType
var item.beetroot: ItemType
}
}
They can not be compiled, should they be converted like this?
var `item.acaciaDoor`: ItemType
Also, the TS uses readonly
keyword, I'm not familiar with TypeScript, may be it should be converted to val
?
Problem 2
There are some fields, store a literal value:
export class BlockProperties {
static readonly 'active' = 'active';
static readonly 'color' = 'color';
static readonly 'direction' = 'direction';
// ...
}
They are converted to:
external open class BlockProperties {
companion object {
var active: Any = "active"
var color: Any = "color"
var direction: Any = "direction"
}
}
They are reported wrong with Wrong initializer of external declaration. Must be ' = definedExternally'
In addition, is it possible to infer the type String
?
val active: String = definedExternally
Are these bugs? How can I deal with them?🤔hfhbd
04/27/2022, 1:14 PMapi(npm("bootstrap"))
. The js files are included, but the css files are not. How can I publish the css files too, so the user does not need to import it separatly?Wyatt Kennedy
04/28/2022, 9:21 PMDavid Gonzalez
04/28/2022, 9:49 PMGoldenCow
04/29/2022, 5:21 AMWyatt Kennedy
04/30/2022, 8:36 AM@JsModule("reflect-metadata")
external val blank : dynamic
val force = blank.test
I just want the module to be included and run always. Without something like this being in the code somewhere, it never gets run and other dependencies that require it fail on load. putting the package.to.blank
in the dce keep option does not retain it. Did I miss anything in the documentation?Pavel Matusevich
05/02/2022, 12:24 AM_showAuthDialog({ nonInteractive, error, canCancel, onTryAgain }?: AuthDialogParams): void;
What would be the best way to write Kotlin definition for that function? Just to replace argument name with any valid string or..?
Just in case, AuthDialogParams definition:
interface AuthDialogParams {
nonInteractive?: boolean;
error?: Error;
canCancel?: boolean;
onTryAgain?: () => Promise<void>;
}
Thanks in advance!Alexander Stoppel
05/03/2022, 7:00 AM@JsExport
-annotated function is located in a different module? Within the same module, I would use js("myModule.myFuntion();")
which works fine but calling js("myOtherModule.myOtherFunction();")
fails since JavaScript fails to resolve myOtherModule
Is there a Gradle configuration or anything else I can do to access myOtherModule
from JS when running myModule
?thana
05/03/2022, 7:56 AMkotlin-react-css
was removed from the wrappers project (https://github.com/JetBrains/kotlin-wrappers/pull/1450) does anyone know why?thana
05/03/2022, 7:59 AMtylerwilson
05/03/2022, 1:28 PMthana
05/03/2022, 6:53 PMwillyrs
05/03/2022, 7:27 PMconfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
minimize: true
}));
EDIT: I've added
const webpack = require('webpack');
and now the error is
[webpack-cli] TypeError: webpack.optimize.UglifyJsPlugin is not a constructorthana
05/04/2022, 11:50 AM<Drawer
sx={{
width: drawerWidth,
flexShrink: 0,
'& .MuiDrawer-paper': {
width: drawerWidth,
boxSizing: 'border-box',
},
}}
How would i add these stylings to the MuiDrawer-paper class the kotlin way?bashor
05/05/2022, 2:44 PMrrva
05/05/2022, 3:42 PMsuspend fun refreshToken(token: Token)
if the cache is cold, I want to prevent to coroutines concurrently refreshing the value
I have tried some solutions
Semaphore (the coroutine aware one)
Actor-like impl with channels but without actor lib.
Are there any other simpler/more obvious solutions?Derek Ellis
05/06/2022, 1:57 PMmike.holler
05/06/2022, 4:55 PMAyfri
05/06/2022, 7:51 PMJonathan Ellis
05/06/2022, 9:27 PMAyfri
05/07/2022, 2:06 PMthana
05/08/2022, 5:14 PMInputProps={{
startAdornment: <InputAdornment position="start">kg</InputAdornment>,
}}
How do i do that in kotlinjs? i cant find any implementation of InputBaseComponentProps
Eryk Lepszy
05/08/2022, 11:02 PMEryk Lepszy
05/08/2022, 11:02 PMLuc Girardin
05/09/2022, 8:47 AMasDynamic().inputFormat = "dd.MM.yyyy HH:mm"
turansky
05/09/2022, 12:05 PMvar DatePickerProps.inputFormat: String
get() = asDynamic().inputFormat
set(value) { asDynamic().inputFormat = value }
Say NO to asDynamic()
!