https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
javascript
  • l

    Laurent Laborde

    09/05/2022, 3:25 PM
    i posted a solution (as “ker2x”) here, feel free to correct me if i was wrong https://stackoverflow.com/questions/72355092/when-using-kotlinx-htmls-dsl-to-create-html-how-is-it-possible-to-refer-to-t/73611632#73611632
    a
    3 replies · 2 participants
  • t

    Tom Yuval

    09/08/2022, 2:12 PM
    I’m looking for help understanding why some code I’ve written – which relies on weak references to attest garbage has been collected – works as expected when using the Legacy backend, but fails when using the IR backend. More details inside the thread.
    1 reply · 1 participant
  • m

    mbonnin

    09/11/2022, 5:53 PM
    Can the 1.6 JS compiler read files generated with 1.7 and
    languageVersion=1.5
    ?
    b
    h
    10 replies · 3 participants
  • p

    patrickdelconte

    09/12/2022, 8:41 AM
    Is there still a maven plugin for js? I know there used to be with 1.0 or 1.1 but nowadays maven is barely mentioned on the docs page
    b
    5 replies · 2 participants
  • r

    Robert Jaros

    09/12/2022, 3:47 PM
    message has been deleted
  • e

    epool

    09/12/2022, 6:19 PM
    hi, do you know if there is some article/post/plugin for publishing a kotlin/js library to npm? I was using npm-publish but it seems like it uses the module name(in my case is something like
    SomeLibrary
    ) instead of the base name from
    js(IR) { moduleName = "some-library" ... }
    and when I want to publish to npm I’m getting this error
    npm ERR! 400 Bad Request - PUT <https://registry.npmjs.org/SomeLibrary> - "SomeLibrary" is invalid for new packages
    where I would expect to publish it with the
    moduleName
    I defined form the js gradle block. A “workaround” was to rename my module to
    SomeLibrary
    to
    some-library
    but since I’m also targeting iOS I need to have it like
    SomeLibrary
    since iOS doesn’t support names like
    some-library
    . Thank you in advance!
    s
    b
    18 replies · 3 participants
  • n

    Nick

    09/15/2022, 3:54 PM
    Doodle 0.8.2 Released (https://github.com/nacular/doodle/releases/tag/v0.8.2) New Cassowary based Constraint Layout This release includes a new layout engine that will soon replace the current constraint based layout. This new implementation is based on the well known Cassowary algorithm and is therefore much more expressive and capable. The new implementation has a very similar API to the current one, so migration is less difficult. But there are key differences that mean current constraints won't always translate exactly. The new API is located in the
    io.nacular.doodle.layout.constraints
    package. Form Controls • New
    singleChoiceList
    for choosing a single item like
    radioList
    offers • New
    optionalSingleChoiceList
    for choosing zero or one item like
    optionalRadioList
    offers Better render performance
  • m

    martmists

    09/16/2022, 6:39 PM
    How can I produce an IIFE binary from Kotlin/JS with a default export?
    t
    4 replies · 2 participants
  • t

    turansky

    09/17/2022, 11:47 AM
    Example projects: • https://github.com/karakum-team/kotlin-react-table-sample • https://github.com/karakum-team/kotlin-mui-showcase
    m
    3 replies · 2 participants
  • a

    andylamax

    09/18/2022, 2:22 AM
    Just bringing this to light once more 🤞🏾 Another pain points of dealing with kotlin/js is the kotlin collections and these are reasons Clarification: By collections, I mean the following implementations or abstractions • The
    Collection
    and
    MutableCollection
    interfaces • The
    List
    and
    MutableList
    interfaces • The
    Set
    and
    MutableSet
    interfaces • The
    Map
    and
    MutableMap
    interfaces 1. The collections are not marked with
    @JsExport
    making their consumption from JS/TS extremely difficult 2. There is no easy way to convert an instance of either of these collections to their native collection counterpart data structures (
    List
    ->
    Array
    ,
    Set
    ,
    Map
    ) We are currently wrapping these Collections to make them easy to use, but it feels inconvenient to have yet another wrapping of these basic building blocks of almost any library/application. We have expect/actuals in place so that we only do the wrapping in JS targets but that does require different builders to construct the said collections. This is very confusing especially for people joining the team We tried using
    Array
    in favor of
    List
    but they don't play well as properties for data classes. I know the team is currently focused on the compiler right now, but I would like to shed light one more time on how little things like these are also a crucial part of a language (at least its standard library).
    e
    t
    +1
    20 replies · 4 participants
  • m

    martmists

    09/18/2022, 4:25 PM
    I'm trying to write externals for a library (
    decky-frontend-lib
    ) but I'm strugging a bit as there's a lot of types that don't seem to exist in Kotlin like RouteProps, Omit, etc. How would I approach this? I already went ahead and replaced all instances of
    JSX.Element
    with
    ReactElement<*>
    t
    7 replies · 2 participants
  • k

    Keith Miller

    09/18/2022, 5:24 PM
    Hello! I am using the
    kotlin-mui
    wrapper and noticing that
    component
    is missing as a prop on some components. Was hoping to be able to set the
    component
    to
    react.router.dom.Link
    to use with the router. Was wondering if there was a work around possibly?
    t
    12 replies · 2 participants
  • j

    Joshua Hansen

    09/18/2022, 8:54 PM
    I'm trying to implement a proof-of-concept react app with Kotlin/JS and react. Ideally, I want to use only kotlin code. The app is for a 3rd party website and sits inside an iframe. The 3rd party provides a JavaScript API by means of including a script in the HTML body. In my react app, is it possible for kotlin/react to "see" this JavaScript code which is included in the index.html file? In a normal react app, I can reference this api without any require statements. Simply including the script tag in the HTML exposes everything to other JS files.
    t
    4 replies · 2 participants
  • z

    Zaki Shaikh

    09/19/2022, 2:37 AM
    Hi, I wanna learn Kotlin/JS React I am an Android developer using Kotlin, Please let me know that what are the best resources to start.
    a
    1 reply · 2 participants
  • j

    Joshua Hansen

    09/19/2022, 7:41 AM
    If I have a JS function that takes any other function as a parameter, how do I specify that as a kotlin function? My guess would be something like this
    external fun highOrderFoo(bar: (dynamic) -> dynamic): Promise<Json>
    But what if
    bar
    is a function that takes multiple params?
    n
    t
    2 replies · 3 participants
  • b

    bashor

    09/19/2022, 4:56 PM
    https://kotlinlang.slack.com/archives/C01CSNG1HJ4/p1662548321731789
  • g

    georgi

    09/20/2022, 7:24 AM
    ❓ Hi there! Is adding a dependency as
    implementation
    currently the same as
    api
    on KotlinJS using the IR compiler? Documentation says standard gradle dependency declarations are supported. Example: I have 3 modules with the following dependency graph:
    appJs
    ->
    modulea
    ->
    moduleb
    , where I use
    implementation
    for linking between the modules. So
    modulea
    declares
    implementation(project(":moduleb"))
    . However, I can still access code within
    mobuleb
    from
    appJs
    which means that it's being leaked.
    7 replies · 1 participant
  • m

    martmists

    09/20/2022, 10:14 PM
    I'm trying to add typings to a library, but it uses CustomEvent<T> while the kotlin API for org.w3c.dom does not make it a generic type. Why is this the case? If there is no defined type, Nothing could be used, no?
    t
    2 replies · 2 participants
  • p

    PHondogo

    09/23/2022, 7:44 AM
    Hello! Is there IdentityHashMap implementation for JS target?
    t
    1 reply · 2 participants
  • j

    Joshua Hansen

    09/23/2022, 8:13 AM
    I'm working with a large API which returns JSON response data. If I don't want to make wrapper classes for all the possible API response formats, is the best way to just use
    val data = getData().await().asDynamic()
    val someJsonProp = data.propName as Int
    Or is there a better way?
    b
    1 reply · 2 participants
  • n

    Nathan Tamez

    09/23/2022, 11:04 AM
    Hi, I have a question about Kotlin/JS IR, can we generate source maps or it that not supported by the IR compiler?
    h
    1 reply · 2 participants
  • p

    PHondogo

    09/23/2022, 8:18 PM
    Can someone suggest me where to dig to solve 'duplicate library name: ' problem?
    b
    6 replies · 2 participants
  • k

    Kristian Nedrevold

    09/24/2022, 5:52 PM
    How can i set the kotlinjs hot reload to reload on save and not on code changes? As it is now it is reloading while I am editing.
    m
    2 replies · 2 participants
  • m

    Moussa

    09/25/2022, 5:12 AM
    Hey guys, Can someone suggest to me a way to investigate the
    jsTest
    Gradle command running on a unit test function that does a lot of math operations and it pass in all other platforms except JS (Browser & NodeJS)
  • b

    Big Chungus

    09/26/2022, 9:39 AM
    Just compile it in ide and copy paste into web editor 😀
    c
    j
    4 replies · 3 participants
  • m

    Moussa

    09/26/2022, 11:33 AM
    Hey guys, Any clue why I’m getting this error or at least how to investigate it
    .gradle/nodejs/node-v16.13.0-darwin-arm64/bin/node' exited with errors (exit code: 1)
    b
    v
    7 replies · 3 participants
  • m

    Mircia George

    09/28/2022, 10:47 AM
    👋 Hello, team!
  • m

    Mircia George

    09/28/2022, 10:49 AM
    Can someone explain how this code for material ui checkbox should be converted to kotlin/js?
  • m

    Mircia George

    09/28/2022, 10:49 AM
    const BpIcon = styled('span')(({ theme }) => ({ boxShadow: theme.palette.mode === 'dark' ? '0 0 0 1px rgb(16 22 26 / 40%)' : 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)', backgroundColor: theme.palette.mode === 'dark' ? '#394B59' : '#F5F8FA', backgroundImage: theme.palette.mode === 'dark' ? 'linear-gradient(180deg,hsla(0,0%,100%,.05),hsla(0,0%,100%,0))' : 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))', '.Mui-focusVisible &': { outline: '2px auto rgba(19,124,189,.6)', outlineOffset: 2, }, 'input:hover ~ &': { backgroundColor: theme.palette.mode === 'dark' ? '#30404D' : '#EBF1F5', }, 'input:disabled ~ &': { boxShadow: 'none', background: theme.palette.mode === 'dark' ? 'rgba(57,75,89,.5)' : 'rgba(206,217,224,.5)', }, })); or this one const theme = createMuiTheme({ overrides: { MuiCheckbox: { colorSecondary: { color: '#custom color', '&$checked': { color: '#custom color', }, }, }, }, });
    t
    1 reply · 2 participants
  • m

    Mircia George

    09/28/2022, 6:19 PM
    I have another question (sorry). How can I generate a kotlin/js library that I can use in a separate react project?
    b
    4 replies · 2 participants
Powered by Linen
Title
m

Mircia George

09/28/2022, 6:19 PM
I have another question (sorry). How can I generate a kotlin/js library that I can use in a separate react project?
b

Big Chungus

09/28/2022, 10:18 PM
Kotlin.js.binaries.library() Then look for your js output in build/productionLibrary after build execution
I've also written petuska.dev/npm-publish to make customization easier
m

Mircia George

09/29/2022, 5:14 PM
ok, Thanks
b

Big Chungus

09/29/2022, 5:18 PM
Let me know if that made little sense and I need to elaborate 😀
View count: 3