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
  • d

    damian

    12/04/2017, 3:59 PM
    hey guys. since the jquery support in stdlib is deprecated, is there any good way to use jquery in kotlinJS? or what’s the best practice to trigger for example animations like fadeIn? just executing raw JS via
    js(...)
    seems a bit too much for that
    g
    • 2
    • 8
  • j

    jv

    12/04/2017, 9:48 PM
    Does kotlin-stdlib-js:1.2.0 require JDK 8 or anything like that?
    l
    b
    • 3
    • 2
  • j

    jv

    12/05/2017, 8:09 AM
    Yeah I said above I pulled this out of the generated file: Kotlin.defineModule('seller_main', _);
    g
    • 2
    • 1
  • g

    gaetan

    12/05/2017, 11:15 PM
    @karelpeeters https://github.com/kategory/kategory/issues/440
    k
    a
    • 3
    • 2
  • n

    napperley

    12/06/2017, 8:01 PM
    Is a temporary measure to isolate the LocalForage functions that weren't working in order to resolve issues.
    f
    • 2
    • 3
  • e

    edattore

    12/06/2017, 9:19 PM
    What's the preferred way to test drive Kotlin/JS code?
    h
    n
    c
    • 4
    • 5
  • j

    jv

    12/08/2017, 2:29 AM
    I put details in #getting-started
    g
    g
    • 3
    • 8
  • d

    Dmitry Kandalov

    12/08/2017, 11:34 AM
    [reposted] What is the recommended way to use JS array from Kotlin to
    push()/pop()
    items? This seems like a basic thing for JS interop but I did't find any obvious solutions (
    kotlin.Array
    doesn't have
    push()/pop()
    methods). The most reasonable solution I found was to define external JsArray class:
    @JsName("Array")
    external class JsArray<T> {
        val length: Int
        fun push(item: T)
        fun pop(): T
        operator fun get(index: Int): T
        operator fun set(index: Int, value: T)
    }
    (If this is the right thing to do, shouldn't it be in kotlinjs stdlib and mentioned somewhere in docs? 🤔)
    k
    s
    n
    • 4
    • 5
  • p

    patrickdelconte

    12/08/2017, 12:39 PM
    I am trying to test my kotlin/js project with mocha. I have used the build.gradle provided here https://github.com/JetBrains/kotlin-examples/blob/master/gradle/js-tests/mocha/build.gradle. The tests run and I get output on the console. However in IntelliJ the run tab says "Test events were not received", also when I attempt to click on the run button next to a method annotated with Test it says "nothing here"... any ideas what might have gone wrong?
    ➕ 1
    c
    • 2
    • 3
  • c

    Cody Sehl

    12/08/2017, 5:47 PM
    Does anyone know how I can understand what the task
    compileKotlin2Js
    does? It doesn't seem to be well documented and ideally, I'd like to find the source to see how it works, but searching for the
    kotlin2js
    plugin yields nothing
    d
    • 2
    • 7
  • c

    Cody Sehl

    12/08/2017, 11:08 PM
    Does anyone know what
    friend modules
    are?
    n
    • 2
    • 1
  • d

    dierre

    12/09/2017, 8:43 PM
    Hi, I'm experimenting with kotlin multiplatform (the js part). There is something that it's not clear to me. My goal is to port a node js project, a simple one ( https://github.com/invasionofsmallcubes/deals-bot ). The idea is to begin with the porting, isolate common code and repository interfaces on the common project, and then create the jvm version using TelegramBots (https://github.com/rubenlagus/TelegramBots). The goal is to have two running bots, the js and the kotlin one with one common business logic. I hope it's all clear up to this point. Now the question: for testing, on the node js I used jest + nock. Now I would see, as an advantage, the fact that I can use a java/kotlin mock library (I want to mock the telegram API) inside kotlin test. Of course the library that I will use to implement the bot is a javascript library. So, basically, can I implement my telegram bot in kotlin, using telegram bot js library, and testing it with, as an example, OkHttp MockWebServer?
    n
    • 2
    • 2
  • g

    gaetan

    12/12/2017, 12:07 PM
    Do you know if this bug is already known?
    fun main(args: Array<String>) {
        println(val1) //<- prints undefined in Js, "i am not null" inside JVM
    }
    val val1 = fun1()
    fun fun1()= fun2()
    val val2 = "i am not null"
    fun fun2(): String  = val2
    https://try.kotlinlang.org/#/UserProjects/boih6su9togjanq26leoqbdm6r/k5vdcs8ss8l19pruqhvcbv7akj
    👍 1
    l
    • 2
    • 2
  • s

    snrostov

    12/12/2017, 9:27 PM
    I’m looking for way to process annotations and types in kotlin/javascript sources. I guess they are serialized in this files?
    b
    • 2
    • 2
  • n

    napperley

    12/12/2017, 9:38 PM
    Is there a way to do sw testing which doesn't require the use of npm/node?
    g
    • 2
    • 17
  • n

    natpryce

    12/12/2017, 10:22 PM
    Hi Kotlin-JS-ers. If you want to play with some modern browser features, here are a couple files of Kotlin definitions for you... Speech Synthesis API: https://gist.github.com/npryce/e941294759606c068e656b9f49a00d5d Multitouch API: https://gist.github.com/npryce/2ba5e9bec206ea54f5b1908f12d07171
    👍 8
    g
    • 2
    • 1
  • a

    andreasmattsson

    12/14/2017, 5:59 PM
    Is there a "clean" way of checking whether the DOM is available in the currently running JS environment? I'm working on a multiplatform project, and have a
    *-common-js
    gradle subproject that gets imported in a version of the app that I would like to be able to run both headlessly (e.g. with node) or in a browser. I thought perhaps I could check if
    kotlin.browser.window
    and compare it with either
    null
    or
    kotlin.js.undefined
    , however both these give me
    ReferenceError: window is not defined
    k
    • 2
    • 2
  • e

    eldc

    12/14/2017, 7:45 PM
    Ah, I see. It's my inline fun. It got inlined real bad.
    b
    • 2
    • 6
  • s

    spierce7

    12/16/2017, 7:39 AM
    How are Kotlin-js compilation speeds with 1.2.10? Will I be able to get those near instant refreshes with kotlin-js? I've tried it on small projects and I get incremental compiles that are 2 or so seconds. How would this scale to larger projects? Will my team end up waiting 10-12 seconds for small changes as the project grows (again, for incremental compilations), or is the compiler going to get slower and slower? Would breaking my code up into smaller gradle modules help, or hurt?
    b
    • 2
    • 3
  • n

    Nikita Kulikov

    12/17/2017, 5:59 PM
    How call kt function from js code? Can you share example?
    s
    • 2
    • 5
  • b

    benleggiero

    12/18/2017, 12:52 AM
    Is there any way to mark a function as throwing in Kotlin/JS?
    b
    • 2
    • 4
  • n

    Nikita Kulikov

    12/19/2017, 8:26 AM
    My issue in kotlin loader webpack plugin https://github.com/huston007/kotlin-loader/issues/2
    h
    • 2
    • 12
  • a

    AnimusNull

    12/19/2017, 10:17 AM
    Are there recommended bindings or specific libraries to use for things like routing(react-router) or state management(redux)?
    h
    b
    • 3
    • 7
  • c

    chi

    12/19/2017, 4:57 PM
    Hey guys, Javascript dev new to Kotlin here. I'm interested in writing React native apps with Kotlin. What resources do I need for this. Is it possible to write RN apps with Kotlin without any serious challenge? (performance, etc) Are there example projects I could check out?
    a
    • 2
    • 1
  • k

    kartikpatodi

    12/19/2017, 5:17 PM
    @bashor Is there a step by step tutorial or something like that to for starting with Kotlin/JS ? Any recommended article(s)?
    👍 2
    👀 1
    b
    s
    • 3
    • 3
  • f

    filiplamparski

    12/19/2017, 5:49 PM
    Anyone aware of something that would let me use typings files from typescript as approximate Kotlin type information?
    👍🏼 1
    r
    • 2
    • 1
  • s

    Semigradsky

    12/21/2017, 8:39 AM
    Can I use kotlin.js with React Native? Anyone tried it?
    d
    • 2
    • 2
  • n

    natpryce

    12/21/2017, 10:22 AM
    I’m using a JS API that needs to be passed a String taken from a fixed set. I want to represent this with an enum in my Kotlin bindings. Is there a way to annotate an
    enum class
    to control how Kotlin will represent it to native JS code?
    b
    • 2
    • 5
  • s

    spand

    12/21/2017, 10:41 AM
    Does anyone have an example project of a "fast" edit/compile turnaround for development with kotlin/js ? I have seen some mentions of using webpack but cant find any examples
    g
    • 2
    • 3
  • b

    bashor

    12/21/2017, 11:00 AM
    Thread for https://kotlinlang.slack.com/archives/C0B8L3U69/p1513829639000051 cc @AnimusNull
    a
    • 2
    • 3
Powered by Linen
Title
b

bashor

12/21/2017, 11:00 AM
Thread for https://kotlinlang.slack.com/archives/C0B8L3U69/p1513829639000051 cc @AnimusNull
Right now you must convert all required dependencies manually
see
imports
and triple-slash directives like
/// <reference path="..." />
a

AnimusNull

12/21/2017, 12:01 PM
Thanks @bashor would it be beneficial to look at making some of these like kotlin-react, or share in some way. So the more common libraries are provided
👍 1
View count: 1