WukongRework.exe
05/02/2021, 9:37 PM@JsModule("mathjs")
and @JsNonModule
was the best way to solve npm packages on the kotlin side (according to the docs https://kotlinlang.org/docs/using-packages-from-npm.html) however this didnt work and to quote my friend: "i had literally no idea if the npm install worked like there was just no feedback on it because no gradle errors but like there wasn't any positive confirmation so while everything wasn't working i wasn't even sure if the dependency worked" and "just what the sample tells me to do but it straight up didnt work and the only error was "lusolve is not a function" like it just was completely useless and there' s no error on compilation either it's just a runtime error"
they ended up finding out a solution to fix the problem (linked in the pictures below) and it was an abstract external class marked with @JsModule
and a companion object storing all of the needed functions
i have two questions: i understand that kotlin JS is a relatively new target and doesnt get as much love as JVM or even native from wat ive seen, but y is documentation so poor on this? (is this something that should be brought up in #docs-revamped or is it already a known problem?) i also understand that the JS / npm / node ecosystem is very large and was wondering if these "hacks" will be the norm of doing things moving forward or if there are plans to make them better
side note: sorry for the language in these pictures, it was late at night and they had spent a lot of time trying to figure this outWukongRework.exe
05/02/2021, 9:51 PMRobert Jaros
05/02/2021, 10:30 PMWukongRework.exe
05/02/2021, 10:30 PM