xxfast
06/11/2021, 3:20 AMjsMain
?xxfast
06/12/2021, 2:48 AMcom.organisation.product.core
which has this kotlin class
@JSExport
class Service()
once exported with npm-publish
- when importing this from a typescript project it looks like
import {com} from "@organisation/core";
const Service = com.organisation.product.core.Service;
This kinda woks, but when you have another module (for example, com.organisation.product.feature
) they both end up sharing the com
import {com} from "@organisation/core";
import {com} from "@organisation/feature"; // not allowed
I know you can get around this with alias like
import {au as core} from "@organisation/core";
import {au as feature} from "@organisation/feature";
const Service = core.organisation.product.core.Service;
const FeatureService = login.organisation.product.feature.Service;
Is there a way to make these imports much nicer without losing my package structure from kotlin side?Grantas33
06/13/2021, 8:19 AMAyfri
06/13/2021, 9:51 PMFranco
06/15/2021, 1:02 AMPrompt
component in React Router and we can't get it to work. This is the code we have:
@file:JsModule("react-router-dom")
@file:JsNonModule
package react.router.dom
import react.Component
import react.RProps
import react.RState
import react.ReactElement
@JsName("Prompt")
internal external class Prompt : Component<PromptProps, RState> {
override fun render(): ReactElement?
}
internal external interface PromptProps : RProps {
var `when`: Boolean
var message: String
}
This is the wrapper function we created:
public fun RBuilder.prompt(show: Boolean, message: String): ReactElement {
return child(Prompt::class) {
attrs.`when` = show
attrs.message = message
}
}
And this is how we are calling it inside the render()
of another component:
prompt(show = true, message = "ERROR")
Anyone knows what we are doing wrong?andylamax
06/16/2021, 3:43 AMkotlin {
browser {}
nodejs {}
}
seems more intuitive and inline with KMM than
kotlin {
js {
browser()
nodejs()
}
}
The former unlocks
• hierarchical source sets between javascript targets
• Easier gradle resolutions for browser or node specific
• Intrinsically adding kotlinx-browser
and kotlinx-node
depedenciesNikky
06/16/2021, 10:03 AMModule parse failed: 'import' and 'export' may appear only with 'sourceType: module' (9:0)
File was processed with these loaders:
* ../../node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| *
| */
> export { FluentBundle } from "./bundle.js";
| export { FluentResource } from "./resource.js";
| export { FluentType, FluentNone, FluentNumber, FluentDateTime } from "./types.js";
SyntaxError: Unexpected token ')'
at C:/Users/nikky/AppData/Local/Temp/_karma_webpack_600784/runtime.js:1:0
i guess this is because webpack was updated, but i am completely clueless how to go about fixing thisSlackbot
06/17/2021, 7:35 AMScott Wilson-Billing
06/17/2021, 7:43 AMNikky
06/17/2021, 12:38 PMGlobalScope.launch
i see no log output at all
if i use promise
see all logs in a single line.. but the assertion seem to work.. somewhatRobert Munro
06/18/2021, 9:47 AMdangerouslySetInnerHTML
setState{
itemDescription = props.video.description
?.let { webLink.replaceLinks(it) }
?.replace("\n", "<br/>")
?: ""
}
styledDiv {
attrs["dangerouslySetInnerHTML"] = state.itemDescription
}
but i dont seem to be able to do:
attrs{
dangerouslySetInnerHTML = state.itemDescription
}
hfhbd
06/18/2021, 7:36 PMCannot run program "/root/.gradle/nodejs/node-v14.15.4-linux-x64/bin/node"
peekandpoke
06/21/2021, 11:00 AMhfhbd
06/23/2021, 2:47 PMnpm-publish
from Martynas Petušk! But if I consume the library, Typescript complaints about kotlin.js not found
.ankushg
06/24/2021, 4:31 PMcommonMain
because they're also used by iOS and JVM targets.
Any planned solutions or workarounds for this? Maybe moving external
into Common, but making it a no-op for non-JS targets?Pitel
06/25/2021, 1:30 PMTyrel Haveman
06/28/2021, 8:44 PMjs("Buffer")
outputs into the JavaScript console: Uncaught ReferenceError: Buffer is not defined
https://kotlinlang.org/docs/multiplatform-library.html#js
First of all, perhaps that example needs updated? Second, how can I resolve this in my product?Big Chungus
06/28/2021, 10:16 PMdarkmoon_uk
06/29/2021, 2:45 PMAkram Bensalem
06/29/2021, 5:11 PMgmazzo
06/30/2021, 8:56 AMJS
target that we just migrated from Kotlin 1.4
to 1.5.20
. As now IR
is the default backend, we need to annotate those key classes with JSExport
to be able to see them on JavaScript
exports.
The problem is that we need access to some enum
and interfaces
too that seems it’s not exported anymore.
Any advice on how to proceed here?
I don’t know if there is any workaround for this or if enum
and interfaces
will be supported in the future 🤔CLOVIS
06/30/2021, 1:03 PMnpx
command. I see that Kotlin/JS already bundles Yarn & co, is there a way to access it? SO recommends to use the Node-Gradle plugin, but that will install Node a second time, right?Alexander Weickmann
07/01/2021, 11:40 AMnschulzke
07/01/2021, 7:18 PMNoSuchElementException
when I try to create an HttpClient with Kotlin/JS 1.5.2 with Ktor Client 1.6.1 (legacy compiler).
According to this issue, this is a DCE problem: https://github.com/ktorio/ktor/issues/1731
When I get an error like this, how do I know which declarations need to be added to the DCE keep setting? I tried adding the one suggested in the above issue, but it didn't work:
dceTask {
keep("ktor-ktor-io.\$\$importsForInline\$\$.<http://ktor-ktor-io.io.ktor.utils.io|ktor-ktor-io.io.ktor.utils.io>")
}
CLOVIS
07/02/2021, 3:41 PMRoman Vasilyev
07/04/2021, 7:01 AMreactJs.js
is it possible to change config to get reactJs.somerandomhash.js
?Big Chungus
07/06/2021, 1:04 AMsimon.vergauwen
07/06/2021, 5:59 PMuseConfigDirectory
pointing here: https://github.com/arrow-kt/arrow/blob/main/arrow-libs/karma/chrome_bin.js
https://github.com/arrow-kt/arrow/blob/sv-js-fx-coroutines/arrow-libs/fx/arrow-fx-stm/build.gradle#L20
Disconnected (0 times) , because no message in 30000 ms.
java.lang.IllegalStateException: command '/Users/runner/.gradle/nodejs/node-v14.15.4-darwin-x64/bin/node' exited with errors (exit code: 1
Robert Munro
07/07/2021, 5:08 PMError: Can't resolve '@material-ui/core/styles/createMuiTheme'
The project has worked fine and no changes to the module on the weekend and i started another module for a website - but i rolled back to before i started deleted all build folders and still get the error?
Just wondering if anyone has seen the error before?Hampus Londögård
07/08/2021, 11:23 AMIR
compiler? 🙂Hampus Londögård
07/08/2021, 11:23 AMIR
compiler? 🙂Big Chungus
07/08/2021, 11:24 AMHampus Londögård
07/08/2021, 11:25 AMBig Chungus
07/08/2021, 11:25 AMHampus Londögård
07/08/2021, 11:25 AMBig Chungus
07/08/2021, 11:28 AMturansky
07/08/2021, 11:36 AM./gradlew clean
./gradlew --stop
before every switch Legacy <-> IRHampus Londögård
07/08/2021, 11:43 AMModule not found: Error: Can't resolve 'kotlinx-serialization-kotlinx-serialization-core-jsLegacy' in /path/to/file/dce
turansky
07/08/2021, 11:46 AMserialization
(not recommended for 1.5+
)Hampus Londögård
07/08/2021, 11:48 AM