RTSA Suite PRO JavaScript Block | Paper and Documantation v11738 (12.10.2022)
Quote from mm_dev on 22/01/2024, 09:33Quote from nemanjan00 on 21/01/2024, 22:23I would like to do some more advanced JS stuff, so I need a bit more details about JavaScript runtime you are using. Could you point me to a lib you are using?
It is a custom engine, not a library. While most modules are implemented in JS and can be found in the RTSA install directory (under cdata/blocks/scripts) they usually rely on internal system calls into the RTSA core.
Quote from nemanjan00 on 21/01/2024, 22:23For example, I want to alter global environment, and I am failing to find how global variable is called. It is neither "global" or "window". (For example, I want to implement dynamic import with path relative to script file)
There is no "window" object or anything similar. There are a few global objects like Math, String, UTF8 or JSON, but nothing that really exposes the property you're looking for. The best option for portable paths would be the Mission.block() function.
Quote from nemanjan00 on 21/01/2024, 22:23I would like to do some more advanced JS stuff, so I need a bit more details about JavaScript runtime you are using. Could you point me to a lib you are using?
It is a custom engine, not a library. While most modules are implemented in JS and can be found in the RTSA install directory (under cdata/blocks/scripts) they usually rely on internal system calls into the RTSA core.
Quote from nemanjan00 on 21/01/2024, 22:23For example, I want to alter global environment, and I am failing to find how global variable is called. It is neither "global" or "window". (For example, I want to implement dynamic import with path relative to script file)
There is no "window" object or anything similar. There are a few global objects like Math, String, UTF8 or JSON, but nothing that really exposes the property you're looking for. The best option for portable paths would be the Mission.block() function.
Quote from nemanjan00 on 22/01/2024, 14:37It is based on QJSEngine or not?
I will look into elegant way to do this. If I find a way to implement it in a way I am satisfied with, I will do it, if not, I might give up.
My main goal being able to use packages from npm and also to create collection of useful blocks... Considering you do not support external scripts, I do not know how much of a nice experience it will be. I will try to use modern concepts like babel and bundlers to be able to package modern JS in a package that can be executed inside of your Script bloc.
It is based on QJSEngine or not?
I will look into elegant way to do this. If I find a way to implement it in a way I am satisfied with, I will do it, if not, I might give up.
My main goal being able to use packages from npm and also to create collection of useful blocks... Considering you do not support external scripts, I do not know how much of a nice experience it will be. I will try to use modern concepts like babel and bundlers to be able to package modern JS in a package that can be executed inside of your Script bloc.
Quote from mm_dev on 22/01/2024, 15:25Quote from nemanjan00 on 22/01/2024, 14:37It is based on QJSEngine or not?
It is not. It is a completely custom implementation based on (but not fully implementing) the ES6 spec.
Quote from nemanjan00 on 22/01/2024, 14:37It is based on QJSEngine or not?
It is not. It is a completely custom implementation based on (but not fully implementing) the ES6 spec.