Closed raffazizzi closed 1 year ago
This looks pretty exciting @raffazizzi ! Glad to see isomorphic JS support.
@hcayless I separated out the preprocessing step that was included in domToHTML5()
. This is necessary because a server side implementation will likely not want to use applyBehaviors()
on the server and only use it on the client. While applyBehaviors()
is its own method, there wasn't an independent method for the preprocessing of the DOM (the code that adds prefixes, data attributes, etc). This latest commit adds the method preprocess()
to do just that.
The tests all work after this change, but it may be good to take this version of CETEIcean for a spin in your more complex projects to make sure nothing is broken. Very happy to address any issue that arises.
Yeah, I don't see any problems on reading the code over. I will try it out and see if anything breaks!
Hey there, just here to say I'm looking forward to the new version!
Hope there's no technical reason for the PR to not have been merged?
@arjanski new release is here and on npm! https://www.npmjs.com/package/CETEIcean
Made some changes to allow CETEIcean to run on both the client or on node (by providing an external DOM, e.g. via JSOM)
This required to handle the document object as a class property. CETEIcean will look for the document object in this order:
documentObject
optionwindow
, if it existsglobal
, if it existsOther minor changes were necessary to make sure the code could be isomorphic, such as better checks before calling
window
andNode
.I also added a test that runs before build.