squint-cljs / squint

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

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

Closed formicagreen closed 2 months ago

formicagreen commented 2 months 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 months ago

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

borkdude commented 2 months ago

Can't repro with that version:

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