You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm having some difficulty with using datascript in my chrome extension.
I'm building from clojurescript with shadow-cljs, using build settings :target :node-library
and then importing the bundle in my chrome extension.
Besides some funkiness with the imports, everything has worked as expected, and I've been
able to execute the bundled Clojure code from my chrome extension. I know that datascript
has a javascript API, but I'm currently testing out this project setup to see if the added
convenience of having a clojure REPL and developing the datascript queries/logic in clojurescript is worth it.
The problem I'm having, is that my datascript query works perfectly fine when
executed from a Clojure REPL, but when I run the code from the chrome extension
the results of the query are, as far as I can tell, replaced with nil values.
I think this isn't a datascript problem, and this is related somehow to the specifics
of compiling and running my Clojure code in a chrome extension. However, since
datascript has a javascript API* that has the expected behavior, I hope
there might be some insights into my problem. Thank you!
*I set up this same project using the javascript API and it works as expected.
Here is my javascript code for reference: Popup.svelte
Hello, I'm having some difficulty with using datascript in my chrome extension.
I'm building from clojurescript with shadow-cljs, using build settings
:target :node-library
and then importing the bundle in my chrome extension.
Besides some funkiness with the imports, everything has worked as expected, and I've been
able to execute the bundled Clojure code from my chrome extension. I know that datascript
has a javascript API, but I'm currently testing out this project setup to see if the added
convenience of having a clojure REPL and developing the datascript queries/logic in clojurescript is worth it.
Here is my
shadow-cljs.edn
The problem I'm having, is that my datascript query works perfectly fine when
executed from a Clojure REPL, but when I run the code from the chrome extension
the results of the query are, as far as I can tell, replaced with nil values.
My
hello.cljs
fileThe result that gets printed when ran from the Clojure repl is
#{[1 Title]}
.But when the function is called from my chrome extension, here is what gets printed:
I think this isn't a datascript problem, and this is related somehow to the specifics
of compiling and running my Clojure code in a chrome extension. However, since
datascript has a javascript API* that has the expected behavior, I hope
there might be some insights into my problem. Thank you!
*I set up this same project using the javascript API and it works as expected.
Here is my javascript code for reference:
Popup.svelte
clojure.ts
The build tool I'm using on the javascript side of things is vite.
Github Repo (the code isn't great): https://github.com/macklinhrw/Bookmarks
The text was updated successfully, but these errors were encountered: