clojure / clojurescript-site

website for ClojureScript
Eclipse Public License 1.0
107 stars 135 forks source link

Update Quickstart for Latest CLJ Tools #366

Closed mfikes closed 3 years ago

mfikes commented 3 years ago

For example you see the warnings about -M

% clj --main cljs.main --compile hello-world.core --repl
WARNING: When invoking clojure.main, use -M
mobileink commented 3 years ago

While you're at it, an explanation of -M, -A, and -X would be very helpful. It's surprisingly difficult to find good information about them.

What would also be super helpful would be documentation of build.edn. The documentation refers to it in various places without saying what it is or how it should be used.

puredanger commented 3 years ago

You can find info about the clj options with clj -h or man clj or at https://clojure.org/reference/deps_and_cli or https://clojure.org/guides/deps_and_cli.

mobileink commented 3 years ago

Thanks, I don't know how I missed that stuff. Oh wait, I know: version mismatch, the bane of my existence. I was running 1.10.1.5something, and must have just skimmed the reference page. Or more likely confused the Clojure and Clojurescript docs. And I didn't even know you provided manpages, kudos.

One nit: the reference page refers to make-classpath, but that seems to be deprecated in favor of make-classpath2.

Also I still haven't found a good source of info on files like build.edn, and then there's deps.cljs. Maybe another versioning issue? Lots of guides/tutorials online, but its hard to tell which ones are in sync with the official releases.

Thanks.

puredanger commented 3 years ago

The make-classpath function referred to in the page is https://clojure.github.io/tools.deps.alpha/clojure.tools.deps.alpha-api.html#clojure.tools.deps.alpha/make-classpath, which is not deprecated. The make-classpath2 namespace is an internal part of the clj and not part of the the public api. So, the reference page is correct.

The build.edn and deps.cljs files are specific to ClojureScript and there are several pages on the clojurescript web site describing their use. Probably the main reference page is https://clojurescript.org/reference/dependencies and also https://cljsjs.github.io/ for info on cljs deps. The ClojureScript guides (like https://clojurescript.org/guides/webpack) have more info on use of build.edn, I don't know what the canonical guide to that is but maybe @mfikes does.

mobileink commented 3 years ago

Thanks for the quick response! WRT make-classpath, I was going by the source code, which says {:deprecated "0.9.745"}. FWIW, I've got a tool written in Clojure that I use to support Bazel rules for OCaml (beta release soon), so I'm digging around in the sources for the clj and clojure scripts to try to figure out the best way to integrate it into Bazel.

swannodette commented 3 years ago

was fixed https://github.com/clojure/clojurescript-site/commit/53de8b8af3f6b3567e1f40838bd56e8cde022edd, https://github.com/clojure/clojurescript-site/commit/59a049f66d56bd2fe33c530ec7bbe145475a00a1