7 ms·
Meanwhile in real reactive environments: import QtQuick 2.7 import QtQuick.Controls 1.1 Rectangle { property real count: 0
by jcelerier 9y ago
Meanwhile in real reactive environments:
import QtQuick 2.7
import QtQuick.Controls 1.1
Rectangle {
property real count: 0
Column {
Text {
text: count
color: "#09c"
font.pointSize: 24
}
Button {
text: "Click me!"
onClicked: count++
}
}
}
Also the so-called "60fps smooth" animation has noticeable stutters on Firefox on linux.
- hobofan 9y agoHow is that related to the topic? (apart from the last sentence)
- jcelerier 9y agoisn't the topic reactive JS-based UI frameworks ? Marko compare itselfs to Vue; it should be compared to other UI frameworks in the same problem domain too.
- hobofan 9y agoSaying 'this is what a "real" (whatever that is supposed to mean) reactive framework looks like' without saying anything else, is not really a constructive comment, and to me looks more like bashing or an attempt to start a flamewar. Apart from that Qt is a non-web framework, rarely used in combination with Javascript last time I checked, so even inside the problem domain it is barely related.
- jcelerier 9y ago> Apart from that Qt is a non-web framework, rarely used in combination with Javascript last time I checked, so even inside the problem domain it is barely related. http://qmlweb.github.io/ http://qmlweb.github.io/ QML (the language in my snippet) is based on javascript; "rarely used in combination with Javascript last time I checked" has been false since roughly 2008 (wrong, actually 2010) when it was introduced.
- hobofan 9y agoI probably shouldn't have worded it that loosely. What I meant was "with Javascript as a host language". https://github.com/qmlweb/qmlweb/releases https://github.com/qmlweb/qmlweb/releases lists the first release as 2016, and the first blog post that mentions an experimental version of it is from 2013. Unless this is ignoring any prior art, this is far more recent than 2008.
- jcelerier 9y agoJust checked and I was wrong, it was 2010, not 2008. https://en.wikipedia.org/wiki/Qt_Quick https://en.wikipedia.org/wiki/Qt_Quick
- daenney 9y agoIt works entirely fine on Firefox on macOS and Windows though. It seems more likely that has something to do with how Firefox interacts with the graphics stack on Linux than Marko. Have you tried it in a different browser, like Chrome or Midori?
- k__ 9y agohow does it know that onClicked: count++ should be evaluated on a click and not save count into onClicked and increment it afterward?
- jcelerier 9y ago`onClicked` isn't a field. The Button object has, somewhere in its definition: signal clicked() ... /* on some raw mouse event handler */ { clicked(); } Then, when `clicked()` is called, if you have put somewhere in your code `onClicked: { some JS expression }`, the expression you put there will be called. Unlike JS objects, fields cannot be reassigned. Instead properties and signals are declared beforehand. property real count signal foo(arg1, arg2) ...
- PrimHelios 9y agoFirefox on Fedora 26 here, silky smooth for me.
- majewsky 9y agoThe animation was smooth for me (Firefox on KDE on X11 on Arch Linux; 5-year-old notebook with Intel graphics).