<< Back to previous view

[DXML-29] ClojureScript support Created: 13/Nov/15  Updated: 07/Dec/16  Resolved: 07/Dec/16

Status: Resolved
Project: data.xml
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Artem Yarulin Assignee: Herwig Hochleitner
Resolution: Completed Votes: 0
Labels: None


Parsing XML(and HTML) is very often task and currently it requires a lot of effort and use of different libraries and wrappers around JS libs.

We can dramatically simplify it if we migrate data.xml to ClojureScript.

I'm maintaining koh library which has proof-of-concept XML support for Node and Browsers https://github.com/artemyarulin/koh/blob/master/src/koh/xml.cljs

The general idea is that we can utilise DOMParser object in order to parse string to XML tree. It has a decent browser support https://developer.mozilla.org/en-US/docs/Web/API/DOMParser and has a NodeJS implementation which follows the same API https://github.com/jindw/xmldom

What do you think about this feature?
I can pretty much follow the same guidelines from http://dev.clojure.org/jira/browse/DZIP-5 and implement it in the same way


Comment by Herwig Hochleitner [ 04/Aug/16 2:40 PM ]

I'm working on clojurescript support in a separate branch: https://github.com/clojure/data.xml/tree/cljs
It can extend browser-native DOM objects to work with clojure data protocols.
Let me know what you think.

Comment by Artem Yarulin [ 05/Aug/16 4:18 AM ]

Oh, that's super cool! If you need any testing - feel free to ping me, I'll be happy to help

Comment by Herwig Hochleitner [ 08/Aug/16 1:37 PM ]

Thanks for the offer! In fact, the clojurescript support is in a testable state right now and I'm utilizing it for a cljs webdav library: https://github.com/webnf/davstore/blob/master/src/server/webnf/davstore/dav/xml.cljc

The main thing preventing it from being ready is, that I've utilized .cljc and reader tags. As of my last information, our CI doesn't support .cljc yet, for the test matrix and also it's unclear how to target clojure versions < 1.7

I'd be happy to the clojurescript support tested, though. We can still copy+paste into separate clj and cljs files, when we decide to release, if cljc support for contrib projects isn't ready by then.

Comment by Herwig Hochleitner [ 07/Dec/16 9:48 PM ]

will be released as part of 0.2.0-alpha1

Generated at Wed Dec 07 22:19:02 CST 2016 using JIRA 4.4#649-r158309.