Thanhhai08sk
02/25/2020, 8:47 AM...
function createApplicationScreenMessage() {
return 'Kotlin Rocks on ' + platformName();
}
var package$kotlinnativetest = package$org.kotlinnativetest || (package$org.kotlinnativetest = {});
package$kotlinnativetest.main = main;
package$kotlinnativetest.createApplicationScreenMessageJs = createApplicationScreenMessage;
...
This is maybe a dumb question but I'm new to js. How could I call the "createApplicationScreenMessageJs" function in js?Ilya Goncharov [JB]
02/25/2020, 8:57 AMorg.kotlinnativetest.createApplicationScreenMessage
Thanhhai08sk
02/25/2020, 9:17 AMEivind Nilsbakken
02/25/2020, 12:32 PMcreateApplicationScreenMessage()
in the above example?turansky
02/25/2020, 12:42 PMcomponent
plugin can do that simply for Kotlin/JS 1.3.70
https://github.com/turansky/kfc-plugins#componentIlya Goncharov [JB]
02/25/2020, 12:42 PMEivind Nilsbakken
02/25/2020, 12:48 PMDisable DCE
might be a problem for me though, if that's accurate.
@Ilya Goncharov [JB] The use-case is a multiplatform project where I want to produce a Java package and an npm module. I know this isn't really supported (yet), but I want to preserve the package for Java consumers, so I'm reluctant to place the code in root package.Eivind Nilsbakken
02/25/2020, 12:57 PMturansky
02/25/2020, 12:57 PMlibrary
plugin. component
plugin only configure DCE & WebpackEivind Nilsbakken
02/25/2020, 12:58 PMturansky
02/25/2020, 1:01 PMturansky
02/25/2020, 1:06 PMEivind Nilsbakken
02/25/2020, 1:12 PMsrc/jsMain/resources/index.js
, which is an idea I picked up from an article on this subject. I'd still need the package.json
for my use-case (publishing to an npm registry for use by non-kotlin Javascript apps), but if the plugin can fix this specific issue, I'd no longer need index.js
, and then most of my hacks would be limited to build.gradle.kts
.turansky
02/25/2020, 1:53 PMturansky
02/25/2020, 1:56 PMenums
"package"?
https://gitlab.com/fleskesvor/tabletop-enums/-/blob/master/src/jsMain/resources/index.js#L4Eivind Nilsbakken
02/25/2020, 2:32 PMturansky
02/25/2020, 2:46 PMconst type = com.fleskesvor.tabletop.Type.BOARDGAME
After "crop":
const type = Type.BOARDGAME
Eivind Nilsbakken
02/25/2020, 2:53 PMimport * as TE from 'tabletop-enums';
console.log(TE.Type.BOARDGAME.description);
🤔turansky
02/25/2020, 3:28 PMturansky
02/25/2020, 3:28 PMEivind Nilsbakken
02/25/2020, 3:41 PMcom.fleskesvor.tabletop
package though. Plus, I'd need a root element to access anything in the sub packages. What would the syntax for that be like with crop?turansky
02/25/2020, 5:08 PM@JsExport
).turansky
02/25/2020, 5:09 PMcard
package in your example - it will be available too.turansky
02/25/2020, 5:12 PMEivind Nilsbakken
02/25/2020, 5:25 PMcom.fleskesvor.tabletop
, 20 files in com.fleskesvor.tabletop.card
, 15 in com.fleskesvor.tabletop.dice
, and so on.
EDIT: The second line would be eq. const { Bridge, Poker, Suite } = card;
if that package also had Bridge
and Poker
enums, right?turansky
02/26/2020, 6:35 AM0.1.1
for multiplatform.turansky
02/26/2020, 6:36 AMEivind Nilsbakken
02/26/2020, 7:22 AM