Skip to content

Instantly share code, notes, and snippets.

@gmp26
Created November 15, 2018 11:54
Show Gist options
  • Save gmp26/b02c7b1068f45747a4d43e4ea4a4370a to your computer and use it in GitHub Desktop.
Save gmp26/b02c7b1068f45747a4d43e4ea4a4370a to your computer and use it in GitHub Desktop.
Attempting to use hicada from rum
(ns sablono.compiler
(:require [hicada.compiler :refer [compile]]))
(defmacro html
[body]
(compile body {:create-element 'js/React.createElement
:transform-fn (comp)
:array-children? false}
{} &env))
(defn compile-html [content]
(html content))
@gmp26
Copy link
Author

gmp26 commented Nov 15, 2018

Not yet working. My project.clj has this: (Should I exclude sablono?)

  :dependencies [[org.clojure/clojure "1.9.0"]
                 [org.clojure/clojurescript "1.10.439"]
                 [rum "0.11.2"]
                 [hicada "0.1.8"]
                 ...]

and I'm seeing these errors from lein fig:build

lein fig:build
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
[Figwheel] Compiling build dev to "resources/public/cljs-out/dev-main.js"
WARNING: compile already refers to: #'clojure.core/compile in namespace: sablono.compiler, being replaced by: #'hicada.compiler/compile
[Figwheel] Failed to compile build dev in 1.364 seconds.
[Figwheel] Could not Analyze: No such var: compiler/compile-attrs  resources/public/cljs-out/dev/sablono/core.cljs   
[Figwheel:SEVERE] java.lang.RuntimeException: No such var: compiler/compile-attrs
[

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment