Bernhard
07/24/2024, 11:32 PMclass wa {
constructor() {
aa = this;
var t, n, r = {template: ka("applications/settings/configure-regions.hbs")};
this.PARTS = _a([ne("form", r)]), this.DEFAULT_OPTIONS = {
tag: "form",
form: {
submitOnChange: !1, handler: (t = this, n = function (n, r, i) {
return t.sub(n, r, i)
}, n.callableName = "sub", n), closeOnSubmit: !1
},
window: {title: "Hey Joe"}
}
}
}
is this a bug?
Using @JsStatic doesn't generate it either
class ConfigureRegions : HandlebarsApplication() {
companion object {
@OptIn(ExperimentalJsStatic::class)
@JsStatic
var PARTS = recordOf(
"form" to HandlebarsTemplatePart(
template = resolveTemplatePath("applications/settings/configure-regions.hbs")
)
)
}
turansky
07/25/2024, 8:35 AM@JsStatic
probably will have effect only with @JsExport
annotation for classBernhard
07/25/2024, 9:00 AMBernhard
07/25/2024, 9:00 AMTask :jsProductionExecutableCompileSyncReferenceError: foundry is not defined at /tmp/_karma_webpack_625642/commons.js7971 java.lang.IllegalStateException: command '/home/bernhard/.gradle/nodejs/node-v22.0.0-linux-x64/bin/node' exited with errors (exit code: 1)
Bernhard
07/25/2024, 9:01 AMturansky
07/25/2024, 9:04 AMPromise<Void>
?Bernhard
07/25/2024, 9:05 AMturansky
07/25/2024, 9:06 AMbuildPromise {
...
null
}
Bernhard
07/25/2024, 9:06 AMBernhard
07/25/2024, 9:11 AMturansky
07/25/2024, 9:12 AMBernhard
07/25/2024, 9:12 AMBernhard
07/25/2024, 9:13 AMBernhard
07/25/2024, 9:57 AMBernhard
07/25/2024, 9:58 AMconst foundry = {
applications: {
api: {
HandlebarsApplicationMixin: (klass) => {
return class extends klass {
}
},
ApplicationV2: class {
}
}
}
}
then the following into webpack.config.d
// load stubs
config.files.unshift("kotlin/foundry-stubs.js")
turansky
07/25/2024, 12:19 PMConfigureRegions::class.js
will give you JS classturansky
07/25/2024, 12:19 PMJsClass<ConfigureRegions>
turansky
07/25/2024, 12:20 PMfoundry-stubs.js
isn't required in that caseBernhard
07/25/2024, 1:34 PMturansky
07/25/2024, 2:06 PMturansky
07/25/2024, 2:06 PMturansky
07/25/2024, 2:08 PMJsFunction
factory can be used for your goalBernhard
07/25/2024, 2:08 PM