weavejester / hiccup

Fast library for rendering HTML in Clojure
http://weavejester.github.io/hiccup
Eclipse Public License 1.0
2.68k stars 174 forks source link

Clojurescript support #127

Open EwenG opened 8 years ago

EwenG commented 8 years ago

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.

weavejester commented 8 years ago

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.

EwenG commented 8 years ago

You are right, I renamed the "_macros" namespaces

jeluard commented 7 years ago

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.

iku000888 commented 7 years ago

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.

arichiardi commented 6 years ago

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.

manuel-uberti commented 6 years ago

Anything new here? Another interested voice. :)

gklijs commented 6 years ago

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

wbehrens-on-gh commented 2 years ago

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?

weavejester commented 2 years ago

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.