A collection of utility functions designed to make developing inside Upvise easier.
- Deploy
Billow.js
to the Upvise database where you want to use it, by adding it to theconfig.json
file and then runningnpm run deploy
. - Load Billow.js using the following snippet (anywhere in your code)
- win!
//
// Load Billow.js
//
function loadBillowJs() {
var item = Query.selectId('System.globalsettings', 'billow-software.billow.js');
if (item) {
var code = item.value;
if (typeof window === 'undefined') {
return new Function(code + ';return B;')();
} else if (window.B && window.B.VERSION === item.name) {
return window.B;
} else {
new Function(code)();
return window.B;
}
} else {
throw new Error('Critical failure: B.js is not deployed to this database');
}
}
var B = loadBillowJs();
- Create a standard library of functions commonly needed when developing dashboards and form workflows in Upvise.
- Improve reliability of our implementations by writing unit tests for these utilities.
- Have more control over our addons by using our own functions rather than relying on Upvise.
Note: Due to the business wanting to move away from developing inside Upvise, we don't want to spend too much time on this project. However, this library can be developed alongside maintenance of existing works.
- Everything needs to be tested (this is crucial)
- BILLOW.js must work in Node.js as well as the Browser. This means setting up a build system to combine everything into one minified file.
- BILLOW.js will be deployed to different databases by saving the source in
System.globalsettings
(withid
billow-js-v-x.x.x
) - This deploy process will be automatic, involving an upvise-client script as well as a list of all the databases where BILLOW.js should be deployed to.
- The version of BILLOW.js to load will be saved in
System.globalsettings
with the idbillow-js-version
- When a new version of BILLOW.js is deployed, it will be saved in the appropriate
System.globalsettings
column and thebillow-js-version
will be updated. - New BILLOW.js versions will be detected by an async process that checks the
billow-js-version
setting against theBILLOW.version
attribute. If there's a difference theneval()
the new code. (this part is unsafe but Upvise does it all the time) - BILLOW.js will be initially loaded by a snippet that checks if it exists and then acts accordingly. I'm not 100% sure where in Upvise to put this snippet. One possibility is to put it everywhere that BILLOW.js is used, however I feel like something more economical is possible. This point requires more thought...
To be implemented...
Copyright Billow Software (C) 2019