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

    xantier

    07/31/2017, 2:14 PM
    has anyone stumbled upon material where I could look some example to build kotlinJS with Gradle Kotlin DSL?
    b
    1 reply · 2 participants
  • b

    bashor

    08/01/2017, 3:12 PM
    @eldc looks like it’s duplicate of https://youtrack.jetbrains.com/issue/KT-19177
    e
    h
    +1
    24 replies · 4 participants
  • d

    diodredd

    08/01/2017, 3:28 PM
    Hello, is that possible to convert React and Redux d.ts with ts2kt?
    b
    17 replies · 2 participants
  • t

    tlaukkan

    08/02/2017, 3:26 PM
    I have gradle project with with web module containing kotlinjs sources and server module containing embedded web server to serve them, is there a best practice how to get the build output from web module (both classes and resources) to server module resources folder?
    b
    2 replies · 2 participants
  • t

    thos

    08/02/2017, 6:36 PM
    i found js(“({})“) but it can not declare sub object like date{ type : … , default … }
    k
    b
    2 replies · 3 participants
  • z

    zsmb

    08/02/2017, 7:00 PM
    Since using jquery from the stdlib is now deprecated, what's the recommended way of pulling it into a project? Is there a Gradle dependency for it?
    k
    2 replies · 2 participants
  • z

    zsmb

    08/03/2017, 5:04 PM
    I pulled in jQuery using ts2kt. It generated an interface like this:
    external interface JQueryPromiseCallback<T> {
        @nativeInvoke
        operator fun invoke(value: T? = definedExternally, vararg args: Any)
    }
    I need an instance of this as a function parameter, I tried creating one like this:
    object: JQueryPromiseCallback<Any> {
        override fun invoke(value: Any?, vararg args: Any) {
    
        }
    })
    However, I'm getting an error on the invoke function:
    Overriding 'external' function with optional parameters
    The
    @nativeInvoke
    annotation is also deprecated, and gives me a deprecation message that I can't figure out:
    Use inline extension function with body using dynamic
    Am I supposed to correct the file that ts2kt generated? If so, how?
    g
    b
    10 replies · 3 participants
  • b

    bmo

    08/05/2017, 1:24 PM
    Sorry noob question here but anybody has a idea of why when I compile my code, the output doesn't include the kotlin.js file? I had to copy it from the jar file which is not great in case I upgrade kotlin. Source code available at https://github.com/bmonjoie/magicsquare
    k
    b
    5 replies · 3 participants
  • t

    tlaukkan

    08/05/2017, 5:52 PM
    Was there any way to enumarate kotlinjs object properties hackish or not? 🙂
    b
    2 replies · 2 participants
  • t

    thos

    08/08/2017, 9:20 AM
    Excuse me , Can I use async / await like ES7 with kotlinJs
    k
    2 replies · 2 participants
  • s

    spand

    08/08/2017, 2:59 PM
    I have not used kotlinjs yet and I tried looking for information about codesplitting support but I cant find anything about it at all. Has anyone seen anything about it ?
    b
    k
    6 replies · 3 participants
  • n

    natpryce

    08/11/2017, 12:13 PM
    Hi. The definition of Promise<T> in the Kotlin JS runtime library is incorrect — it doesn’t handle the case when a function passed to
    then
    returns a “thenable” result (usually another Promise). I’ve implemented a version that does: https://try.kotlinlang.org/#/UserProjects/hi5gtn3e98h5ivrpve1b193j80/e7m31fl1smt0r00jd1ii7pe9nv
    b
    6 replies · 2 participants
  • g

    gp

    08/13/2017, 4:00 AM
    we are majorly using angular js /type script ...does kotlin has any bridge for that ..ideas around how to leverage existing angular code with kotlin ?
    b
    3 replies · 2 participants
  • m

    mbstavola

    08/14/2017, 7:39 PM
    Is there a roadmap for ts2kt? I tried to import a few Typescript definitions and got a ton of "... kind unsupported yet here!"
    b
    2 replies · 2 participants
  • s

    steamstreet

    08/16/2017, 9:46 PM
    It used in the front end example code. It compiles fine, but upon launch, there’s an error in Chrome that invoke can’t be found.
    b
    c
    3 replies · 3 participants
  • m

    muralimohan962

    08/19/2017, 7:28 AM
    Can i use angularJS with koltin?
    b
    1 reply · 2 participants
  • f

    figitaki

    08/22/2017, 8:14 PM
    So I'm trying to create a react project using Kotlin based off the
    kotlin-fullstack-sample
    but I'm getting the following error from webpack when I try to include the compiled kotlin2js output in my webpack bundle:
    Module not found: Can't resolve 'kotlinx-html-js' in '/Users/figitaki/Developer/kotlin/demo-kotlin-scripts/src'
    I looked on
    npm
    and there's no package called
    kotlin-html-js
    any ideas?
    b
    c
    +1
    7 replies · 4 participants
  • k

    karelpeeters

    08/25/2017, 6:42 PM
    The browser's log prints this error: "ReferenceError: define is not defined[Learn More] main.js1️⃣1"
    k
    2 replies · 2 participants
  • k

    karelpeeters

    08/25/2017, 6:45 PM
    Does someone have any idea what's going on?
    p
    2 replies · 2 participants
  • n

    nish

    08/27/2017, 3:12 PM
    is there a public repository for this https://www.npmjs.com/package/kotlinc-js
    h
    2 replies · 2 participants
  • n

    nish

    08/27/2017, 3:13 PM
    I want to setup a PR to add the output prefix to it
    z
    2 replies · 2 participants
  • k

    karelpeeters

    08/31/2017, 8:42 PM
    When I compile a simple hallo-world app the compiler outputs a bunch of files: •`kotlin.js` •`kotlin.meta.js` •`main.js` •`main.meta.js` •`root-package.kjsm` Is it okay to just keep
    kotlin.js
    and
    main.js
    in production?
    b
    5 replies · 2 participants
  • z

    zvozin37

    09/02/2017, 12:51 AM
    Are there JetBrains plans to institute a DefinitelyTyped for Js Kotlin?
    b
    3 replies · 2 participants
  • z

    zvozin37

    09/02/2017, 12:53 AM
    (aware of ts2kt - a good first step)
    b
    2 replies · 2 participants
  • s

    snrostov

    09/02/2017, 1:27 PM
    Is it possible to generate source maps with kotlin-dce-js gradle plugin?
    g
    3 replies · 2 participants
  • l

    lewik

    09/04/2017, 4:07 PM
    Hello everybody Can I use kotlin loader/compiler from webpack? Like just add some loader to config, webpack -w, and get success?
    k
    e
    +3
    25 replies · 6 participants
  • k

    karelpeeters

    09/04/2017, 10:03 PM
    How do I tell the compiler to not put everything in a module object? Right now every button event handler had to have
    onClick="main.action(event)"
    , I'd like to do it without the
    main
    . Is that possible?
    k
    2 replies · 2 participants
  • k

    karelpeeters

    09/04/2017, 11:08 PM
    How do I change the style of an element in KotlinJs? Something like this doesn't seem to work, the property
    style
    doesn't exist:``` val tabs = document.getElementsByClassName("tabContent") tabs.asList().forEach { it.style.color = "red" } ```
    k
    5 replies · 2 participants
  • g

    gaetan

    09/05/2017, 12:08 AM
    The fix to the issue I created, (https://youtrack.jetbrains.com/issue/KT-16979) about the names of main and test js files created from a module, creates two js files adding _main and _test to the project name. It corrects the bug but it forces everyone to manually change the name of the generated file (no one will publish a library with a name like my-cool-lib_main.js). Wouldn’t it be better to just add ‘_test’ for the test code and leave the main code as it was before without _main?
    1 reply · 1 participant
  • f

    functionaldude

    09/05/2017, 9:49 AM
    Hi! I am having some troubles with React. I'm using the React wrapper from the full-stack-example, but I cant get it to work, I always get
    ReactBuilder$invoke is not defined
    . It worked with
    1.1.2-2
    , but after the
    1.1.4
    the whole project broke, reverting to
    1.1.2-2
    didn't help.
    k
    4 replies · 2 participants
Powered by Linen
Title
f

functionaldude

09/05/2017, 9:49 AM
Hi! I am having some troubles with React. I'm using the React wrapper from the full-stack-example, but I cant get it to work, I always get
ReactBuilder$invoke is not defined
. It worked with
1.1.2-2
, but after the
1.1.4
the whole project broke, reverting to
1.1.2-2
didn't help.
k

konsoletyper

09/05/2017, 9:52 AM
The best thing you can do is to create a minimal self-contained project that reproduces the problem and post it here, so that Kotlin/JS team could reproduce the issue themselves.
f

functionaldude

09/05/2017, 10:15 AM
I cloned the original fullstack-example from github, and I get the same error if I upgrade that to
1.1.4
k

konsoletyper

09/05/2017, 2:07 PM
@functionaldude looks like there's regression in 1.1.4. And looks like 1.1.50 will fix this (I just merged major changes in JS inliner).
f

functionaldude

09/05/2017, 4:55 PM
thank you!!
View count: 1