Hello,

I wrote a few lines of code that should hopefully make it easier to get started 
with CLJS for people coming from the JS world.

I created a demo here:
https://github.com/thheller/npm-module-example

The gist is that you gain: var foo = require("shadow-npm/demo.foo");

Where "shadow-npm" is a pseudo node-module generated by the tool and "demo.foo" 
is just the CLJS namespace you want. The require will return the NS so 
foo.bar() just works. The CLJS sources can use any npm module and local sources 
as well.

See: 
https://github.com/thheller/npm-module-example/blob/master/src/main/demo/foo.cljs

Given that the generated code is NPM compliant it should work with any npm JS 
tools. The demo has a basic setup for webpack, no special configuration for 
CLJS is needed.

I barely know anything about any NPM tools so I might be doing something 
completely wrong, please create issues on the shadow-devtools [1] project if 
you run into issues. I only tested node itself and webpack.

The sacrifice is that you can't use the Closure Compiler but you gain 
everything the npm world has to offer with hopefully seemless interop. Do not 
underestimate the impact of this sacrifice though, I cannot recommend using 
this for production builds.

The example still uses leiningen by I may drop that and create something 
standalone.

Need to work on a lot of things still but the proof of concept works, maybe it 
is useful to someone.

Cheers,
/thomas

[1] https://github.com/thheller/shadow-devtools

PS: This is not related to :npm-deps at all.

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