andylamax
08/25/2021, 1:16 PMnpm-publish
with no avail. The plugin works well on my machine to publish on ithub packages. But fails on github ci. Have you tested it on CI? Is there an example?Ayfri
08/25/2021, 3:55 PMRichard Glen
08/25/2021, 4:42 PMafterEvaluate
?
I'm following a mentioned solution here
.
But I'm having an issue:Pitel
08/26/2021, 7:32 AMbrowserDevelopmentRun
) or production (assemble
)?Richard Glen
08/26/2021, 4:02 PMankushg
08/26/2021, 5:39 PMPavel Matusevich
08/26/2021, 8:54 PMstatic propTypes = {/* ... */ 'data-test': PropTypes.string, /* ... */ };
) How can I implement this prop in Kotlin/JS (I've tried @JsName("data-test")
, but it says "Name contains illegal chars that can't appear in JavaScript identifier")?Pitel
08/27/2021, 10:57 AMval p = p { +"Should not render!"}
(but it renders)Robert Jaros
08/27/2021, 12:04 PMJilles van Gurp
08/27/2021, 6:41 PMjs(...)
call. I'm trying to figure out why. The other two fail with an "object is not iterable" somewhere deep in the maplibre libraries. It seems to expect a javascript object that is iterable and whatever kotlin-js does with this, seems to not meet the expectations when dealing these options. Also, the only way I can get the library to initialize is via index.html; if I load it via implementation(npm("..."
)) instead I get a maplibre-gl not found error with the working variant and the same error for non-iterable objects with the other two.
Here's my code. I would appreciate any suggestions for getting some working type definitions for this as messing with js()
is a bit ugly. The init gets called after the dom tree with the container is created. Only variant 3 renders the map.
external interface MapboxOptions {
var container: String
var style: String
var center: Array<Double>
var zoom: Int
}
external open class Map(options: dynamic)
class MapManager() {
var map: dynamic = null
fun init() {
// variant 1, fails with "Object is not Iterable" in map.js on the line that works with the options
// val options = object : MapboxOptions {
// override var container = "maplibre-container"
// override var style = "<https://demotiles.maplibre.org/style.json>"
// override var center = arrayOf(13.0, 52.0)
// override var zoom = 4
// }
// println(options)
// map = Map(options)
// variant 2, same failure
// val options = js("""
// {
// container: "maplibre-container",
// style: "<https://demotiles.maplibre.org/style.json>",
// center: [13.0,52.0],
// zoom: 3,
// }
// """)
// map=Map(options)
// variant 3, works?!?!
map = js(
"""
var map = new maplibregl.Map({
container: "maplibre-container",
style: "<https://demotiles.maplibre.org/style.json>",
center: [13.0,52.0],
zoom: 3,
});
console.log("created map ");
console.log(map);
return map;
"""
)
console.log(map)
return map
}
}
Jeff Davidson
08/28/2021, 7:11 PMinternal
objects/classes? I was able to access them from JS with the legacy compiler, but needed to remove internal
to access them with IRUNuX
08/30/2021, 8:29 AMankushg
08/30/2021, 6:05 PMFunction "myfunction" is never used
warnings on `@JsExport`ed objects.
My whole reason to export the object is that I want myfunction
to be called from JS and not Kotlin
Any way to disable that warning specifically on methods/properties of exported declarations?Ayfri
08/30/2021, 7:35 PMwindow.onload = {
val canvas = document.body!!.append.canvas {} as HTMLCanvasElement
val ctx = canvas.getContext("2d") as CanvasRenderingContext2D
ctx.fillStyle = "green"
ctx.fillRect(10.0, 10.0, 100.0, 100.0)
}
martmists
08/31/2021, 12:06 PMmartmists
08/31/2021, 3:03 PMExecution failed for task ':jvmProcessResources'.
> Entry server_style.css is a duplicate but no duplicate handling strategy has been set. Please refer to <https://docs.gradle.org/7.1/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy> for details.
I also get this while trying to run my project, it says server_style.css is duplicate but it's only in jvmMain/resources and not in jsMain/resources or commonMain/resourcesRob Murdock
08/31/2021, 4:07 PMNikolai Sviridov
09/01/2021, 12:59 PMElement type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `Router.Consumer`.
More in thread.Sebastian
09/01/2021, 4:47 PMInstant
from the kotlinx-datetime package inside that project and now the exported JS package requires "@js-joda/core" to be present in order to function (even though the class using the Instant is not annotated with @JSExport
). Is anyone aware of a way to make the integration work without needing to add the @js-joda/core library to the JS project? 🤔
Update: Looks like there should be some way to configure the dependency "org.jetbrains.kotlinxkotlinx datetime0.2.1" to not be used for the JS target. But even after reading the docs it’s not very clear to me how to achieve that.martmists
09/01/2021, 6:11 PM8:08:52 PM: Executing task 'browserDevelopmentRun --continuous'...
> Task :wrapper
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See <https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
Exiting continuous build as no executed tasks declared file system inputs.
> Task :kotlinNodeJsSetup SKIPPED
> Task :kotlinNpmCachesSetup
> Task :packageJson UP-TO-DATE
> Task :rootPackageJson UP-TO-DATE
> Task :kotlinNpmInstall UP-TO-DATE
> Task :generateExternalsIntegrated SKIPPED
> Task :downloadSass UP-TO-DATE
> Task :installSass UP-TO-DATE
> Task :compileSass UP-TO-DATE
> Task :sassCopy UP-TO-DATE
> Task :compileKotlinJs UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :mainClasses UP-TO-DATE
> Task :compileDevelopmentExecutableKotlinJs UP-TO-DATE
> Task :developmentExecutableCompileSync UP-TO-DATE
> Task :browserDevelopmentRun
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See <https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 4s
13 actionable tasks: 2 executed, 11 up-to-date
Waiting for changes to input files of tasks... (ctrl-d to exit)
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See <https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings>
FAILURE: Build failed with an exception.
* What went wrong:
java.nio.file.AccessDeniedException: /var/lib/docker
> /var/lib/docker
* 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>
BUILD FAILED in 4s
8:08:59 PM: Task execution finished 'browserDevelopmentRun --continuous'.
How do I solve this error? I'm just trying to run my react app in development mode 😕Pitel
09/02/2021, 7:22 AMvar data by useState<List<MessageTemplateDto>>()
useEffectOnce {
MainScope().launch{
data = someSuspendingFetch()
console.log(data) // undefined?!
}
}
makeTable(data) // renders table with data
WTF?! Why is data
right after assigning it someSuspendingFetch()
undefined
, and yet it renders table with them.Pitel
09/02/2021, 9:29 AMref
in RBuilder
after this change?!Nikolai Sviridov
09/02/2021, 5:28 PMandylamax
09/03/2021, 10:54 AMrootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().versions.webpackDevServer.version =
"4.0.0-rc.0" // tried "4.0.0", "4.1.0"
}
Nothing worksNikolai Sviridov
09/03/2021, 11:14 AM...
import TreeView from '@material-ui/lab/TreeView';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
...
<TreeView
defaultCollapseIcon={<ExpandMoreIcon />}
>
...
Wrappers for TreeView
and ExpandMoreIcon
exists, but how to recreate defaultCollapseIcon={<ExpandMoreIcon />}
?Joffrey
09/04/2021, 5:08 PMwindow
but it's always non-null in Kotlin, it just fails at runtime on NodeJS.andylamax
09/05/2021, 6:47 AMDazai
09/05/2021, 7:14 PMuplink
09/06/2021, 11:39 PMSu5eD
09/07/2021, 12:38 PM