> 1. Should we call this "cljs-require"?  With the understanding that it is a 
> bit like a portal to cljs's ":require" form:
> 
> require('cljs-require/foo.core')

The package name must be something you add to your package.json, otherwise yarn 
will nuke the directory every time you run "yarn install". "npm" isn't as 
strict but still. Using the name of the tool seemed like the obvious choice. We 
can however create an empty cljs-require npm package that just serves as a 
placeholder. 

I'm totally for this if other tools want to adopt this idiom. I definitely do 
not want this to be something you can only do with shadow-cljs.


> 2. Is there a way to set the ClojureScript version, or is it tied to shadow's 
> version?

You can specify dependencies in package.json, basically like you would in lein.

"shadow-cljs: {
    "version":"1.0.20170516",
    "dependencies": [
      ["org.clojure/clojurescript", "1.9.542"]
    ]
}

where "version" is the version of shadow-devtools, any other dependencies are 
resolved using the fantastic pomegrenate lib. (thanks btw for writing the 
dep-resolver, I didn't think it would be this simple to do the dependency 
loading).

I'm not sure how the conflict resolution works but you should be able to use 
any cljs version you want. The only things written in stone are the deps of the 
shadow-cljs uberjar, can't change the clojure version after the fact.

See:
https://github.com/thheller/shadow-devtools/blob/master/npm-package/project.clj


> 
> 3. Thinking back on Jiyin's question about using cljs in webpack—have you put 
> any thought into the possibility of this workflow as a webpack loader?  Maybe 
> that's a next step?

Don't need a loader. It could be a plugin that just calls "shadow-cljs --once"
 before proceeding with the rest of the JS compilation.

I actually started by writing a plugin but to be honest I do not think it is 
super useful. You can achieve the same via npm scripts & co. You'll need the 
CLI tool for more advanced tasks (eg. REPL) anyways.

I want this to be generally useful, not just webpack. No specific webpack 
configuration is needed, you just somehow need to compile before calling 
webpack. "webpack -w" and "shadow-cljs --dev" side-by-side actually just works.

> Awesome job turning this webpack discussion into a real tool we can explore! 🎉

Thanks.

One issue that needs to be addressed is the widespread use of CLJSJS packages 
in popular libs like reagent&co. Can't have cljsjs.react react.js if you are 
supposed to use npm react.

I can easily skip over all foreign-libs but then (:require [cljsjs.react]) 
wouldn't have the effect of ensuring that "React" is available on global.  Not 
yet sure how to best handle that yet.

Still have a few ideas I want to explore, haven't totally given up on the 
Closure Compiler yet but it making life harder than it should be.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to