Just found out about cherry - I’m interested in how the #jsx reader tag works. Are there any details about it? How does it know when a symbol or expression represents dynamic props or when they are children?
The details are in the documentation :)
Any expression starting with ( introduces a new non-jsx scope
so:
#jsx [:a (str (+ 1 2 3))]
#jsx [:div [:a ...]]
#jsx [:div [:a (let [x 1] #jsx [:p (str x)]]]]
etcaha gotcha
I'm simultaneously working on #squint which is like cherry, but re-implements the stdlib in pure JS
which yields much smaller JavaScript bundles. Also it has more features right now like watching directories (which will be ported to cherry as well)
ah you mean in the sprint docs I see it now
sprint?
squint
too much jira lol
gotcha :)
here is a vite + react example: https://github.com/squint-cljs/squint/tree/main/examples/vite-react
with a JSX component: https://github.com/squint-cljs/squint/blob/main/examples/vite-react/src/MyComponent.cljs
cool!!