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

2017-05-11 Thread jiyinyiyong
It would be nice if we can require ClojureScript in JavaScript, and let
Webpack to handle so many issues.

For Webpack use cases, I tried to sell ClojureScript to other front-end
developers around me, but saw some problems:

* IMPORTANT: hard to install JVM. For JavaScript projects, installing
Node.js(with npm inside) would be okay. It's very hard for JavaScript
developers to pick up JVM and Boot(or Leiningen).
* IMPORTANT: long time caching and code splitting. We use these features in
production for years. But I don't see a good solution in ClojureScript.
* Async code loading. For large projects some code can be loaded when a
router is activated. No good solution found in ClojureScript.
* Assets bundling. Now we rely on Webpack to do that, result in using 2
tools.

Not sure if they can be solved if we have a ClojureScript running on
Webpack. But there are many compiled-to-js languages support those features
in by supporting Webpack already. That's the purpose behind the post.

Didn't try `node-jre`. I'm guessing we still need to debug JVM stuffs since
it's running JVM?

On Fri, May 12, 2017 at 6:11 AM Shaun LeBron 
wrote:

> On Wednesday, May 10, 2017 at 11:45:02 PM UTC-5, Jiyin Yiyong wrote:
> > Already an old boring topic... I'm from JavaScript side and so many
> people are building apps with Webpack. And so many of alt-js languages got
> Webpack loaders:
> >
> > BuckleScript https://github.com/rrdelaney/bs-loader
> > PureScript https://github.com/ethul/purs-loader
> > Elm https://github.com/elm-community/elm-webpack-loader
> > Fable https://github.com/fable-compiler/Fable
> >
> > Exception:
> >
> > No Webpack for ReasonML
> https://github.com/chenglou/reason-react-example/blob/master/webpack.config.js
> >
> > Can we make a loader for ClojureScript?
> >
> > Or how about the possibility? I guess Closure Compiler will get in the
> why. But is it possible if I don't use dead code elimination from Closure
> Compiler? I know many people need it but seriously no other solutions? And
> how much does ClojureScript depend on Closure Library?
>
> I'm from the JS side as well, so I'm glad to see this question!  Are you
> imagining something like the following?  We should probably start by
> imagining why someone would want to require cljs this way and if it would
> even make sense to:
>
> ```
> require('cljs!./src-cljs') // return all goog.provided namespaces?
> require('cljs!./src-cljs/foo/core.cljs') // return a single goog.provide
> namespace?
> ```
>
> Either way I think it would need Closure Compiler to return a single asset
> for each require statement, if I understand webpack correctly.
>
> It's worth mentioning that the recent "node-jre" package allows users to
> install/use the full cljs JVM compiler in its fully glory through npm
> without any external dependencies, which I've tested here:
> https://github.com/cljs/tool
>
> I think it's possible—just unsure of webpack use-cases.  Thoughts?
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ClojureScript" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojurescript/HNuYCfPRtQw/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>

-- 
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: Any chance we can fit ClojureScript into Webpack ecosystem?

2017-05-11 Thread Shaun LeBron
On Wednesday, May 10, 2017 at 11:45:02 PM UTC-5, Jiyin Yiyong wrote:
> Already an old boring topic... I'm from JavaScript side and so many people 
> are building apps with Webpack. And so many of alt-js languages got Webpack 
> loaders:
> 
> BuckleScript https://github.com/rrdelaney/bs-loader
> PureScript https://github.com/ethul/purs-loader
> Elm https://github.com/elm-community/elm-webpack-loader
> Fable https://github.com/fable-compiler/Fable
> 
> Exception:
> 
> No Webpack for ReasonML 
> https://github.com/chenglou/reason-react-example/blob/master/webpack.config.js
> 
> Can we make a loader for ClojureScript? 
> 
> Or how about the possibility? I guess Closure Compiler will get in the why. 
> But is it possible if I don't use dead code elimination from Closure 
> Compiler? I know many people need it but seriously no other solutions? And 
> how much does ClojureScript depend on Closure Library?

I'm from the JS side as well, so I'm glad to see this question!  Are you 
imagining something like the following?  We should probably start by imagining 
why someone would want to require cljs this way and if it would even make sense 
to:

```
require('cljs!./src-cljs') // return all goog.provided namespaces?
require('cljs!./src-cljs/foo/core.cljs') // return a single goog.provide 
namespace?
```

Either way I think it would need Closure Compiler to return a single asset for 
each require statement, if I understand webpack correctly.

It's worth mentioning that the recent "node-jre" package allows users to 
install/use the full cljs JVM compiler in its fully glory through npm without 
any external dependencies, which I've tested here: https://github.com/cljs/tool

I think it's possible—just unsure of webpack use-cases.  Thoughts?

-- 
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] Any chance we can fit ClojureScript into Webpack ecosystem?

2017-05-11 Thread Jonas Kello
ReasonML can be compiled by bucklescript loader AFAIK. However I think that 
will make it compile slower.

-- 
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: Any chance we can fit ClojureScript into Webpack ecosystem?

2017-05-11 Thread Thomas Heller
IMHO the webpack ecosystem and CLJS can live happily side by side, why is it 
important that they know about each other? Good JS interop ensures that both 
sides can interact well.

What would you expect from a loader that you'd be willing to give up the 
Closure Compiler?


On Thursday, May 11, 2017 at 6:45:02 AM UTC+2, Jiyin Yiyong wrote:
> Already an old boring topic... I'm from JavaScript side and so many people 
> are building apps with Webpack. And so many of alt-js languages got Webpack 
> loaders:
> 
> BuckleScript https://github.com/rrdelaney/bs-loader
> PureScript https://github.com/ethul/purs-loader
> Elm https://github.com/elm-community/elm-webpack-loader
> Fable https://github.com/fable-compiler/Fable
> 
> Exception:
> 
> No Webpack for ReasonML 
> https://github.com/chenglou/reason-react-example/blob/master/webpack.config.js
> 
> Can we make a loader for ClojureScript? 
> 
> Or how about the possibility? I guess Closure Compiler will get in the why. 
> But is it possible if I don't use dead code elimination from Closure 
> Compiler? I know many people need it but seriously no other solutions? And 
> how much does ClojureScript depend on Closure Library?

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