datascript-mori icon indicating copy to clipboard operation
datascript-mori copied to clipboard

Warnings when building

Open ashnur opened this issue 5 years ago • 5 comments

Warning: implicit hook found: lein-git-deps.plugin/hooks 
Hooks are deprecated and will be removed in a future version.
Compiling ClojureScript...
Compiling ["release-js/datascript-mori.bare.js"] from ["src" ".lein-git-deps/mori/src"]...
WARNING: mori is a single segment namespace at line 1 /home/ashnur/repos/others/datascript-mori/.lein-git-deps/mori/src/mori.cljs
WARNING: var: datascript.js/schema->clj is not public at line 16 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
WARNING: var: datascript.js/entity->clj is not public at line 17 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
WARNING: var: datascript.js/entities->clj is not public at line 18 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
WARNING: var: datascript.js/tempids->js is not public at line 19 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
WARNING: var: datascript.js/tx-report->js is not public at line 20 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
WARNING: var: datascript.js/pull-result->js is not public at line 22 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
WARNING: var: datascript.js/keywordize is not public at line 23 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs
Packed release-js/datascript-mori.js
Successfully compiled ["release-js/datascript-mori.bare.js"] in 15.464 seconds.
  • implicit hook?
  • what is this about the 'not public', @bahulneel did I mess up something here?

ashnur avatar Feb 07 '20 10:02 ashnur

So I think they are mostly benign:

Warning: implicit hook found: lein-git-deps.plugin/hooks 
Hooks are deprecated and will be removed in a future version.

This warning is because we're using a lein plugin to fetch the mori source via git. I think if we were to transition to deps, then we could use the in build git support (maybe).

WARNING: mori is a single segment namespace at line 1 /home/ashnur/repos/others/datascript-mori/.lein-git-deps/mori/src/mori.cljs
WARNING: var: datascript.js/schema->clj is not public at line 16 /home/ashnur/repos/others/datascript-mori/src/datascript_mori/core.cljs

So these warnings are due to the helpers provided referring fns that are marked private by datascript (as they are not part of the public API).

bahulneel avatar Feb 07 '20 14:02 bahulneel

I would love to move to clj instead of using lein. Major pita. Most complex building tool I ever dealt with, including webpack.

I also do not understand what is happening with the wrapper. Is this documented anywhere? I think it's unnecessary, we should generate actual js files and just use commonjs which can be bundled easily and works well with the rest of the ecosystem atm. Avoids unnecessary tooling and so forth.

ashnur avatar Feb 08 '20 13:02 ashnur

@ashnur I believe the situation with the wrapper was inherited from mori (pre any helpful cljs->js module tooling), and then this happened with datascript.

I think maybe we could leverage shadow-cljs + clj tools to generate aggregated modules.

It really feels like there's a generality in here i.e. exporting (and, maybe, renaming) a load of local and required symbols and placing them in various js objects in one minified js file. Additionally, it feels like the js module support in cljsbuild would be able to do alot of heavy lifting here.

bahulneel avatar Feb 09 '20 14:02 bahulneel

Could you, please, give a few more specific pointers/links to how shadow-cljs would make this more generally usable? Specifically, what is this 'js module support in cljsbuild'? Something from here? https://shadow-cljs.github.io/docs/UsersGuide.html#_modules I tried to search for cljsbuild...

ashnur avatar Feb 09 '20 15:02 ashnur

I was opining on what might be possible with no sources to back it up. I'll certainly try to back up my statements in this thread after I've done some research.

bahulneel avatar Feb 09 '20 19:02 bahulneel