[ClojureScript] Re: A new take on ClojureScript and npm

2017-05-14 Thread Thomas Heller
Yes, currently it is just shadow-devtools via lein. Could also run it through 
boot, no problem.

I want to package it all up so you can "npm install shadow-npm".

Need to figure out how to best do that first though. Should probably also chose 
a better name.

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


[ClojureScript] Re: A new take on ClojureScript and npm

2017-05-14 Thread Jiyin Yiyong
On Sunday, May 14, 2017 at 6:45:48 PM UTC+8, Thomas Heller wrote:
> 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.

Is that project compiling with something like lein-cljs(in shadow-devtools) 
inside and then emit JavaScript that can be processed by Webpack?

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


[ClojureScript] Re: A new take on ClojureScript and npm

2017-05-14 Thread Thomas Heller
Just added another example that shows how you'd use CLJS in a create-react-app 
setup.

https://github.com/thheller/npm-module-example/tree/master/examples/create-react-app

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


Re: [ClojureScript] Re: Any chance we can fit ClojureScript into Webpack ecosystem?

2017-05-14 Thread Thomas Heller
I started a new topic [1] for the implementation.

You can find an example here:
https://github.com/thheller/npm-module-example

I'd be very interested in feedback from people that actually use webpack 
already.

[1] https://groups.google.com/forum/?fromgroups#!topic/clojurescript/AGXku7Ous0Y

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


[ClojureScript] A new take on ClojureScript and npm

2017-05-14 Thread Thomas Heller
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.


[ClojureScript] Re: ANN: ClojureScript 1.9.542, spec changes & REPL enhancement

2017-05-14 Thread Tatu Tarvainen

> * CLJS-2013 - Add MapEntry type

This change seems to break plumatic schema, after upgrading I'm getting 
warnings:

WARNING: ->MapEntry already refers to: cljs.core/->MapEntry being replaced by: 
schema.core/->MapEntry at ... schema/core.cljs

Plumatic also defines a MapEntry record type which clashes with the core one.

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