Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
QML integrates seamlessly with JavaScript (JS), either by adding JS Expressions directly in QML documents, or by keeping QML and JS in separate files, and having QML import the JavaScript as described here. The second approach is of course much cleaner when it comes to larger JS logic.
As discussed with shausman in the Qt Contributor Summit, this is a request to add functionality to Qt Quick (QML) and to Qt Creator to use separate TypeScript (TS) files as resources (instead of JS). Please note that this is not about extending QML itself to be statically typed as described in QTBUG-68791. It's just about including *.ts files into QML.
Using TS would make it possible to write larger non-visual logic in a statically typed language, without having to accept the limitations of JavaScript and without having to use C++ (which is overwhelming for some developers). It would also make it possible to leverage the Web ecosystem, e.g. use node.js and other npm packages.
In a first step, this would require to use TS files for build and execution:
- being able to import *.ts files in QML files
- executing the TS compiler as part of the build process
- picking up the resulting *.js file as part of the run-time resources
In a second step, it would be very convenient to provide first-class support for TS files in the Qt Creator, to edit them and and to debug them. This means that Qt Creator would have to know how to use source maps.
Attachments
Issue Links
- relates to
-
QTBUG-65202 Add node.js compatability to the QML runtime
- Closed
- resulted in
-
QTCREATORBUG-20614 Add support for JavaScript source maps in the Qt Creator JavaScript debugger
- Open