hiccup icon indicating copy to clipboard operation
hiccup copied to clipboard

Clojurescript support

Open EwenG opened this issue 9 years ago • 9 comments

Hi, I made a cljc version of hiccup: https://github.com/eweng/hiccup Would you be interested by a pull request? In such a case I would wait for https://github.com/weavejester/hiccup/pull/122 to be merged, rebase on it and submit my changes.

EwenG avatar Jan 23 '16 21:01 EwenG

I would be interested, but ClojureScript might not be easy to get working.

I think the first step might be to splitting up the repository, since returning strings doesn't make sense in ClojureScript, not when most of the time you want a DOM element instead. You might even want a React element. So moving the utility functions out is step one, and work to that end has been started in the 2.0 branch.

Also there are a few parts of your code that are not really idiomatic anymore, like the -macros namespaces. In modern ClojureScript the macros namespace has the same name as the code namespace.

weavejester avatar Jan 24 '16 03:01 weavejester

You are right, I renamed the "_macros" namespaces

EwenG avatar Jan 24 '16 14:01 EwenG

Having a ClojureScript port of hiccup (returning string) still makes sense as it could be used with nodejs. It can also be useful browser side: for simple static document going full virtual dom is not necessary.

Is this something you would consider? I can definitively help here.

jeluard avatar Jan 24 '17 09:01 jeluard

Just throwing in my 2 cents that a ClojureScript hiccup returning strings would make sense, and a separate fn/macro to return raw doms would also make sense. Even more awesome if they can be handled with the hiccup 2 goodness.

For reference, https://github.com/ibdknox/crate returns raw doms from hiccup data.

iku000888 avatar May 10 '17 16:05 iku000888

Adding one more interested voice here, I feel that working with hiccup is better in node for certain use cases. I would add that we could have a hiccup-cljs version that is compatible with lumo & planck. I tried ewen/hiccup and it is not compatible at the moment, but I can push a PR to it in order to fix that.

arichiardi avatar Nov 11 '17 23:11 arichiardi

Anything new here? Another interested voice. :)

manuel-uberti avatar Mar 28 '18 10:03 manuel-uberti

I woud be interested as well, I now use https://github.com/teropa/hiccups to get the html as strings and turn them into nodes with closure, but would much rather user the same library client and serversite

gklijs avatar Apr 25 '18 13:04 gklijs

I would be interested, but ClojureScript might not be easy to get working.

I think the first step might be to splitting up the repository, since returning strings doesn't make sense in ClojureScript, not when most of the time you want a DOM element instead. You might even want a React element. So moving the utility functions out is step one, and work to that end has been started in the 2.0 branch.

Also there are a few parts of your code that are not really idiomatic anymore, like the -macros namespaces. In modern ClojureScript the macros namespace has the same name as the code namespace.

It appears the 2.0 branch hasn't received commits in quite some time, is it abandoned and are there still plans to want to support cljs?

wbehrens-on-gh avatar Apr 28 '22 03:04 wbehrens-on-gh

It's not abandoned; the alpha works fine, but I haven't worked out a good way of converting all the utility functions over, or even if it's useful to do so, which is why any further work has been delayed.

It may be worth releasing the alpha as a full release, and leaving the question of the utility functions for 2.1.

As for cljs, I don't have any plans to add it myself.

weavejester avatar Apr 28 '22 03:04 weavejester