1 Answer

+1 vote

Hi Vincent

For me it's quite clear that everything inside serverscripts should be considered legacy. Serverscripts are loaded with <%LoadScript()%> and <%RunScript()%> and within this scripting environment, you can't import ServerJs modules. Everything is global and this is by definition also less secure.

The goal is that we never write duplicated code or have to work with libraries with global functions. This idea is incompatible with serverscripts.

ServerJS allows you to share code between all filebases (Efficy, Extranet, Guest, Shared) and as well with Db Workflow.

With ServerJS we create structure by making folders and sub-folders. Each function should be stored in a separated file. On top of that file, import modules that are consumed by that global function. The library modules are true modules and by design private to the outside.

Conclusion, what you should use for new developments in Efficy 11.2+ are:

it is important to make sure that this is used in this way.
I think that passing on a message to say something like "serverscript and old way to run server side script is depracate and only keeped available for backward compatibility" can be a good idea because if we see in the past (from Efficy 2012 to Efficy 2014 ), we can see that people often keep their old habits.

I believe it's introduced by R&D for the Workload module developments and it's only part of the Submariners branch of Efficy 11.2. It's indeed not yet part of standard 11.2. But you can of course add it already manually :-)