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
shadow-cljs emits a warning when using with-let #585
Comments
(not original poster) Seems to disappear when I downgrade Shadow-CLJS to |
I can confirm that the linked shadow-cljs change is the cause of this. The commit changed it so that proper inference warnings are emitted for My suggestion would be to move this entire block of code into a helper function Lines 62 to 67 in e67d4f8
So something like (defn check-generation! [^clj v]
(when-some [^clj c reagent.ratom/*ratom-context*]
(when (== (.-generation v) (.-ratomGeneration c))
(d/error "Warning: The same with-let is being used more "
"than once in the same reactive context."))
(set! (.-generation v) (.-ratomGeneration c)))) and the macro just emits a function call there. This reduces the amount of code generated for every |
Actually, it should also be fine to tag the return value with reagent/src/reagent/ratom.cljs Lines 329 to 332 in e67d4f8
(defn with-let-values ^clj [key]
(if-some [c *ratom-context*]
(cached-reaction (fn [] #js []) c key nil with-let-destroy)
#js [])) Maybe I can add an exception here so it doesn't warn. Normally library code doesn't warn, but since this is emitted by a macro it is treated as user code. |
Similar to this issue reported a while ago.
When using
with-let
I get the following warning.Possibly due to a missing type hint?
I've made a minimal reproductrion of the issue here.
reagent
1.1.1
shadow-cljs
2.20.17
Edit: This warning doesn't occur when using shadow-cljs 2.20.16 or below. Seems to be a result of this
The text was updated successfully, but these errors were encountered: