squint-cljs / squint

Light-weight ClojureScript dialect
https://squint-cljs.github.io/squint
642 stars 38 forks source link

Local variable name collides with JSX element name during compilation #554

Closed formicagreen closed 2 hours ago

formicagreen commented 2 hours ago

version

0.4.85

problem

When compiling to JSX, if an element name matches the name of a locally bound var it gets renamed in the resulting JSX.

repro

Create a file with this content:

(ns NameCollision)

(defn Bar []
  (let [div true]
    #jsx [:div]))

This compiles to:

import * as squint_core from 'squint-cljs/core.js';
;
var Bar = function () {
let div1 = true;
return <div1></div1>
};

export { Bar }

expected behavior

Should not rename HTML tags.

borkdude commented 2 hours ago

v0.8.114 is the latest version, can you try that?

borkdude commented 2 hours ago

Can't repro with that version:

https://squint-cljs.github.io/squint/?src=KG5zIE5hbWVDb2xsaXNpb24pCgooZGVmbiBCYXIgW10KICAobGV0IFtkaXYgdHJ1ZV0KICAgICNodG1sIFs6ZGl2XSkp