can we have common modules like “mySharedFunctions.js” with module.exports = {f1, f2};
and then const{f1, f2} = require(“./mySharedFunctions.js”); referenced in other modules.
… and also,
can I put js files in a different directory than legacy scripts?
do we have some logging capabilty, like with post() ?
The idea of creating a migration tool for scripts has crossed my mind, but without thinking it through, I deemed it too complex, and I have way too many other things to do that I find more important.
It’s the same variable controller for global variables in both the old and new script engines, so as long as the variables are named the same (without the @ prefix), they will work across all scripts.
The GitHub page for the JavaScript engine has a long list of what it supports.
Exports and references to shared resources are currently not supported. These features are incompatible with how the JavaScript engine is integrated with the plugin. I recognize the potential benefits of having these features, but I haven’t had time to explore possible solutions.
Each script reference is independent, so you can place scripts anywhere you like.
I have considered logging, but unfortunately, it is not available yet. Where do you want log entries to be written: in the plugin log file or elsewhere?
migration tool for scripts. Maybe an IA fed with the scripting language documentation would help would help, don’t you think ?
Cool suggestion, I didn’t think of that.
global variables. The point is getting notified in js when they change, as in the old scripts. any idea ?
That’s what the OnGlobalVariableChanged(name, value) event is used for.
Exports and references to shared resources. I understand it is now available. Correct ?
Correct.
And to be a bit provocative …
why not getting rid of c# ?
I didn’t understand that. Where would I be getting rid of C#? If you’re suggesting that I should spend time converting 6 years of C# development to JavaScript, I think I’ll pass.