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

    cancandan

    09/05/2017, 12:54 PM
    installed intellij ultimate + chrome support, debugging index.html as in https://kotlinlang.org/docs/tutorials/javascript/getting-started-idea/getting-started-with-intellij-idea.html. The debugger does not stop at the breakpoint. I'm on ubuntu 16.04. What to do?
    k
    • 2
    • 8
  • l

    lewik

    09/06/2017, 10:12 AM
    Is it possible to compile kotlin to js file with `export`s? (edited)
    k
    k
    • 3
    • 4
  • l

    lewik

    09/06/2017, 12:38 PM
    I wrote simple kt-class with
    testMe
    method. I can't call it in old js: I see
    testMe_61zpoe$
    k
    k
    • 3
    • 12
  • l

    lewik

    09/07/2017, 5:52 AM
    Is anybody tries to compile kotlin to js file-to-file jr use with vuejs?
    k
    • 2
    • 1
  • k

    karelpeeters

    09/07/2017, 9:49 PM
    Did anyone run into something like this? https://youtrack.jetbrains.com/issue/KT-20174
    g
    • 2
    • 21
  • t

    tgmcians

    09/08/2017, 12:45 PM
    Can anyone invite me in node.js channel ?
    z
    • 2
    • 2
  • b

    bamdmux

    09/14/2017, 5:25 AM
    BTW, congrats to the jetbrains team for the DCE, tool. Went from a 2.5MB webpack bundle to a 240KB (50 compressed) 👍
    👏 5
    k
    g
    • 3
    • 16
  • j

    jdemeulenaere

    09/16/2017, 10:42 AM
    I was wondering what was the proper way to extend org.w3c.dom.HTMLElement ?
    b
    • 2
    • 1
  • n

    napperley

    09/25/2017, 12:57 AM
    Been getting this Kotlin JS issue via Gradle: e: File '/home/napperley/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.1.50/94cb645045b500ffe1b7f1711567c9ebe3635100/kotlin-stdlib-js-1.1.50.jar' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.1.0, expected version is 1.0.1. What is binary version metadata? If Kotlin JS is downgraded to 1.1.4-3 then the issue doesn't appear. Have another Kotlin JS project using v1.1.50 which transpiles fine via Gradle which is strange. 😕
    b
    • 2
    • 6
  • h

    hiperbou

    09/25/2017, 10:58 AM
    How can I update the kotlin compiler for js (kotlinc-js) wich can be found in the IntelliJ IDEA folder (plugins\Kotlin\kotlinc\bin)???
    b
    • 2
    • 3
  • d

    danfma

    09/27/2017, 2:18 AM
    hey guys, have anyone checked that the
    kotlin-dce-js
    is generating invalid code?
    k
    • 2
    • 7
  • b

    bashor

    09/27/2017, 10:32 AM
    @napperley no, I’ve asked about an issue related to stacktrace from here https://kotlinlang.slack.com/archives/C0B8L3U69/p1505556164000099
    n
    • 2
    • 2
  • j

    jdemeulenaere

    09/27/2017, 8:11 PM
    Hi guys ! Does anyone from the team knows if there is any current development to improve the reflection API when targeting JS ? I really need the method KProperty{0,1,2}.getDelegate() for a project. Maybe I could check if it is easily achievable and try to make a PR ? 🙂
    b
    • 2
    • 2
  • n

    naitbit

    09/28/2017, 9:09 AM
    Anyone used KotlinJS with Firebase? It does not allow me to
    sortBy
    on
    mutableList
    More specifically:
    children.sortBy{ it.toString() }
    generates
    var sortWith = Kotlin.kotlin.collections.sortWith_nqfjgj$;
      var wrapFunction = Kotlin.wrapFunction;
      var compareBy$lambda = wrapFunction(function () {
        var compareValues = Kotlin.kotlin.comparisons.compareValues_s00gnj$;
        return function (closure$selector) {
          return function (a, b) {
            var selector = closure$selector;
            return compareValues(selector(a), selector(b));
          };
        };
      });
      var Comparator = Kotlin.kotlin.Comparator;
      function Comparator$ObjectLiteral(closure$comparison) {
        this.closure$comparison = closure$comparison;
      }
      Comparator$ObjectLiteral.prototype.compare = function (a, b) {
        return this.closure$comparison(a, b);
      };
      Comparator$ObjectLiteral.$metadata$ = {kind: Kotlin.Kind.CLASS, interfaces: [Comparator]};
    and Firebase complains:
    TypeError: wrapFunction is not a function
        at /tmp/fbfn_20366LgmtP4EM7pSy/kot.js:96:26
        at Object.<anonymous> (/tmp/fbfn_20366LgmtP4EM7pSy/kot.js:167:2)
        at Module._compile (module.js:624:30)
        at Object.Module._extensions..js (module.js:635:10)
        at Module.load (module.js:545:32)
        at tryModuleLoad (module.js:508:12)
        at Function.Module._load (module.js:500:3)
        at Module.require (module.js:568:17)
        at require (internal/module.js:11:18)
    k
    • 2
    • 11
  • d

    danfma

    09/29/2017, 7:18 PM
    Hey guys, I saw that when we use delegated properties, one instance of KProperty is created for every access. This isn't nice for memory usage. Why don't we define it above the property definition and reference it?
    b
    • 2
    • 2
  • d

    Deactivated User

    09/30/2017, 4:49 PM
    Blob.slice has Int as parameters. What if referencing files larger than 2GB?
    k
    • 2
    • 6
  • a

    alexander.egger

    10/06/2017, 8:31 AM
    I try to run kotlinc-js under Java 9 and get: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter. I know this is because the module java.xml.bind is not included by default in Java 9. How can I resolve this?
    k
    • 2
    • 9
  • t

    Tristan Caron

    10/08/2017, 6:44 PM
    Hello, Does Kotlin support or plan to support lazy import? In JavaScript you can do something like:
    myLib = await import('<http://etc.com/lib.js>');
    myLib.myFunction();
    Or in Dart
    import 'myLib.dart' deferred as 'myLibLoader';
    
    const myLib = await myLibLoader;
    myLib.myFunction();
  • n

    napperley

    10/08/2017, 10:12 PM
    Tristan - What do you mean by lazy import?
    k
    u
    +2
    • 5
    • 18
  • s

    sdeleuze

    10/10/2017, 1:25 PM
    ERROR in Entry module not found: Error: Can't resolve '/home/sdeleuze/workspace/kotlin-examples/gradle/js-dce/build/classes/main/min/kotlin-dce-example_main.js'
    k
    g
    • 3
    • 7
  • s

    snrostov

    10/10/2017, 2:08 PM
    Is there any Kotlin wrapper for React?
    b
    b
    • 3
    • 4
  • s

    sdeleuze

    10/10/2017, 4:22 PM
    That a duplicate of https://youtrack.jetbrains.com/issue/KT-20156 in fact
    n
    • 2
    • 6
  • s

    sdeleuze

    10/11/2017, 7:34 AM
    https://github.com/JetBrains/kotlin-examples/pull/60
    👍🏻 1
    k
    n
    • 3
    • 13
  • s

    sdeleuze

    10/11/2017, 3:10 PM
    window.onload
    and
    eventSource.onmessage
    have the same `((Event) -> dynamic)?`declaration, so I don't understand why I can use
    window.onload
    without a problem and not
    eventSource.onmessage
    .
    b
    • 2
    • 6
  • s

    sdeleuze

    10/11/2017, 3:29 PM
    Also why most (all ?) event listener declare generic
    Event
    and not in my use case
    MessageEvent
    ?
    b
    • 2
    • 5
  • n

    nulldev

    10/12/2017, 2:20 AM
    Does anybody know how to enable coroutines in Kotlin JS in Gradle? I've scoured the docs to no avail...
    k
    • 2
    • 4
  • k

    karelpeeters

    10/12/2017, 1:07 PM
    Is there a way to make something like this work?
    //js
    karel = {
        "name": "Karel Peeters"
    };
    
    //kotlin
    class Person(val name: String) {
        fun printName() = println(name)
    }
    
    external val karel: Person
    
    fun main(args: Array<String>) {
        karel.printName()
    }
    I have some data defined externally that matches some classes in fields, but it doesn't have the functions the class needs. Is there a way to automatically use the Kotlin-defined ones?
    b
    • 2
    • 1
  • l

    lewik

    10/13/2017, 12:10 PM
    I have simple js object, that I use as Map (but it's not a js Map). Like
    {someId1: Obj1, someId2: Obj2}
    How can I access to it in kotlin? I can't come up with external definition.
    k
    • 2
    • 12
  • t

    Tristan Caron

    10/16/2017, 12:10 PM
    Any plan for having something similar to https://retyped.com ? Looks nice I think 😮 Could be a community effort though.
    b
    d
    • 3
    • 5
  • n

    nomad

    10/16/2017, 1:00 PM
    is the kotlin frontend plugin being actively maintained, or is it more of a proof of concept thing?
    k
    b
    • 3
    • 8
Powered by Linen
Title
n

nomad

10/16/2017, 1:00 PM
is the kotlin frontend plugin being actively maintained, or is it more of a proof of concept thing?
k

karelpeeters

10/16/2017, 1:01 PM
The gradle plugin? The Idea plugin?
n

nomad

10/16/2017, 1:01 PM
gradle plugin
k

karelpeeters

10/16/2017, 1:01 PM
It's actively maintained.
b

bashor

10/16/2017, 1:17 PM
@nomad do you have any problem with it?
n

nomad

10/16/2017, 1:25 PM
no not yet, just saw the last release was in August, so wanted to make sure before I started using it, I'll give it a try.
actually one question, when using the DCE plugin, the frontend plugin does not seem to use the pruned files?
b

bashor

10/16/2017, 2:31 PM
We still maintain it, but unfortunately, we don’t have the ability to do more now.
https://kotlinlang.slack.com/archives/C0B8L3U69/p1508161217000296?thread_ts=1508158833.000483&amp;cid=C0B8L3U69 @nomad please create an issue about it cc @cy
View count: 1