DataFormsJS v5.11.0 Release Notes

Release Date: 2022-02-08 // 4 months ago
    • ⚡️ Updated DataFormsJS Framework to support JavaScript classes
      • Originally the DataFormsJS Framework was designed and developed prior to ES6 being supported among Web Browsers. Because of this custom app code was designed around ES5. This update allows for custom app code (Pages and Plugins) to use classes rather than objects which allows for modern style JavaScript development.
      • Functions updated and added for the main App object:
      • https://github.com/dataformsjs/dataformsjs/blob/master/js/DataFormsJS.js
      • app.addPage()
      • app.addPlugin()
      • app.getClassFunctionNames() - New function
      • Bug fix with Chosen Plugin for IE
      • https://github.com/dataformsjs/dataformsjs/blob/master/js/plugins/chosen.js
      • New class version of the core jsonData page object:
      • js/pages/classes/JsonData.js
      • All variables and functions from the original file exist in the new one. The purpose of the new file is so that an app can extend it for custom page logic when defining pages as ES6 classes rather than ES5 objects.
      • Replaces all occurrences of String.prototype.substr() with String.prototype.substring(). IDE's such as VS Code show substr() as depreciated because it is a non-standard function.
      • Updated package.json to use the latest and specific versions of @babel/standalone, terser, and uglify-js for the build process. This makes the build process work across systems as expected. ```js // Framework updates to support Classes

    app.addPage('name', class Page { onRouteLoad() {} onBeforeRender() {} onRendered() {} onRouteUnload() {} })

    app.addPlugin('name', class Plugin { onRouteLoad() {} onBeforeRender() {} onRendered() {} onRouteUnload() {} })

    class MyPage extends JsonData { onRendered() { console.log('MyPage.onRendered()') } } app.addPage('MyPage', MyPage);


Previous changes from v5.10.6