r0man / sablono

Lisp/Hiccup style templating for Facebook's React in ClojureScript.
Eclipse Public License 1.0
696 stars 66 forks source link

sablono doens't work in a bootstrapped cljs environment #177

Open bhurlow opened 7 years ago

bhurlow commented 7 years ago
lumo -D sablono:0.8.0,cljsjs/react:15.4.2-2,cljsjs/react-dom:15.4.2-2
cljs.user=> (require 'sablono.core)
No such namespace: sablono.compiler, could not locate sablono/compiler.cljs, sablono/compiler.cljc, or JavaScript source providing "sablono.compiler" in file sablono/core.clj
     (new)
     Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1923:72)
     Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2555:92)
     Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:2554:92)
     (NO_SOURCE_FILE <embedded>:5553:162)
     Object.lumo.repl.load_other (NO_SOURCE_FILE <embedded>:6351:378)
     lumo.repl.load (NO_SOURCE_FILE <embedded>:6355:96)
     Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5555:77)
     Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5565:231)
     (NO_SOURCE_FILE <embedded>:5566:
bhurlow commented 7 years ago

on first glance it appears that sablono uses the clj side of things for some performance gains etc, although I'm not seeing anything that would require the jvm. Wondering about level of effort required to make this work in a pure bootstrapped cljs environment towards the use case of html rendering in node.js

r0man commented 7 years ago

@bhurlow I think it should be possible to get this running in bootstrapped cljs. I think what's needed is to port the compiler to cljc. Haven't had a usecase of this myself yet, though.

bhurlow commented 7 years ago

@r0man ok cool I agree as well. The existing use of regular clj seems to be serving this project pretty well so simply moving that to a likely slower cljs implementation seems like a regression to me. I wonder if it's possible for both to work side by side, I will give it a quick pass and see what I find