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
The ^:export declaration are only necessary for the javascript build of datascript. But this eliminates any dead code elimination by the Google Closure compiler which would be nice for people not using certain features. For instance, I don't use FilteredDB.
By making the javascript build a little more involved, we could remove those export declaration for cljs use. cljsee can be used to process the datascript files:
(cljsee.parse/process-source-code;; The first tag will be output if it's in the features list:"#?( :js (def ^:export datom? db/datom?) :cljs (def datom? db/datom?) )"
#{:cljs:js})
This could allow even more fine grained code generation. Not sure if the trouble is worth it though.
A good enough solution would be to just change the code in datascript.core to:
The
^:export
declaration are only necessary for the javascript build of datascript. But this eliminates any dead code elimination by the Google Closure compiler which would be nice for people not using certain features. For instance, I don't use FilteredDB.By making the javascript build a little more involved, we could remove those export declaration for cljs use. cljsee can be used to process the datascript files:
This could allow even more fine grained code generation. Not sure if the trouble is worth it though.
A good enough solution would be to just change the code in
datascript.core
to:And allow cljs-only folks to define
datascript-export-js-api
to false.Thoughts?
The text was updated successfully, but these errors were encountered: