-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Query doesn't work under advanced optimizations #298
Comments
Works for me on
what version of compiler are you on? |
This was due to missing externs while using shadow-cljs. thheller pointed me to #216; adding Is there some place we can note this, if we can't remove the need for externs to be present under advanced optimizations? |
Well the idea of externs is that they are absolutely required. Why else have them? |
I'm not sure I understand. My point was that I had no idea that adding the externs to my project config was necessary. I was thinking that we could add a note to the installation instructions. |
Totally! shadow-cljs README should mention this for all CLJS projects! |
Confirming as well that this query
WORKS just by adding this to my shadow-cljs.edn file
|
I added a section under the wiki Tips & Tricks section. |
Hi, I followed this issue and add those two Since my build target is My solution is to add {:target :esm
...
:compiler-options {:infer-externs :auto
:externs ["datascript/externs.js"]}
:modules {:app {:exports ...
:prepend-js "if(window)window.datascript={};"} Just put it here in case someone encounters the same problem. |
@yqrashawn I am not familiar with how shadow processes externs. Does it simply prepends them? Do you think externs bundled with DataScript should be changed (e.g. datascript -> global.datascript?) |
I'm not familiar with closure compiler. I tried this in externs.js file. It's not work. Closure compiler still compiles it to I guess closure compiler don't know about that user is going to use the file in as a ESM file, only shadow-cljs knows about it. if (global) global.datascript = datascript
else if (window) window.datascript = datascript
else {
var datascript = {}
} |
@yqrashawn Thanks for the snippet. I wasn't able to use it in :prepend "if (global) { global.datascript = datascript } else if (window) { window.datascript = datascript } else { var datascript = {}}" |
The test should be |
☝️ this query doesn't work under advanced optimizations. any ideas why?
is the DB for instance and that query returns
#{[nil nil nil nil]}
The text was updated successfully, but these errors were encountered: