Including SAP NetWeaver User Interface Services Scripts
The page builder needs to load a bundle of JavaScript files provided by SAP NetWeaver user interface services.
One of the tasks of the shell.js script is to retrieve the user settings from the ABAP system and apply them to SAPUI5. The script can only perform this task if it is included in the HTML file before the SAPUI5 bootstrap.
<script src="/sap/public/bc/ui2/shell-api/sap/ui2/shell/shell.js"></script>
All other scripts can be required using jQuery.sap.require. You only need to require the scripts that your code uses directly. It is usually sufficient to require factory.js.
Additionally, your page builder has to require all scripts related to contracts (sap.ui2.srvc.contracts.*). This is done in the main() function.