https://kotlinlang.org logo
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
  • g

    gaetan

    03/21/2017, 10:17 AM
    Hi guys, I have a javascript module with source and tests directories. I use the AMD module kind. I just saw that both source and tests are exported using the same module name. That seems to be the cause of some problems (test functions are not defined when loading together source script and test script). Can that be possible?
    b
    • 2
    • 3
  • m

    melatonina

    03/21/2017, 1:59 PM
    Why does kotlin2js require
    main
    to take an array of strings for it to be detected but then the generate code passes an empty array?
    fun main()
    is not used as entry point,
    fun main(args : Array<String>)
    is used as entry point but
    args
    will always be an empty array. I'm using
    moduleKind = "commonjs"
    .
    k
    • 2
    • 10
  • g

    gaetan

    03/21/2017, 2:08 PM
    @konsoletyper @bashor I created bug https://youtrack.jetbrains.com/issue/KT-16979 There is an enclosed mini project.
    b
    • 2
    • 1
  • g

    gaetan

    03/22/2017, 1:25 PM
    For my project, I tried to port code from kotlintest. Is there a way to test the type of an instance which works for both my classes and Primitive types:
    class A
    
        fun allTests(){
            println("${1 is Int}") //true
            println("${A() is A}") //true
            println("${A::class.isInstance(A())}") //true
            println("${Int::class.isInstance(1)}") // Uncaught TypeError: Cannot read property '$metadata$' of undefined
        }
    k
    • 2
    • 1
  • m

    melatonina

    03/22/2017, 5:28 PM
    Following the js-modules reference page I was able to declare the function
    getInfo
    from module
    ytdl-core
    . I have some problems when calling it but I'd like to ask you another question. I don't want to pollute the global namespace with module-specific function, so I used this syntax to declare the whole module and its function(s).
    @JsModule("ytdl-core")
    external class Ytdl {
        companion object {       
            fun getInfo(name: String, options : dynamic, callback : (dynamic, dynamic) -> Unit) : Unit
        }
    }
    Now I can read all javascript properties of
    Ytdl
    with
    Object.getOwnPropertyNames()
    (and
    getInfo
    in among them) but I don't know how to refer to `Ytdl.getInfo`: both
    Object.getOwnPropertyNames(Ytdl.getInfo)
    and
    Object.getOwnPropertyNames(Ytdl::getInfo)
    fail to compile. The first is assumed to be a function call (lacking its arguments), the second causes a "Unresolved reference: getInfo". Am I missing something?
    b
    k
    • 3
    • 7
  • v

    vsazel

    03/22/2017, 9:45 PM
    Hi, thanks for helping @melatonina, but what exactly is meant with that "platform autodetection by stdlib dependency"? I modified the code a little bit without that and it works just fine. https://github.com/wojta/kotlin-nodejs-experiment
    b
    • 2
    • 1
  • b

    bulwinkel

    03/26/2017, 10:47 PM
    anyone got any experience using kotlin with react?
    a
    c
    • 3
    • 6
  • s

    spierce7

    03/29/2017, 4:32 AM
    How do kotlin-js stacktraces work?
    k
    c
    • 3
    • 5
  • s

    spierce7

    03/29/2017, 8:35 PM
    are there any examples of calling a kotlin-js library from javascript?
    k
    • 2
    • 3
  • n

    Nicholas Bilyk

    04/02/2017, 4:41 PM
    ah, figured it out. In the documentation for kotlin it shows adding a callback to the requirejs call, if I remove that it works fine
    b
    • 2
    • 2
  • o

    orangy

    04/03/2017, 8:35 AM
    📣 📣 After JS got non-experimental with Kotlin 1.1 we are starting to slowly deliver on tooling around it. Hereby we want to show some of the early work on Gradle/NPM/WebPack for those who has multiplatform project (backend + frontend) and want to use Kotlin throughout the project, have a single project structure and still enjoy NPM as a repository for JS libs, webpack devmode and all the rest. Check out https://github.com/Kotlin/kotlin-frontend-plugin and tell us what do you think!
    🎉 3
    d
    • 2
    • 2
  • n

    nfrankel

    04/03/2017, 9:35 AM
    some neither beer nor wine 😉
    c
    • 2
    • 1
  • d

    danfma

    04/03/2017, 3:28 PM
    @Tristan Caron give a look at this: https://github.com/danfma/kodando-react-sample.
    t
    • 2
    • 1
  • p

    pabl0rg

    04/03/2017, 8:03 PM
    @sdeleuze amen. Would it be possible to provide at least the kotlin stdlib as webassembly? Might at least solve one of the complaints that have been expressed regarding kotlinjs
    s
    • 2
    • 4
  • f

    functionaldude

    04/06/2017, 4:57 PM
    I don't want to be an asshole, but any time estimations? In the next hours? In the next days? Weeks? Months? Thanks for an open communication 🙂
    💯 1
    a
    • 2
    • 1
  • t

    Tristan Caron

    04/07/2017, 6:41 AM
    Since they're sharing memory I will call them threads :)
    e
    b
    • 3
    • 7
  • n

    nimtiazm

    04/08/2017, 9:54 PM
    has anyone used d3.js with kotlin here?
    b
    • 2
    • 1
  • n

    nimtiazm

    04/09/2017, 9:00 AM
    Generation was clean. But I'm struggling with trying to use it from kt source
    a
    • 2
    • 1
  • p

    pabl0rg

    04/11/2017, 5:52 AM
    @konsoletyper you may be interested in this https://github.com/angular/tsickle/blob/master/README.md
    k
    • 2
    • 5
  • u

    uli

    04/11/2017, 6:58 AM
    With JS backend the result is
    false
    , with JVM backend it is
    true
    e
    • 2
    • 2
  • p

    pabl0rg

    04/13/2017, 12:47 PM
    Is it possible to compile Kotlin to Typescript?
    k
    n
    g
    • 4
    • 15
  • l

    lifk

    04/13/2017, 8:17 PM
    Hi guys, I'm playing with https://github.com/Kotlin/kotlin-fullstack-sample and I was wondering if there is a way of sharing the model files between backend and frontend
    👍 1
    k
    • 2
    • 5
  • s

    spierce7

    04/13/2017, 11:21 PM
    How can I minify kotlin-js and still have relevant source maps?
    k
    • 2
    • 2
  • d

    Dalinar

    04/14/2017, 1:20 AM
    how easy is debugging kotlin javascript in the browser? I have some js extension type code I'm thinking to port to kotlin because 1. it would be nice 2. I hate javascript . But I also don't want to make my life more complicated
    k
    g
    • 3
    • 4
  • g

    gaetan

    04/14/2017, 9:07 AM
    Did anybody tried to use closure to remove unused code (including kotlin.js)?
    k
    • 2
    • 6
  • g

    gaetan

    04/17/2017, 8:54 AM
    Hi. I would like to convert an Int to an hex string. I found the
    String.toInt(radix:Int)
    but didn’t find the opposite.
    k
    b
    • 3
    • 12
  • g

    gbaldeck

    04/19/2017, 4:50 PM
    so the div { span { ... } } is missing from the document fragment, but they should be there
  • c

    Chris Miller

    04/24/2017, 3:10 PM
    Has anyone managed to get the full-stack example (https://github.com/Kotlin/kotlin-fullstack-sample) building on Windows? I get:
    :frontend:webpack-config UP-TO-DATE
    :frontend:webpack-bundle
    module.js:472
        throw err;
        ^
    
    Error: Cannot find module 'C:\programming\fullstack\frontend\build\node_modules\webpack\bin\webpack.js'
        at Function.Module._resolveFilename (module.js:470:15)
        at Function.Module._load (module.js:418:25)
        at Module.runMain (module.js:605:10)
        at run (bootstrap_node.js:420:7)
        at startup (bootstrap_node.js:139:9)
        at bootstrap_node.js:535:3
    :frontend:webpack-bundle FAILED
    when running
    gradlew build
    or
    gradlew bundle
    c
    • 2
    • 2
  • s

    spierce7

    04/25/2017, 6:21 AM
    Is there a way to tree-shake the generated webpack? It's pretty large because of the kotlin library that comes with it.
    👍 2
    s
    • 2
    • 3
  • c

    cy

    04/25/2017, 7:29 AM
    uglify is unable to minify it good enough, there will be a tool to do that (not yet ready right now)
    s
    • 2
    • 1
Powered by Linen
Title
c

cy

04/25/2017, 7:29 AM
uglify is unable to minify it good enough, there will be a tool to do that (not yet ready right now)
s

spierce7

04/27/2017, 4:47 AM
I actually remember trying kotlin-js a few years back, and I'm pretty sure that it only included what it needed of the kotlin-stdlib. Is that no longer the case?
View count: 3