Details

    • Type: Suggestion Suggestion
    • Status: Reported
    • Priority: Not Evaluated Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The latest version of the ECMAScript spec, ECMAScript 2015 (formerly called ECMAScript 6) has been finalized and it would be wonderful to be able to use the features it brings to Javascript in QML, especially:

      • Block scoped variables using "let" instead of "var"
      • Constants
      • Template Strings - multiline strings without needing to concat strings, and inlining variables like this: `This is a string with a $ {variable}

        in it!`

      • "Arrow functions", simple anonymous functions that look like this: `argument => doSomething(argument)`. Also uses a lexical `this` in the body of the function.
      • Classes
      • Generators
      • Destructuring

      I don't know if QML can support ES2015 modules - that might conflict with its use of the import keyword.

      Folks can try out ES2015 features in-browser here using the Babel transpiler:

      https://babeljs.io/repl/

      Transpiling stuff with Babel works great on a lot of features, but things like block scoping and constants would work a lot better if it was supported natively in the engine.

      Some interesting reading material:

        Issue Links

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          Michael Brasser added a comment -

          Simon Hausmann, Lars Knoll Can you give any high level comments here? (e.g. are there concrete plans to integrate EcmaScript 2015? If not, are there any conceptual objections to it?)

          Show
          Michael Brasser added a comment - Simon Hausmann , Lars Knoll Can you give any high level comments here? (e.g. are there concrete plans to integrate EcmaScript 2015? If not, are there any conceptual objections to it?)
          Hide
          Simon Hausmann added a comment -

          I welcome any efforts towards supporting ES6. If we end up with a transpiler then I would prefer typescript (for various reasons including IDE support).

          Show
          Simon Hausmann added a comment - I welcome any efforts towards supporting ES6. If we end up with a transpiler then I would prefer typescript (for various reasons including IDE support).
          Hide
          Daniel Nesbitt added a comment -

          I would really like to see support for ES6 classes. That coupled with the Qt Quick Compiler would be fantastic and a nice alternative for those who like OO programming but are not too keen and/or proficient of in C++.

          Show
          Daniel Nesbitt added a comment - I would really like to see support for ES6 classes. That coupled with the Qt Quick Compiler would be fantastic and a nice alternative for those who like OO programming but are not too keen and/or proficient of in C++.

            People

            • Assignee:
              Unassigned
              Reporter:
              empyrical
            • Votes:
              19 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes