I would like to implement a different non-HTML DOM backend for Knockout JS, likely within a non-browser type of environment (likely Node.js). Specifically, there exists an old, simple, static UI framework that I'd like to wrap with a DOM and then use with Knockout. I understand that Knockout itself is at least able to operate within Node.js without a browser environment (see here for example), but I'm wondering what I need to implement to create an entirely different DOM.
I'm just trying to figure out if I'm mostly crazy or completely crazy with regards to the scope of work.
I think you could do this by creating custom elements (http://knockoutjs.com/documentation/component-custom-elements.html) with custom bindings (http://knockoutjs.com/documentation/custom-bindings-for-virtual-elements.html) and extending binding syntax (http://knockoutjs.com/documentation/binding-preprocessing.html)
You would probably then have to create a customer element, binding and syntax for every element within your UI, I would suggest maybe creating either a json file with element info and allowing custom elements being created using the json, with the json linking to an widget containing the logic for each element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With