You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The desire to structure the code by using modules has been discussed in various forums. But I couldn't find a satisfying solution yet.
I know that I can place my modules somewhere on the file system where iob can find then and require them from there. But that puts the code outside of iob and somehow feels wrong to me.
I also know that I can put my classes in "global". But, apart from he fact that it is no fun to restart the adapter after every change, that just feels, well, too global.
In expert mode, I can see that all my scripts show up under objects as datapoints. That lets me think, that something like require("script.js.common.myStuff") would be an incredibly cool function to have.
Any thoughts?
(I did my research, but I may still have missed the best. So, if you know of an already existing solution to this, please help me find it)
The text was updated successfully, but these errors were encountered:
heiko3967
changed the title
Import code like "require(datapoint)"
Feature Request: Import code like "require(datapoint)"
Oct 28, 2023
I would also be very happy about the possibility of having a simple way to call "sub-scripts" within a "main script" - so that you could structure extensive code very clearly. My Ideea would be something like this:
all scripts for a project are stored in an extra subfolder in Common
all declared variables (outside functions) are available in all scripts within the extra folder. (same with functions)
Subscripts do not have to be started manually, but are started by a "main script".
In summary its more or less "just" the possability to seperate one big Script into some seperate little scripts which will be called from an Main-Script.
The desire to structure the code by using modules has been discussed in various forums. But I couldn't find a satisfying solution yet.
I know that I can place my modules somewhere on the file system where iob can find then and require them from there. But that puts the code outside of iob and somehow feels wrong to me.
I also know that I can put my classes in "global". But, apart from he fact that it is no fun to restart the adapter after every change, that just feels, well, too global.
In expert mode, I can see that all my scripts show up under objects as datapoints. That lets me think, that something like
require("script.js.common.myStuff")
would be an incredibly cool function to have.Any thoughts?
(I did my research, but I may still have missed the best. So, if you know of an already existing solution to this, please help me find it)
The text was updated successfully, but these errors were encountered: