* [jsscripting] Improve script error logging
* [jsscripting] Suppress some warnings
* [jsscripting] Throw ISE instead of RE
* [jsscripting] Minor null annotation improvements
Include fileName or ruleUID or transformation UID in the logger name used by the logged error stack trace.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* New translations openwebnet.properties (Italian)
* New translations jsscripting.properties (Danish)
* New translations hdpowerview.properties (Danish)
* New translations netatmo.properties (Italian)
* New translations danfossairunit.properties (Danish)
* New translations jsscripting.properties (Italian)
* [automation] Code optimization for Java17: instanceof matching and multiline strings
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* [automation] Make use of Java17 features
Use Map/Set/List.of instead of Collections.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* review comment
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
---------
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
It was found out that a recent change to the webpack config for the library injection bundle heavily affected performance of the evaluation of the cached injection.
openhab-js 4.5.1 fixes that regression and one minor bug, see https://github.com/openhab/openhab-js/blob/main/CHANGELOG.md#451.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* [jsscripting] Fix bundling of global script & regression from #14135
Fixes the regression from https://github.com/openhab/openhab-addons/pull/14135#issuecomment-1369231126.
While working on this, I also noticed that the cache openhab-js does not work because of wrong webpack commandline args in the pom (wrong entrypoint).
* [jsscripting] Enable stack logging for IllegalArgumentExceptions
* [jsscripting] Upgrade openhab-js to 3.2.4
* [jsscripting] Update README for recent PR
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* [jsscripting] Extend comments for wraprequire
* [jsscripting] Enable openhab-js caching to improve performance
On my dev system (which I guess is much more powerful than most openHAB servers), cached openhab-js injection takes 100-200 ms.
openhab-js injection from file system takes about 1000 ms.
* [jsscripting] Update configuration language
* [jsscripting] Upgrade openhab-js version to 3.2.1 for required webpack changes
Documentation updates will follow in another PR to keep this one clean.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* [jsscripting] Share org.graalvm.polyglot.Engine across all OpenhabGraalJSScriptEngine instances
See https://github.com/oracle/graaljs/issues/121#issuecomment-880056648, it is not required to have one engine per GraalJSScriptEngine.
This might improve performance a bit on less powerful systems (Raspberry Pi) and decreases heap usage:
With 5 GraalJS UI scripts, heap usage is now below 100 MB. Before this change, it was over 100 MB.
* [jsscripting] Extend debug logging
* [jsscripting] Cache `@jsscripting-globals.js` across all engines
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* [jsscripting] Remove asm from dependencies in pom
GraalJS >= 20.3.0 doesn't require org.ow2.asm as compile dependency anymore, see https://mvnrepository.com/artifact/org.graalvm.js/js/20.3.0.
* [jsscripting] Remove dependency org.graalvm.js/js-launcher as it is not required
js-launcher is GraalVM's JavaScript command line interpreter and not required in the addon.
See https://www.graalvm.org/22.1/reference-manual/js/RunOnJDK/.
* [jsscripting] Add missing com.ibm.icu dependency
GraalJS changelog says that it is not required for GraalJS >= 22.0.0 (see 685e5873af/CHANGELOG.md (version-2200)).
But GraalJS 22.3.0 attempts to load classes from it during runtime.
* [jsscripting] Update GraalJS engine options
Compat, as its additional functionality is not used by openhab-js and user code is not expected to use it.
* [jsscripting] Remove com.ibm.icu/icu4j dependency
* [jsscripting] Don't disable Nashorn compat mode as openhab-js requires it for accessors
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>