Norbi
09/29/2022, 7:30 AMexternal interface KeycloakConfig {
var url: String?
get() = definedExternally
set(value) = definedExternally
var realm: String
var clientId: String
}
Could you explain why the explicit get()/set() is needed in case of nullable properties?
Thanks.georgi
09/30/2022, 4:36 PMpackage.json
file does not have a main
entry point, while all my module `package.json`s do have corresponding entries for the main .js
file. I'm aware we can customise these by doing something like the below, but that only changes the relevant module's package.json
.
js(IR) {
compilations["main"].packageJson {
customField(
"dependencies", mapOf(
"a" to "b"
)
)
}
}
Is there a way to modify the root package.json
, i.e. the one that lives in build/js/package.json
? I basically want to add a main
property pointing to my module entry point.Eugene Maksymenko
10/02/2022, 8:43 PMRobert Munro
10/03/2022, 12:49 PMKeith Miller
10/04/2022, 5:52 PMKeith Miller
10/05/2022, 4:15 AMresponsivefontsizes
for the theme?Seth Madison
10/05/2022, 5:33 AMimport foo = x.y.z
to deal with the long namespaces produced by JS IR (https://www.typescriptlang.org/docs/handbook/namespaces.html#aliases). It seems that babel added support for namespaces back in 7.15.0, but @babel/presets-typescript
has not yet upgraded, so you need to pull in your own @babel/plugin-transform-typescript
. I ended up with a config like this:
return {
presets,
plugins,
overrides: [
// Note, preset-typescript does not have the latest version of plugin-transform-typescript
// which includes support for import a = x.y.z (<https://github.com/babel/babel/pull/13528>)
// so we just use plugin-transform-typescript directly, based on:
// <https://github.com/babel/babel/blob/main/packages/babel-preset-typescript/src/index.ts>
{
test: /\.ts$/,
plugins: [['@babel/plugin-transform-typescript', {}]],
},
{
test: /\.tsx$/,
plugins: [['@babel/plugin-transform-typescript', { isTSX: true }]],
},
],
}
Robert Jaros
10/05/2022, 2:12 PMKatarzyna
10/06/2022, 8:38 AMHakon Grotte
10/06/2022, 9:30 AMsx
prop?Leon
10/06/2022, 12:49 PMMaggie Weber
10/06/2022, 5:37 PMKristian Nedrevold
10/09/2022, 8:21 PMAdam Cooper
10/09/2022, 9:11 PMapplication {
mainClass.set("...")
}
for JavaScript?PhongBM
10/10/2022, 10:44 AMgeorgi
10/11/2022, 8:54 AMjs
target yet unfortunately
• ...anything else?PhongBM
10/12/2022, 2:16 PMexternal fun require(module: String): dynamic
fun main() {
val express = require("express")
val app = express()
app.get("/") { _, res ->
res.json("Success")
}
app.listen(3000) {
console.log("Server is running...")
}
}
'express' has data type dynamic, IDE does not support code completion.Seth Madison
10/13/2022, 6:33 PMchristophsturm
10/13/2022, 9:08 PMDavid Herman
10/13/2022, 10:42 PMper-module
instead of whole-program
.
I know I can just change the granularity back, but before I do that, I'm trying to, in code, generate an index.html
file will all the separate JS files imported via <script>
tags. The problem is, I don't know the order to import them. Is there a way to find out?Vampire
10/16/2022, 3:08 AMDict
subinterface that I need to give as argument, how do I properly construct it?
In this case it is the external interface OutgoingHttpHeaders : Dict<dynamic /* Number | String | Array<String> */>
from kotlinx-nodejs
Blake Anderson
10/18/2022, 5:45 AMExpression.Access.Variable
and Pattern.Variable
. Here's some debug output from my testing:
visit Variable(name=x)
> is Expression.Access.Variable: false
> is Pattern.Variable: true
Matched is Pattern.Variable
> func = function (p0) { return $boundThis.visit_ta6mxa_k$(p0); }
visit pattern variable: Variable(name=x)
visit Variable(qualifier=null, name=x)
> is Expression.Access.Variable: true
> is Pattern.Variable: false
Matched is Expression.Access.Variable
> func = function (p0) { return $boundThis.visit_ta6mxa_k$(p0); }
visit pattern variable: Variable(qualifier=null, name=x)
So, the is
check of my when
statement seems to be working fine - it's the actual function visit(ast: Expression.Access.Variable)
versus visit(ast: Pattern.Variable)
that's off (via val func: Type -> T = ::visit
). I'm guessing it's the function resolution, but could be an implementation layer. Continuing to dig around here to see what I can find out.
EDIT: Self-contained example in thread.Matt Nelson
10/18/2022, 7:57 AMjsMain
in order to uncompress and persist to FS. Resources in question are in src/jsMain/resources
directory.
With java you'd just call
javaClass.getResourcesAsStream("/path/myresource.txt.gz")
1. Is there a similar way to java's for accessing them at runtime?
2. The files should not be served as content, would there be a better way to distribute them then as resources?bashor
10/18/2022, 1:34 PMAdemir Queiroga
10/21/2022, 5:12 PM@JsExport
@Serializable
data class Account(
val id: String,
val appName: String?,
val availableCredits: Float,
)
When exported to javascript and logging an instance of this class the property names get all messed up.
Account { n4n_1: 'test_id', o4n_1: 'test_name', p4n_1: 10 }
Does anyone know why and how to fix this? In the .ts
file the constructor has the all parameters correctly named and the IDE parameter hints are also all correct (and typed). I’m only facing this issue when logging the instances…andylamax
10/23/2022, 1:11 AMjsBrowserTest
configuration broken?? funny thing is jsNodeTests
passes with no problem.
I am getting a bunch of
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
Any known solutions to this?andylamax
10/24/2022, 1:31 PMnpm-publish
doesn't fully support Configuration Cache.
I say "doesn't support fully" because, if I comment out dependency configurations on the packageJson block, everything works fine. But if I include those configs, it fails with the error
Execution failed for task ':picortex-sdk-react:assembleJsPackage'.
> Error while evaluating property 'package$npm_publish_gradle_plugin.packageJson.dependencies' of task ':picortex-sdk-react:assembleJsPackage'
> Failed to query the value of property 'dependencies'.
> Could not create an instance of type dev.petuska.npm.publish.extension.domain.json.JsonObject.
> Could not generate a decorated class for type JsonObject.
> class sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to class java.lang.reflect.ParameterizedType (sun.reflect.generics.reflectiveObjects.TypeVariableImpl and java.lang.reflect.ParameterizedType are in module java.base of loader 'bootstrap')
Is there a known current workaround you?? Also, should I create a ticket for this in github??
Tested Versions.
npm-publish: 3.0.3
kotlin : 1.7.10 & 1.7.20
gradle : 7.5.1
jdk : openjdk_18
CLOVIS
10/24/2022, 9:40 PMsrc/main/resources
, maven-publish
correctly adds it to the generated .klib
, but it doesn't seem like a downstream project can access it, it is extracted in /build/tmp/expandedArchives
but doesn't seem to be copied anywhere. Do you know how the downstream library can use it? I expected it to appear in build/js/packages/<module>
since that's where Webpack executes.kang wang
10/26/2022, 10:33 AMLeon
10/27/2022, 2:46 PMNPM
in Kotlin/JS gradle?