typeetfunc / datascript-mori

Package for union datascript and mori
https://www.npmjs.com/package/datascript-mori
Eclipse Public License 1.0
37 stars 6 forks source link

Warnings when building #11

Open ashnur opened 4 years ago

ashnur commented 4 years ago
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.
bahulneel commented 4 years ago

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).

ashnur commented 4 years ago

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.

bahulneel commented 4 years ago

@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.

ashnur commented 4 years ago

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...

bahulneel commented 4 years ago

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.