fasterthanlime / shin

:warning: (def shin (dissoc clojurescript :jvm :google_closure)) (deprecated)
MIT License
35 stars 1 forks source link

*js templating #110

Open fasterthanlime opened 9 years ago

fasterthanlime commented 9 years ago

Basic idea:

(~{} ^ ~{})

to

(_2969cddbc9cf017722f8dc6b2ffc472a ^ _5789cf9faa7b1bc2bb8928b78fe524e7)
{
    "type": "Program",
    "body": [{
        "type": "ExpressionStatement",
        "expression": {
            "type": "BinaryExpression",
            "operator": "^",
            "left": {
                "type": "Identifier",
                "name": "_2969cddbc9cf017722f8dc6b2ffc472a"
            },
            "right": {
                "type": "Identifier",
                "name": "_5789cf9faa7b1bc2bb8928b78fe524e7"
            }
        }
    }]
}
// as Shin::JST classes
{
    "type": "BinaryExpression",
    "operator": "^",
    "left": null,
    "right": null
}
arg_paths = [[:left], [:right]]

And when it works well enough, we can remove some special form handling in translator (along with *js-bop *js-uop and *js-call), and support Reagent's interop.clj js-call macro.