treycordova / nativejsx

JSX to native DOM API transpilation. :yellow_heart: <div> ⟹ document.createElement('div')!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

All null literals in all ternary operators get replaced with noscript elements

odzb opened this issue · comments

commented

We are using nativejsx in a large legacy code base which gets sparsely interspersed with small pieces of JSX. It appears that whenever there is a ternary operator, all null literals get replaced with noscript element creation code. This happens even in code with no JSX nearby. It's a major issue for us because DOM elements are truthy values, while nulls are falsy, and stuff starts breaking in obscure ways.

We could isolate our JSX in files with another file extension, but it would be inferior to the way you normally use JSX in case of React+Babel. We don't need the noscripts at all, so it would be nice to at least be able to configure nativejsx not to do that replacement.

Alright, I'm thinking about completely removing <noscript> logic. Here's the commit. I can't deem a good enough reason to keep it around with the use appendChildren.

<noscript> is dead with 4.0.0.