Hello,

I want to develop a KWin Script using QML and TypeScript. Unfotunately I cannot 
get it to work, so that it can use the feature intoduced in ES6 standard - 
modules. To test this with minimal working example I did the following: I 
created main.qml with the following content:

```import QtQuick 2.0
import "../code/script.js" as K

Item {
    id: scriptRoot
    Component.onCompleted: {
        console.log("Starting the script");
        K.main();
    }
}

```

Also I have two javascript files: script.js:

```import modu from "./mod";

function main() {
  console.log("Hello from main script!");
  modu();
}

```

mod.js:

```export default function modu() {
  console.log("Hello from module!");
}
```
Unfortunately, I cannot get this setup to work. In KWin logs, I have nothing 
(No string is printed). However, if I remove the js import from QML, at least 
the "Starting the script" is printed.

>From what I understand, QML Javascript Engine should support modules (and ES7) 
>according to the documentation:

> The QML runtime implements the 7th edition of the standard

I would like to ask a help from the experts of KWin: is this a KWin scripting 
limitation? Why no logs are printed at all? What can I do to create a KWin 
script with ES6 modules?
 
Best Regards,
Mikhail Zolotukhin

Attachment: publickey - mail@genda.life - 0x2B64AF62.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to