For me, the easiest is to create custom python modules in a dedicated python IDE, and copy them to the
/user-lib/pylib/ directory on the server via a script (can also be a python script fired from the IDE). The gateway automatically picks up modifications and pushes updates to the clients.
This gives us version control, better search, and easy to import scripts. We can just import it like this:
We do need to import this, as opposed to the system, shared or project modules. But it’s a lot easier to maintain than a complete Java module IMO.
The main caveat for us is that you cannot store any state reliably in the scripts as the state would be destroyed on a script update. You always need to write your state to either a database or some Ignition tags. But this does result in crash-safe code.
You also have to watch out for infinite loops (like polling loops), these don’t get terminated when the script updates, causing old code to remain active. You need to do all polling via Ignition (f.e. call it from an Ignition timer script every loop execution).