GithubHelp home page GithubHelp logo

Comments (2)

niwinz avatar niwinz commented on July 19, 2024

Tracing a little bit, I found that after N executions of emit-react (on compiling cond) the bind value of *config* looses the user defined settings.

Look:

(macroexpand-all '(my-html (cond (nil? a) [:div {}] (number? a) [:span {}] (= 1 2) [:section {}] (= 4 5) [:label {}] :else [:ul {}])))
"==> conpile-form(cond)"
"++++> compile-element" :div js/create-element
"====> used-config:" {:array-children? false, :child-config #object[hicada.compiler$fn__23432 0x570b21e0 "hicada.compiler$fn__23432@570b21e0"], :rewrite-for? true, :wrap-input? false, :emit-fn nil, :transform-fn #object[clojure.core$identity 0x346b793b "clojure.core$identity@346b793b"], :inline? false, :camelcase-key-pred #object[clojure.core$some_fn$sp2__8653 0x6c65578d "clojure.core$some_fn$sp2__8653@6c65578d"], :create-element js/create-element, :server-render? false}
"==> conpile-form(cond)"
"++++> compile-element" :span js/create-element
"====> used-config:" {:array-children? false, :child-config #object[hicada.compiler$fn__23432 0x570b21e0 "hicada.compiler$fn__23432@570b21e0"], :rewrite-for? true, :wrap-input? false, :emit-fn nil, :transform-fn #object[clojure.core$identity 0x346b793b "clojure.core$identity@346b793b"], :inline? false, :camelcase-key-pred #object[clojure.core$some_fn$sp2__8653 0x6c65578d "clojure.core$some_fn$sp2__8653@6c65578d"], :create-element js/create-element, :server-render? false}
"==> conpile-form(cond)"
"++++> compile-element" :section js/create-element
"====> used-config:" {:array-children? false, :child-config #object[hicada.compiler$fn__23432 0x570b21e0 "hicada.compiler$fn__23432@570b21e0"], :rewrite-for? true, :wrap-input? false, :emit-fn nil, :transform-fn #object[clojure.core$identity 0x346b793b "clojure.core$identity@346b793b"], :inline? false, :camelcase-key-pred #object[clojure.core$some_fn$sp2__8653 0x6c65578d "clojure.core$some_fn$sp2__8653@6c65578d"], :create-element js/create-element, :server-render? false}
"==> conpile-form(cond)"
"++++> compile-element" :label js/create-element
"====> used-config:" {:array-children? false, :child-config #object[hicada.compiler$fn__23432 0x570b21e0 "hicada.compiler$fn__23432@570b21e0"], :rewrite-for? true, :wrap-input? false, :emit-fn nil, :transform-fn #object[clojure.core$identity 0x346b793b "clojure.core$identity@346b793b"], :inline? false, :camelcase-key-pred #object[clojure.core$some_fn$sp2__8653 0x6c65578d "clojure.core$some_fn$sp2__8653@6c65578d"], :create-element js/create-element, :server-render? false}
"==> conpile-form(cond)"
"++++> compile-element" :ul js/React.createElement
"====> used-config:" {:array-children? false, :child-config #object[hicada.compiler$fn__23432 0x570b21e0 "hicada.compiler$fn__23432@570b21e0"], :rewrite-for? false, :wrap-input? false, :emit-fn nil, :transform-fn #object[clojure.core$identity 0x346b793b "clojure.core$identity@346b793b"], :inline? false, :camelcase-key-pred #object[clojure.core$some_fn$sp2__8653 0x6c65578d "clojure.core$some_fn$sp2__8653@6c65578d"], :create-element js/React.createElement, :server-render? false}

If you see, the last two calls to emit-react reads a wrong config values...

from hicada.

niwinz avatar niwinz commented on July 19, 2024

I found the solutiotion, I open a PR for it.

from hicada.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.