squint-cljs / compiler-common

Common code for squint and cherry
14 stars 3 forks source link

numbers are not treated as JSX variables #7

Closed alidcast closed 1 year ago

alidcast commented 1 year ago

error:

JSX value should be either an expression or a quoted JSX text
   ,----
 3 | { let x55 = <Flex marginTop=100 >{ (function () {
   :                             ^^^

should be marginTop={100}

borkdude commented 1 year ago

@aleedmanath Thanks. I vaguely remember fixing this once already... :) Would you like to try a PR or do you want for someone else to do it?

borkdude commented 1 year ago

Ah yes, here it is mentioned...:

https://github.com/squint-cljs/compiler-common/blob/main/cherry/CHANGELOG.md#000-alpha57

alidcast commented 1 year ago

hm, i'm on 0.0.0-alpha.60

i'm testing build tool integration, so i'll definitely fork and see what's up

but i'm going to also be integrating my own hiccup compiler so may be a little before I swing back

borkdude commented 1 year ago

The JSX tests are here:

https://github.com/squint-cljs/compiler-common/blob/main/cherry/test/cherry/jsx_test.cljs

If you can provide a PR as failing test, that would be a good start.

alidcast commented 1 year ago

thanks for the link, I was looking at compiler-common since some jsx logic was there

borkdude commented 1 year ago

yes, but compiler-common is tested in both squint and cherry.

alidcast commented 1 year ago

you're right, a basic test for this works

there's other tools processing the JSX so may be getting mishandled somewhere

but i'll re-open if anything; thanks

alidcast commented 1 year ago

oh just considered, maybe transpiling to commonjs is messing with the output

posting for posterity. will test that out and see if I can get build to work with es6