Lawik
04/24/2019, 11:33 AMturansky
04/25/2019, 10:05 AMAbstractTester
in Kotlin (without js)?pabl0rg
04/25/2019, 7:31 PMspand
04/26/2019, 9:15 AMError:Kotlin: [Internal Error] kotlin.KotlinNullPointerException
at org.jetbrains.kotlin.incremental.TranslationResultMap.remove(IncrementalJsCache.kt:166)
at org.jetbrains.kotlin.incremental.IncrementalJsCache.clearCacheForRemovedClasses(IncrementalJsCache.kt:107)
at org.jetbrains.kotlin.jps.targets.KotlinJsModuleBuildTarget.updateCaches(KotlinJsModuleBuildTarget.kt:228)
at org.jetbrains.kotlin.jps.build.KotlinBuilder.doBuild(KotlinBuilder.kt:464)
at org.jetbrains.kotlin.jps.build.KotlinBuilder.build(KotlinBuilder.kt:295)
... more
Alexander Weickmann
04/29/2019, 4:35 PMimport * as tslib_1 from "tslib";
import * as React from 'react';
import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent, } from '@atlaskit/analytics-next';
import { name as packageName, version as packageVersion } from './version.json';
import Div from './styled';
var Blanket = /** @class */ (function (_super) {
tslib_1.__extends(Blanket, _super);
function Blanket() {
return _super !== null && _super.apply(this, arguments) || this;
}
Blanket.prototype.render = function () {
var _a = this.props, canClickThrough = _a.canClickThrough, isTinted = _a.isTinted, onBlanketClicked = _a.onBlanketClicked;
var onClick = canClickThrough ? null : onBlanketClicked;
var containerProps = { canClickThrough: canClickThrough, isTinted: isTinted, onClick: onClick };
return React.createElement(Div, tslib_1.__assign({}, containerProps));
};
Blanket.defaultProps = {
canClickThrough: false,
isTinted: false,
onBlanketClicked: function () { },
};
return Blanket;
}(React.Component));
export { Blanket as BlanketWithoutAnalytics };
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
export default withAnalyticsContext({
componentName: 'blanket',
packageName: packageName,
packageVersion: packageVersion,
})(withAnalyticsEvents({
onBlanketClicked: createAndFireEventOnAtlaskit({
action: 'clicked',
actionSubject: 'blanket',
attributes: {
componentName: 'blanket',
packageName: packageName,
packageVersion: packageVersion,
},
}),
})(Blanket));
//# sourceMappingURL=Blanket.js.map
My binding:
@file:JsModule("@atlaskit/blanket")
package atlaskit
import org.w3c.dom.events.Event
import react.*
external class Blanket : Component<BlanketProps, RState> {
override fun render()
}
external interface BlanketProps : RProps {
var canClickThrough: Boolean
var isTinted: Boolean
var onBlanketClicked: (Event) -> Unit
}
Creation:
child(Blanket::class) {
attrs.isTinted = true
attrs.canClickThrough = true
attrs.onBlanketClicked = {}
}
This prints following error to the console: "Uncaught (in promise) TypeError: Cannot read property '$metadata$' of undefined"
Any tips on what I am doing wrong?sdeleuze
05/02/2019, 9:41 AMNikky
05/06/2019, 6:37 PMParse error at build/kotlin-js-min/client-js/main/d2v-chord-js.js.map:1,10
{"version":3,"file":"d2v-chord-js.js","sources":["../../../../../d2v-chord-commo
^
ERROR: Unexpected token: punc «:», expected: punc «;»
at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:20:1), <anonymous>:71:23)
at fatal (/usr/lib/node_modules/uglify-js/bin/uglifyjs:296:53)
at run (/usr/lib/node_modules/uglify-js/bin/uglifyjs:240:9)
at Object.<anonymous> (/usr/lib/node_modules/uglify-js/bin/uglifyjs:165:5)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
an i am not sure if thats a well known error or if i am calling uglifyjs completely wrongthana
05/07/2019, 7:45 AMJoffrey
05/07/2019, 1:49 PMexternal
declarations. I guess I could generate Kotlin externals using ts2kt, but is it done out-of-the box by the plugin?nulldev
05/09/2019, 5:21 PMjacob
05/13/2019, 7:44 AMSergio Casero
05/13/2019, 9:17 AMERROR in ../node_modules_imported/kotlin-extensions/kotlin-extensions.js
Module not found: Error: Can't resolve 'core-js/features/object/assign' in '/home/sergio/projects/timesheet/js/build/node_modules_imported/kotlin-extensions'
@ ../node_modules_imported/kotlin-extensions/kotlin-extensions.js 112:37-78
@ ../node_modules_imported/kotlin-react-dom/kotlin-react-dom.js
@ ./output.js
Any help? It's rare because I have another project with exactly the same structure and works fine
I'll paste the build.gradle file on the threadSergio Casero
05/13/2019, 10:55 AMLawik
05/14/2019, 6:53 AMkotlin-frontend
plugin? Preferably from the resources
folder.Alexander Weickmann
05/15/2019, 11:37 AMthana
05/15/2019, 12:41 PMjanvladimirmostert
05/16/2019, 8:37 AMspand
05/16/2019, 9:04 AMclass MyComponent extends React.Component {
render () {
return <div className={this.props.classes.root} />;
}
}
export default withStyles(styles)(MyComponent);
hallvard
05/16/2019, 9:27 AMU75957
05/18/2019, 6:03 AMgetter/setters
via Object.defineProperty
. For example:
external interface IModel {
val id: Int
var name: String
}
class CModel (
override val id: Int,
override var name: String
) : IModel
will transpilled to:
function CModel(id, name) {
this.id_4s8xc9$_0 = id;
this.name_j0rqo7$_0 = name;
}
Object.defineProperty(CModel.prototype, 'id', {
get: function () {
return this.id_4s8xc9$_0;
}
});
Object.defineProperty(CModel.prototype, 'name', {
get: function () {
return this.name_j0rqo7$_0;
},
set: function (name) {
this.name_j0rqo7$_0 = name;
}
});
How to avoid generating getter/setter
? I need to interact with JS/TS libs. And such libs see only mangled fields, because properties defined via Object.defineProperty
not accessible by Object.getOwnPropertyNames()
. Using external interface
and @JsName()
don't help.
If we define class
, which does not implement any interface
such getter/setters
will not be generated. I also noticed that such getter/setters
are generated only for properties which have override
Ilya Goncharov [JB]
05/20/2019, 10:33 AMrobnik
05/21/2019, 8:10 AMkotlin-dce-js
plugin (https://kotlinlang.org/docs/reference/javascript-dce.html) still the thing to use, or is this frontend plugin replacing it? https://github.com/Kotlin/kotlin-frontend-pluginRobert Jaros
05/24/2019, 2:37 PMResult<V, E : Exception>
(similar to: https://github.com/kittinunf/Result) with support for Kotlin/JS?eygraber
05/24/2019, 7:12 PM/functions
that contains index.js
, node_modules
, package.json
and package-lock.json
. My source is in /src/main/kotlin
. Every time I build, index.js
is correctly put into /functions
but the other files are deleted. My build.gradle
file is below. Any one have any advice?
plugins {
id 'kotlin2js' version '1.3.31'
}
group 'com.myapp'
version '1.0.0'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
testImplementation "org.jetbrains.kotlin:kotlin-test-js"
}
compileKotlin2Js.kotlinOptions {
moduleKind = "commonjs"
outputFile = "functions/index.js"
sourceMap = true
}
eygraber
05/24/2019, 7:25 PM./gradlew build
it does not.fcosta
05/25/2019, 4:37 PMapplicationApi.fetchCharacters(function (result) {
console.log(result)
})
And the error:
IllegalStateException: No more continuations to resume
Any suggestion on what it's going on?Dima Avdeev
05/26/2019, 6:29 AMRohan Maity
05/26/2019, 11:29 AMSlackbot
05/26/2019, 12:05 PMsimon.vergauwen
05/27/2019, 12:31 PMsimon.vergauwen
05/27/2019, 12:31 PMspand
05/27/2019, 12:50 PMDate.getTime()
and https://developer.mozilla.org/en-US/docs/Web/API/Performancesimon.vergauwen
05/27/2019, 12:54 PMgetTimeNanos
or CLOCK_MONOTONIC
in Js.spand
05/27/2019, 1:08 PMThis method provides nanosecond precision, but not necessarily
* nanosecond resolution (that is, how frequently the value changes)
* - no guarantees are made except that the resolution is at least as
* good as that of {@link #currentTimeMillis()}.
simon.vergauwen
05/27/2019, 1:09 PMClock
abstraction for Arrow. Some other MPP languages (or frameworks in languages) I checked offer both since nanos
is better suited for tracking timed events compared to millis
.ribesg
05/27/2019, 1:20 PMsimon.vergauwen
05/27/2019, 1:21 PMribesg
05/27/2019, 1:33 PMfcosta
05/27/2019, 2:44 PMribesg
05/27/2019, 2:50 PMsimon.vergauwen
05/27/2019, 2:54 PMbashor
05/27/2019, 8:02 PMjs("Date").now()
or window.performance.now()
window
you need import kotlin.browser.window
simon.vergauwen
05/27/2019, 8:34 PM