Skip to content
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

shadow-cljs CLI utility should use lein if available #11

Closed
thheller opened this issue May 17, 2017 · 5 comments
Closed

shadow-cljs CLI utility should use lein if available #11

thheller opened this issue May 17, 2017 · 5 comments

Comments

@thheller
Copy link
Owner

If lein and project.clj are available it should use lein classpath and use that instead of constructing its own from package.json.

Need to check if boot can export a classpath.

@shaunlebron
Copy link
Contributor

Boot classpath with:

boot show -c

@thheller
Copy link
Owner Author

Thanks, first glance seems weird. I get a few entries like

/Users/zilence/.boot/cache/tmp/Users/zilence/745/d0ofpk/
/Users/zilence/.boot/cache/tmp/Users/zilence/745/11lgcg/
/Users/zilence/.boot/cache/tmp/Users/zilence/745/-p9hf6h/

These seem to be different on the next invocation.

/Users/zilence/.boot/cache/tmp/Users/zilence/765/d0ofpk/
/Users/zilence/.boot/cache/tmp/Users/zilence/765/11lgcg/
/Users/zilence/.boot/cache/tmp/Users/zilence/765/-p9hf6h/

I think boot always copies the :source-paths but when the paths change the incremental cache of shadow-cljs won't work.

Could maybe use a hash of the file contents instead of path+last-modified instead.

@thheller
Copy link
Owner Author

It now uses the lein classpath but that might actually create more problems than it solves.

Since shadow-cljs uses alpha16 clojure.spec.alpha it won't work with other versions of Clojure. The user may configure a different version in lein but not the normal approach of a tool specific classpath.

@thheller
Copy link
Owner Author

thheller commented Jun 2, 2017

I'm thinking that it is getting less useful to use lein since shadow-cljs can now do the classpath itself.

It may be fine to just have all CLJS configuration in shadow-cljs.edn and not in lein.

The issue with lein (or boot) is that any non-CLJS dependencies may mess up shadow-cljs (ie. if you want to use Clojure 1.8.0). CLJS dependencies are usually more lightweight and keeping them out of lein solves a couple of issues.

@thheller
Copy link
Owner Author

With :lein {:profile "+cljs"} in shadow-cljs.edn the CLI script will launch the JVM using lein.

shadow-cljs --once
shadow-cljs - 1.0.20170615-09 using /Users/zilence/code/shadow-cljs/shadow-cljs.edn
shadow-cljs - running: lein with-profile +cljs run -m shadow.cljs.devtools.cli --npm --once

When using :lein the :source-paths and :dependencies of lein are used and not those of shadow-cljs.edn.

I want a similar integration with boot but don't know enough about it to write it as boot is about much more than just managing the classpath and launching a JVM. There is a lot of feature overlap and some decisions made by boot don't align well with shadow-cljs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants