UMF is a lightweight javascript framework written mostly in vanilla Javascript. It provides a few fundamental features that a programmer would ask from a framework, together with extensibility to provide your own features.
exportconstmodules={'moduleIdentifier': {'component': componentName,'singleton': shouldBeSingleton,'defaults': componentDefaults},}import{polyfills}from'./core/polyfill.js';import{kernelBuilder}from'./core/kernel.js';document.addEventListener('DOMContentLoaded',()=>{polyfills();// start the kernel with the known modulestry{constkernel=kernelBuilder(modules)}catch(e){console.error(e)}});try{constkernel=kernelBuilder(modules)// find all modules that are currently required and start themdocument.querySelectorAll('[data-js-module]').forEach(el=>{kernel.startModule(el.getAttribute('data-js-module'),{...el.dataset})});}catch(e){console.error(e)}Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.