Marc Knaup
12/04/2020, 3:40 PMlazy
& related overhead to every single one of them?
In my project I use the pattern val foo = object : SomeBaseClass { … }
quite a lot and just now recognized that there’s an insane amount of initialization going on during startup. All such val
get evaluated at startup and all properties of these objects get evaluated too which in turn runs all their delegate providers.tarek
12/06/2020, 11:50 AMwindow.fetch
but I get 404starek
12/06/2020, 5:10 PM@svgdot/svg.js
but I’m struggling to make them compile
Is there any config optios for it? Or should I edit all the externals manually?Tiago Nunes
12/06/2020, 9:57 PMimplementation(npm("jquery", "3.5.1"))
implementation(npm("@types/jquery", "3.5.1", generateExternals = true))
However, I got a bunch of compile errors when running gradlew run, errors like:
'addEventListener' overrides nothing
'addEventListener' overrides nothing
'addEventListener' overrides nothing
'addEventListener' overrides nothing
'removeEventListener' overrides nothing
'removeEventListener' overrides nothing
Can dukat not yet convert declarations from @types/jquery 3.5.1?
How then can I use jQuery in kotlin (with declarations)?darkmoon_uk
12/09/2020, 7:52 AMSebastian Aigner
12/09/2020, 12:25 PMSebastian Owodzin
12/15/2020, 12:49 AMimport * as firebase from 'firebase/app';
& I could do the following:
@JsModule("firebase/app")
external object firebase {
...
}
But now in their docs it’s import firebase from 'firebase/app';
and I’m getting TypeError: $module$firebase_app.initializeApp is not a function
Anyone have an idea how to properly import this?TheOnlyTails
12/16/2020, 5:49 PMKotlinConf Explorer
Page. I made sure my code is right (I checked the repo), yet nothing appears in my browser.Harald Pehl
12/17/2020, 8:50 AMBrandon Saunders
12/17/2020, 10:39 AMAndrey Nikanorov
12/17/2020, 7:37 PMbrowserProductionWebpack
. One of the setState{}
is not executed. Without any errors in console.
All code before and after setState{}
executed fine, but not inside. How to investigate such issues?
Legacy compilerAlfred Lopez
12/17/2020, 9:48 PMandylamax
12/17/2020, 10:28 PMFAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':sandbox-react:testPackageJson'.
> NPM Dependencies already resolved and installed
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD FAILED in 1s
01:26:55: Task execution finished ':sandbox-react:test'.
How ever, running with gradle successfully executes the test. Is this a known bug? any workaround?
IR Backendthana
12/18/2020, 10:41 AMthana
12/18/2020, 11:17 AMwebpack.config.d
folder, but it doesn seem to have any impact on the resulting webpack.config.js
what is missing if those files are ignored?thana
12/18/2020, 12:29 PM@JsName
the method named isn;t mangled and indeed i can find some emthods from my code with the correct name in the resulting bundle. I thought configuring the terser plugin is the way to go, but didn't work out becasue the config in webpack.config.d
is ignored.
But then i found out: its indeed dce that removes the method! i tried dceTask{keep{..}}
but couldn;'t make it work.
No i finally figured: the methods removed reside in the default package.
So the question is: is it a bug or a feature that you cannot keep
a mthod from the default package?thana
12/18/2020, 3:01 PMTheOnlyTails
12/19/2020, 12:45 PMdata class Member(val name: String, val githubUrl: String, val positions: List<String>)
external interface MemberListState : RState {
var members: List<Member>
}
class MemberList : RComponent<RProps, MemberListState>() {
override fun RBuilder.render() {
ul {
for (member in state.members) {
li {
styledA {
css { attrs.href = member.githubUrl }
+member.name
}
}
ul {
member.positions.forEach {
li { +it }
}
}
}
}
}
private fun fetchMembers() = window.fetch("./members.json").unsafeCast<Array<Member>>()
override fun MemberListState.init() {
val jsonMembers = fetchMembers()
members = listOf()
setState {
members = jsonMembers.toList()
}
}
}
The use of the code:
class App : RComponent<RProps, RState>() {
override fun RBuilder.render() {
child(MemberList::class) {}
}
}
Thanks in advance!Vladyslav Sitalo
12/19/2020, 11:47 PMKirill Garkusha
12/20/2020, 5:08 PMCannot read property context
I see that method signature in JS has additional param - continuation. How should I use it?CLOVIS
12/21/2020, 3:51 PMDaniel Rampelt
12/21/2020, 9:47 PMnode >= 12.17
and my build is failing since it seems to be running with 12.16.1
. I use nvm on my computer for other node projects, and the only versions I have installed are 8.16.2
, 10.20.1
, 12.18.3
(default), and 14.8.0
so I have no idea where where 12.16.1
is coming fromMarc Knaup
12/21/2020, 11:08 PMsuspend fun
from a regular fun
?
I only need that for unit testing a single function and can be sure that the function doesn’t actually suspend nor launch any other coroutines.Patrick Doering
12/22/2020, 2:31 PMTomas Kormanak
12/23/2020, 5:31 AMandylamax
12/23/2020, 7:47 AMsrc/main/kotlin
+ com.package.name
- main.kt
- test.kt
- people.kt
to be split into say
build/intermediate/js
+ com.package.name
- main.js
- test.js
- people.js
And then let webpack pickup from there?
What are the caveats?Robert Jaros
12/23/2020, 10:38 AMHamza GATTAL
12/23/2020, 8:42 PMandylamax
12/25/2020, 4:30 AM.gradle
directory seemed to help but not this time
> Task :sandbox-react:compileDevelopmentExecutableKotlinJs FAILED
e: java.lang.IllegalStateException: org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor@25cb2023 is not bound
at org.jetbrains.kotlin.ir.descriptors.WrappedDeclarationDescriptor.getOwner(WrappedDescriptors.kt:96)
at org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor.getContainingDeclaration(WrappedDescriptors.kt:370)
at org.jetbrains.kotlin.resolve.DescriptorUtils.getContainingModuleOrNull(DescriptorUtils.java:200)
at org.jetbrains.kotlin.resolve.DescriptorUtils.getContainingModule(DescriptorUtils.java:185)
at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getModule(DescriptorUtils.kt:64)
at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.findDeserializedDeclarationForSymbol(KotlinIrLinker.kt:523)
at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.getDeclaration(KotlinIrLinker.kt:566)
at org.jetbrains.kotlin.ir.util.ExternalDependenciesGeneratorKt.getDeclaration(ExternalDependenciesGenerator.kt:60)
at org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator.generateUnboundSymbolsAsDependencies(ExternalDependenciesGenerator.kt:50)
at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:69)
at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:51)
at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:223)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:74)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1560)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sandbox-react:compileDevelopmentExecutableKotlinJs'.
> Internal compiler error. See log for more details
Edoardo Luppi
12/26/2020, 5:53 PMEdoardo Luppi
12/26/2020, 5:53 PMandylamax
12/26/2020, 7:34 PMEdoardo Luppi
12/26/2020, 7:36 PMandylamax
12/26/2020, 7:42 PMEdoardo Luppi
12/26/2020, 7:51 PMandylamax
12/26/2020, 8:28 PMinterface ThingGetter {
fun getThing(callback: (Thing)->Unit)
}
suspend fun ThingGetter.await() = suspendCancelableCoroutine {cont->
getThing{thing->
cont.resume(thing)
}
}
Edoardo Luppi
12/26/2020, 8:30 PM