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

Dependencies #4

Open
nasser opened this issue May 22, 2016 · 11 comments
Open

Dependencies #4

nasser opened this issue May 22, 2016 · 11 comments

Comments

@nasser
Copy link
Owner

nasser commented May 22, 2016

How do I declare and acquire ClojureScript dependencies from node? Do we implement project.clj and defproject? Something like we did in Arcadia?

@ducky427
Copy link
Contributor

I'm got some code to recursively get dependencies for a given (group, artifact, version) tuple. I'm gonna expand on it in my free time.

I've taken some inspiration from the Arcadia code.

@nasser
Copy link
Owner Author

nasser commented May 31, 2016

Awesome! I was looking at xml2json as well. Glad the Arcadia code could be helpful.

@ducky427
Copy link
Contributor

All the async operations make the code slightly convoluted. But core.async atleast makes it possible without the callback hell.

I should have something which lets you download all the dependencies into a particular directory soon enough.

Just a thought: I think the biggest use case for this project beyond the cljs-repl could be to finally enabling cljs as a scripting language. so something like this but for clojurescript.

The issue with using leiningen etc is that you have to spin up a jvm and load Clojure which isn't a quick option whereas this would be as it would be using node.

@nasser
Copy link
Owner Author

nasser commented May 31, 2016

I agree. The REPL is an important step, but my real goal is scripting and embedding in frameworks like electron. Startup time is better than the JVM, but we still have to parse the ~6Mb of javascript that is the cljs language, compiler, and standard library, so there's a ~1s hiccup when we load.

@ducky427
Copy link
Contributor

good point. hmmm...

btw, I maintain a leiningen template which creates all the scaffolding required for an electron project. It is here. I've used it for a 10k+ loc project at work.

@nasser
Copy link
Owner Author

nasser commented May 31, 2016

Nice! I've used https://github.com/Gonzih/cljs-electron in the past. I am just trying to get away from lein and generated scaffolding...

@ducky427
Copy link
Contributor

ducky427 commented Jun 1, 2016

I've updated my code to be able to fetch all the dependencies for a give project and download them into a given folder.

@nasser
Copy link
Owner Author

nasser commented Jun 1, 2016

Amazing! I will check it when I get the chance.

@ducky427
Copy link
Contributor

ducky427 commented Jun 1, 2016

sweet. obviously this downloading code can be improved but it is just a start. Currently I am only downloading the jar and not checking for signatures etc. I'd like to implement that as well so that it is at par with leiningen and boot etc.

An idea I had for specifying the dependencies for the script is to specify them as comments on the top of the file. This way the file could be self contained. just an idea though.

@eginez
Copy link

eginez commented Sep 2, 2016

that's a great idea, I'd like it if it's more like the grape type stuff you find in groovy
http://docs.groovy-lang.org/latest/html/documentation/grape.html

maybe we can have a fn at the begging of the file that pulls of the dependencies before it executes

@nasser
Copy link
Owner Author

nasser commented Sep 9, 2016

Interesting precedent. Makes me think of F#'s #r and #I scripting stuff.

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

3 participants