-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qwik QRL #498
Comments
Can you be more specific on what is the difference in output? Is that only the arrow function vs |
Yeah seems it works better with the arrow function clojure output |
I don't see how |
So I guess we could use a syntax in squint to produce "arrow" functions instead, e.g. |
Yeah changing the output fixes the issue. Is there a reason the |
I some cases |
I think let's park this for now. I am not familiar with the framework. I was just getting the vite templates to work. I will open an issue with them first to see why the |
Can Could be useful to provide some low level syntax helpers in squint to emit the respective syntax, maybe? |
So it seems you can wrap the function in their (ns app
(:require ["@builder.io/qwik" :refer [component$ useSignal $]]
["./app.css"]))
(defn -App []
(let [count (useSignal 0)]
#jsx [:button {:onClick$ ($ #(set! (.-value count) (inc count)))}
"count is " (.-value count)]))
(def App (component$ -App)) This compiles to: <button onClick$={$((function () { return count1.value = (count1 + 1);}))}>count is {count1.value}</button> If the extra paren wasn't added around the function this would work. It should look like this instead: <button onClick$={$(function () { return count1.value = (count1 + 1);})}>count is {count1.value}</button>
// ^ |
Arrow functions are not just syntax sugar, they have different behavior. Though the exact description of the main difference eludes me right now (something something scoping?), here's a quick example:
Another difference is hoisting. Not being able to specify the kind of function in Squint is kind of a non-starter for me. A |
This isn't done because of compatibility with existing CLJS code |
I created an issue but also realized that maybe we should just rename this one, then all context is in one place. |
#499 is fixed, I think this should work now |
In the Qwik Framework, they have a concept of QRL.
I have the following
button
:This is the output
This would be the ideal output:
Qwiks $ optimiser needs serializable values.
The text was updated successfully, but these errors were encountered: