Question About Enyo's dependency on the DOM

edited May 2012 in General
How dependent is Enyo on the DOM? I've been working in it a bit and am loving alot of the non-dom features, like the way events work to tie everything together. I was sorta thinking this might be good for some of my Nodejs features. I know alot of what Enyo does is generates html for insertion into the DOM, which could still be useful server-side.

Just thinking.

Comments

  • Most of the core library's DOM dependencies are in the files in the ajax and dom folders. It should be pretty easy to use it with node with a DOM-emulation library to do server-side rendering, but I've not tried it myself.
  • edited May 2012
    Several folks on the team have talked about investigating an Enyo build for the Node.js environment, but it hasn't been at the top of anyone's priority list.

    I don't think the code is currently factored such as to make it particularly easy to use in a DOM-free environment. There's very little in the Enyo kernel that's dependent on the browser environment, as far as I know.

    But you can't just require('enyo')and have it do the right thing. It should be fairly easy to make an Enyo module for Node that left out all of the DOM-dependent code. At the very least, that'd get you Enyo.kind, "published" properties, that sort of thing. I think the event-handling code would need some minor tweaking, and XHR would need a whole different code path to work with Node.js's http library.
Sign In or Register to comment.