35 ms·
As far as I know QML still only supports ES5. That’s not very appealing if you’ve been working with Typescript or Babel for awhile. Plus all the node libraries
by jeremyjh 7y ago
As far as I know QML still only supports ES5. That’s not very appealing if you’ve been working with Typescript or Babel for awhile. Plus all the node libraries people may be used to working with would be available.
- nocman 7y agoAccording to the docs (https://doc.qt.io/qt-5/whatsnew512.html https://doc.qt.io/qt-5/whatsnew512.html): "The JavaScript engine now supports ECMAScript 7. This includes an upgrade to ECMAScript 6" and: "ECMAScript modules can now be loaded directly with QJSEngine::importModule() [ https://doc.qt.io/qt-5/qjsengine.html#importModule https://doc.qt.io/qt-5/qjsengine.html#importModule] and imported in .qml files when using the .mjs file extension." Although, it looks like the ECMAScript 7 support might be incomplete, with Promises perhaps being buggy and arrow functions perhaps not working: https://forum.qt.io/topic/100526/what-parts-of-ecmascript-7-are-supported-in-qt-5-12 https://forum.qt.io/topic/100526/what-parts-of-ecmascript-7-... Looks like transpiling with Babel works fairly well for a lot of things relevant discussion: https://bugreports.qt.io/browse/QTBUG-47735 https://bugreports.qt.io/browse/QTBUG-47735