NodeJS support for ClojureScript

Description

It would be great to add NodeJS support for ClojureScript! It seems data.xml uses DOMParser, which will work in browsers but not in NodeJS.

I looked at the original issue DXML-29, and NodeJS is mentioned there (using xmldom).. but I guess support for NodeJS was never implemented in the end?

I had a look in the code and it seems xmldom is "swapped in" for DOMParser when running the ClojureScript tests, so based on that it should work? Although the tests are running on Nashorn rather than NodeJS. However I couldn't work out where xmldom is coming from.

Possible solutions:

1) Use some logic in the code, e.g. "try create DOMParser, if error try create xmldom".
2) Use xmldom everywhere (apparently it's possible to use it outside NodeJS) but I don't know enough about it. Some info here: https://github.com/jindw/xmldom/wiki/How-to-use-xmldom-in-non-node.js-JavaScript-platforms-like-Rhino-or-SpiderMonkey

Maybe option 1) is preferable.

Unknowns (at least to me): how to "export" the xmldom npm dependency so that it is available for downstream projects using the library..

Environment

None

Assignee

Ryan Senior

Reporter

import

Labels

None

Approval

None

Patch

None

Priority

Major
Configure