Gurupad Mamadapur [FH]
12/24/2019, 12:34 PMModule not found: Error: Can't resolve 'text-encoding'
Module not found: Error: Can't resolve 'abort-controller'
Module not found: Error: Can't resolve 'utf-8-validate'
Module not found: Error: Can't resolve 'bufferutil'
Robert Jaros
12/26/2019, 1:30 PMSamuel Michael
12/27/2019, 12:10 PMSamuel Michael
12/27/2019, 4:42 PMcamdenorrb
12/28/2019, 6:33 AMPaul N
12/30/2019, 2:34 PMdate.getHours()
and I'm getting "TypeError: date.getHours is not a function" as an error in the browser.
I don't quite understand this; does my date object not contain a date or something ?tylerwilson
12/30/2019, 5:52 PMFAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':salonbizlibrary:jsPackageJson'.
> NPM Dependencies already resolved and installed
This is the js sestion:
jsMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$serialization_version"
implementation "io.ktor:ktor-client-js:$ktor_version"
implementation "io.ktor:ktor-client-core-js:$ktor_version"
implementation "io.ktor:ktor-client-json-js:$ktor_version"
implementation "io.ktor:ktor-client-serialization-js:$ktor_version"
//implementation(npm("moment", "2.24.0"))
implementation(npm("crypto-js", "3.1.9-1"))
}
}
If I do not include the npm dependency, it builds fine.pavel.v
01/01/2020, 2:10 PMPaul N
01/01/2020, 10:26 PMTobi
01/03/2020, 2:56 PMCould not find method npm() for arguments [org.jetbrains:kotlin-react, 16.9.0-pre.83] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Thanks in advance.
plugins {
id 'org.jetbrains.kotlin.js' version '1.3.61'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.61'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
maven {
url "<https://dl.bintray.com/kotlin/kotlin-eap>"
}
mavenCentral()
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:0.14.0"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.2'
implementation "io.ktor:ktor-client-js:1.2.6"
implementation "io.ktor:ktor-client-json-js:1.2.6"
implementation("io.ktor:ktor-client-serialization-js:1.2.6")
testImplementation "org.jetbrains.kotlin:kotlin-test-js"
implementation(npm("org.jetbrains:kotlin-react", "16.9.0-pre.83"))
implementation(npm("org.jetbrains:kotlin-react-dom", "16.9.0-pre.83"))
}
kotlin {
target {
browser {}
nodejs {}
}
}
Alexander
01/04/2020, 7:01 PMPaul N
01/05/2020, 6:22 PMimport react.*
and my gradle build file (this time in Kotlin):
plugins {
id("org.jetbrains.kotlin.js") version "1.3.61"
}
repositories {
mavenCentral()
jcenter()
}
kotlin {
sourceSets.forEach { sourceSet ->
// double check source sets are OK
sourceSet.kotlin.sourceDirectories.files.forEach {
println(it.absoluteFile)
}
}
sourceSets["main"].dependencies {
implementation(npm("react", "16.8.3"))
implementation(npm("@jetbrains/kotlin-css", "1.0.0-pre.89"))
implementation(npm("@jetbrains/kotlin-css-js", "1.0.0-pre.89"))
implementation(npm("@jetbrains/kotlin-styled", "1.0.0-pre.89"))
implementation(npm("react-google-charts"))
}
target {
browser {
}
}
}
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.2")
}
contents of generated file .......build/js/packages/myprojectname/package.json
{
"main": "kotlin/myprojectfile.js",
"devDependencies": {
"webpack": "4.41.2",
"webpack-cli": "3.3.9",
"webpack-dev-server": "3.8.2"
},
"dependencies": {
"kotlin": "1.3.61",
"kotlinx-coroutines-core": "1.3.2",
"kotlin-source-map-loader": "1.3.61",
"react": "16.8.3",
"@jetbrains/kotlin-css": "1.0.0-pre.89",
"@jetbrains/kotlin-css-js": "1.0.0-pre.89",
"@jetbrains/kotlin-styled": "1.0.0-pre.89",
"react-google-charts": "*"
},
"peerDependencies": {},
"optionalDependencies": {},
"bundledDependencies": [],
"name": "myprojectfile",
"version": "0.0.0-unspecified"
}
Nikky
01/07/2020, 10:18 PM:shared
multiplatform project
i am not sure what the "correct" way to do this is anymorespierce7
01/09/2020, 4:51 AMiseki
01/09/2020, 12:54 PMiseki
01/09/2020, 1:54 PMIvan Osipov
01/10/2020, 11:17 AMmzgreen
01/12/2020, 4:08 PMNikky
01/12/2020, 6:14 PMNikky
01/13/2020, 10:32 AMNikky
01/13/2020, 12:03 PM.d.ts
source to reference the manually fixed up typedefinition of eg. https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-react
i believe there is a huge demand for generating externals for all kinds of react components that are compatible with the jetbrains maintained wrappersIlya Goncharov [JB]
01/13/2020, 2:38 PMRobert Jaros
01/13/2020, 4:51 PMthana
01/14/2020, 9:35 AMVladyslav Sitalo
01/15/2020, 4:20 AMpackage.json
generated by KotlinJS plugin? (looking to update the scripts
section like here: https://github.com/sindresorhus/alfy#publish-to-npm)thana
01/15/2020, 8:51 AMbrowserWebpack
corretly? i realised the bundled js file e.g. does not contain the kotlin.js dependency...
is adding implementation(npm("kotlin", "${extra["kotlin_version"]}"))
the correct way to reach this?
I cannot try that because then it says "Cannot find kotlin@1.3.61 in yarn.lock".
What am i missing?Nikky
01/16/2020, 9:49 AM1.3.70-eap-42
? i tried to apply https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library but it seems to not workpjagielski
01/16/2020, 10:15 AMiseki
01/17/2020, 5:12 AMpjagielski
01/17/2020, 1:05 PMpjagielski
01/17/2020, 1:05 PMbashor
01/17/2020, 2:07 PMIlya Goncharov [JB]
01/17/2020, 2:26 PMwebpack.config.d
You can create js file in it with content smth like
config.devServer = config.devServer || {}
config.devServer.port = ...
Robert Jaros
01/17/2020, 2:40 PMrunTask {
outputFileName = "main.bundle.js"
devServer = KotlinWebpackConfig.DevServer(
open = false,
port = 3000,
contentBase = listOf("$buildDir/processedResources/frontend/main")
)
}
webpack.config.d
pjagielski
01/17/2020, 2:46 PMkotlin {
js {
browser {
runTask ...
}
?webpack.config.d
approach is a bit too low, maybe for webdevs, not kotlin programmers, that were promised that webpack is managed by plugin 😉8080
as default is a bit too agressive I think 😉Ilya Goncharov [JB]
01/17/2020, 2:51 PMkotlin {
js {
browser {
runTask {
devServer = KotlinWebpackConfig.DevServer(
port = 3000,
contentBase = listOf("$buildDir/processedResources/frontend/main"
)
}
}
But in case with webpack.config.d
you do stuff via low level js config, but don’t need to overwrite contentBase
property
We think about how to do good DX with gradle plugin for this purposes.pjagielski
01/17/2020, 2:54 PMorg.jetbrains.kotlin.gradle.targets.js.dsl
?Ilya Goncharov [JB]
01/17/2020, 2:57 PMorg.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
if it is what you want