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

    Talon

    08/10/2018, 11:30 PM
    Hello all, I'm originally a JS developer and I spent the last year learning Kotlin. I wrote this library for creating frontend apps https://github.com/talon/nimble. To me, it's like Elm but if Kotlin did it. I'd love to hear your feedback if you have any!
    👍 1
    c
    r
    • 3
    • 2
  • k

    kotlin_questions

    08/11/2018, 4:19 PM
    hi, is kotlin ever going to compile to wasm instead of js?
    a
    n
    • 3
    • 3
  • k

    kotlin_questions

    08/12/2018, 9:25 PM
    and second, mixing html and kotlin code like that makes it pretty much unusable for anything BUT kotlinjs
    j
    • 2
    • 3
  • j

    juliocbcotta

    08/12/2018, 10:49 PM
    is this a good place to talk about the kotlin frontend plugin ? I am having some issues when running tests (my tests only run again if I change the karma reports before each run).
    r
    c
    • 3
    • 3
  • b

    bloodshura

    08/14/2018, 7:27 AM
    Besides giving up, what alternatives there are when I want to use a JS library (particularly, Reactstrap for React-ready Bootstrap components) on Kotlin/JS, but ts2kt failed to generate Kotlin definitions for that library? (
    r
    s
    • 3
    • 3
  • f

    fair_enough

    08/14/2018, 8:22 AM
    Hi, what could be reason of not creating proper method
    MessageApi.prototype.onMessage_ep0k5p$ = function (listener) {
        this.socketApi_0.addListener_lgim5c$(KWebSocket$Companion_getInstance().EVENT_MESSAGE, MessageApi$onMessage$lambda(listener));
      };
    This was not created:
    Object.defineProperty(MessageApi.prototype, 'onMessage', {
        get: function () {
          return this.onMessage_ep0k5p;
        }
      });
    This is the class:
    class MessageApi(private val socketApi: ISocketApi, override val user: String = WebAppUser) : IMessageApi {
    
        override fun onMessage(listener: MessageListener) {
            socketApi.addListener(KWebSocket.EVENT_MESSAGE) {
                it.data?.apply {
                    listener(this)
                } ?: println("Message text was null: $it")
            }
        }
    
        override fun send(text: String) {
            socketApi.webSocket.send(SocketData(SocketDataType.Default, user, KWebSocket.EVENT_MESSAGE, text))
        }
    }
    r
    • 2
    • 11
  • c

    coder82

    08/15/2018, 12:53 PM
    are you planning to add a minification feature for output .js files for front end projects in kotlin?
    r
    • 2
    • 1
  • j

    juliocbcotta

    08/16/2018, 6:15 PM
    Is there any sample/medium/blog teaching how to publish/consume a js library with gradle?
    a
    • 2
    • 5
  • c

    coder82

    08/18/2018, 10:12 PM
    what do you guys use to bundle and minify the .js files generate by kotlin?
    g
    • 2
    • 1
  • j

    juliocbcotta

    08/21/2018, 12:58 AM
    So... I was trying to publish my kmmp library for js into npm... and it seems that there is already a library with the same name as mine... so I thought I could create a scoped pacakge.... does kotlin frontend plugin can help me with it or publishing the package in general?
    a
    • 2
    • 3
  • c

    coder82

    08/21/2018, 2:53 PM
    unfortunately webpack messes up the source maps and kotlin code doesn't appear anymore int he dev tools within chrome
    c
    • 2
    • 12
  • c

    coder82

    08/22/2018, 1:53 PM
    turns out i can do it adding an overrider inside webpack.config.d dir
    • 1
    • 1
  • p

    patrickdelconte

    08/22/2018, 2:41 PM
    Are there any libraries that provide a Map or Map-like interface for js objects?
    d
    • 2
    • 1
  • c

    coder82

    08/27/2018, 4:48 PM
    any plan to target ES6 with kotlinjs ?
    a
    • 2
    • 1
  • c

    coder82

    08/27/2018, 8:36 PM
    dce works now, it trims everything to aroung 300 Kb, which is ok, the problem is webpack resolve precedence, it was not picking the dced files
    c
    • 2
    • 17
  • g

    gaetan

    08/31/2018, 2:18 PM
    Hi guys, I have a strange error raised by KotlinDce:
    error: duplicate target file will be created for '/Users/gaetan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.2.61/6e6ada4e826d8c66053f9383a6778b2324853f2/kotlin-stdlib-js-1.2.61.jar!kotlin.js' and '/Users/gaetan/dev/data2viz/time/d2v-time-js/build/libs/d2v-time-js-0.6.0.jar!lib/kotlin.js
    Has anyone already seen this message and understood the problem?
    c
    • 2
    • 11
  • c

    coder82

    09/02/2018, 11:43 PM
    is kotlin.incremental.js=true still necessary for incremental compilation or is it enabled by default?
    v
    • 2
    • 3
  • t

    timrijckaert

    09/03/2018, 3:25 PM
    I'm new to the whole Kotlin JS transpiling and trying to look for some good samples in combination with Spring boot. For now I have found some very simple proof of concepts, but they don't satisfy my hunger. 😉 Spring + Thymeleaf + Kotlin Js (simple Jquery DOM manipulation) ?
    n
    • 2
    • 3
  • j

    jacob

    09/04/2018, 1:17 AM
    if you compile all your tests to a directory and then run karma or node by itself over them?
    n
    • 2
    • 35
  • b

    bloder

    09/05/2018, 7:35 PM
    I'm new with Kotlin Js and I'm facing a problem here (probably it's a newbie mistake that I'm not seeing) I'm trying to import kotlin html dsl library with gradle but when I try to build, this error appears
    Module not found: Error: Can't resolve 'kotlinx-html-js' in '/home/bloder/KotlinJsProjects/bloder-polymer-playground/polymer-playground/build/js'
    I've already tried to import kotlin-html-js in node dependencies but it's still occurring, I'm using kotlin front end plugin, and I'm importing the library like this
    dependencies {
        implementation "org.jetbrains.kotlinx:kotlinx-html-js:0.6.9"
    }
    • 1
    • 1
  • n

    napperley

    09/05/2018, 11:54 PM
    After running the Gradle test task there is a error with the kotlin module not being found (using Jest for Kotlin JS testing):
    > Task :js:runJest FAILED
    FAIL build/test/js_test.js
      ● Test suite failed to run
    
        Cannot find module 'kotlin' from 'js_test.js'
    
          3 |     define(['exports', 'kotlin', 'kotlin-test'], factory);
          4 |   else if (typeof exports === 'object')
        > 5 |     factory(module.exports, require('kotlin'), require('kotlin-test'));
            |                             ^
          6 |   else {
          7 |     if (typeof kotlin === 'undefined') {
          8 |       throw new Error("Error loading module 'js_test'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'js_test'.");
    
          at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
          at require (build/test/js_test.js:5:29)
          at Object.<anonymous> (build/test/js_test.js:1:2)
    
    Test Suites: 1 failed, 1 total
    What is the way to resolve JS dependencies?
    • 1
    • 1
  • v

    Vinicius Carvalho

    09/06/2018, 7:04 PM
    Hi there, I'm relatively new to kotlin, and trying my first javascript project
    c
    • 2
    • 1
  • v

    Vinicius Carvalho

    09/06/2018, 7:06 PM
    how do I handle messages? I'm a bit confused by this declaration:
    var onmessage: ((Event) -> dynamic)?
    n
    • 2
    • 2
  • s

    steamstreet

    09/06/2018, 9:27 PM
    JVM modules are fine, but not JS modules
    n
    y
    • 3
    • 19
  • n

    napperley

    09/08/2018, 5:12 AM
    Having an issue with the Page.evaluateHandle function not working. When the function is called it doesn't complete, instead a coroutine exception occurs.
    Puppeteer_API_Mapping.kt
    • 1
    • 3
  • a

    amatsehor

    09/10/2018, 7:34 PM
    Can external modifier be a solution somehow? I mean, declare this class as external and let it be resolved from JS
    • 1
    • 1
  • n

    napperley

    09/12/2018, 8:06 AM
    Found a bizarre issue where a ClassCastException is thrown when accessing the first element from a List:
    ● org.webscene.core.test.dom › DomQueryTest › testFetchExistingPageId
    
        ClassCastException: Illegal cast
    
          36 |             element.hasAttribute("pageId")
          37 |         }
        > 38 |         return if (metaElements.isNotEmpty()) metaElements.first().getAttribute("pageId") ?: "" else ""
             |                                                            ^
    r
    • 2
    • 6
  • r

    robstoll

    09/12/2018, 9:08 AM
    Is there some sort of ServiceLoader mechanism for JS provided by Kotlin?
    g
    • 2
    • 1
  • n

    napperley

    09/13/2018, 3:29 AM
    Are there any differences with casting in Kotlin JS compared to Kotlin JVM?
    d
    • 2
    • 1
  • j

    jkbbwr

    09/15/2018, 10:32 PM
    Is there a way to convert typescript declarations to kotlin/js
    • 1
    • 1
Powered by Linen
Title
j

jkbbwr

09/15/2018, 10:32 PM
Is there a way to convert typescript declarations to kotlin/js
Don't worry found it https://github.com/Kotlin/ts2kt
👍 1
View count: 3