Fork me on GitHub
#clojure-japan
<
2015-08-20
>
mopemope00:08:58

bidiとかはcljsでも動くので使ってる人いそうだ

mopemope00:08:46

newrelicは価格と相談でって感じの人多そうだったけど今はどーなのかな

mopemope00:08:54

昔僕が作ったwsgiサーバーもすぐ対応してくれたので悪い印象はない

ayato_p00:08:43

bidi うちでは使ってますね

mopemope00:08:52

まえ作ったのは普通にsecretary使ったなあ

mopemope01:08:18

clojurescript で大きいアプリケーション書いた場合のsplitの方法があるか知りたい

mopemope01:08:00

modulesでやるしかないのかなー

mopemope01:08:11

よしなにchunkして欲しいけど

ayato_p01:08:44

split ってどういうことですか?

mopemope01:08:37

webpackみたいに必要なときに初めてロードする仕組み

mopemope01:08:39

webpackはrequireで遅延ロードができて、その依存とかを勝手に判断してコードをchunk化する

mopemope01:08:11

必要なときにjsonpでアクセスしてロード、キャッシュする

mopemope01:08:00

main エントリが小さくできるのと、並列でロードできるので初期ロード時間が稼げる

ayato_p01:08:52

そんな仕組みがあるんですね > webpack ただの browserify と似たようなビルドツールだと思ってました

mopemope01:08:28

まあ書き方も少し変わるけど

mopemope01:08:19

Version: webpack 1.11.0
Time: 5153ms
               Asset     Size           Chunks             Chunk Names
       bundle.js.map  2.61 kB            0, 15  [emitted]  main
           bundle.js  3.57 kB            0, 15  [emitted]  main
         2.bundle.js   409 kB            2, 15  [emitted]  
         3.bundle.js  13.5 kB            3, 15  [emitted]  
         4.bundle.js  76.6 kB            4, 15  [emitted]  
         5.bundle.js   411 kB         5, 2, 15  [emitted]  
         6.bundle.js   778 kB  6, 2, 5, 12, 15  [emitted]  
         7.bundle.js  3.21 kB            7, 15  [emitted]  
         8.bundle.js  3.33 kB            8, 15  [emitted]  
         9.bundle.js  2.75 kB            9, 15  [emitted]  
        10.bundle.js   3.4 kB           10, 15  [emitted]  
        11.bundle.js   587 kB           11, 15  [emitted]  
        12.bundle.js   678 kB        12, 2, 15  [emitted]  
        13.bundle.js  1.92 kB           13, 15  [emitted]  
        14.bundle.js   259 kB           14, 15  [emitted]  
    baypos.bundle.js  3.68 kB               15  [emitted]  baypos
         1.bundle.js   279 kB            1, 15  [emitted]  
     1.bundle.js.map   326 kB            1, 15  [emitted]  
     2.bundle.js.map   472 kB            2, 15  [emitted]  
     3.bundle.js.map  15.6 kB            3, 15  [emitted]  
     4.bundle.js.map  93.2 kB            4, 15  [emitted]  
     5.bundle.js.map   474 kB         5, 2, 15  [emitted]  
     6.bundle.js.map   904 kB  6, 2, 5, 12, 15  [emitted]  
     7.bundle.js.map  2.96 kB            7, 15  [emitted]  
     8.bundle.js.map  3.06 kB            8, 15  [emitted]  
     9.bundle.js.map  2.79 kB            9, 15  [emitted]  
    10.bundle.js.map  3.51 kB           10, 15  [emitted]  
    11.bundle.js.map   692 kB           11, 15  [emitted]  
    12.bundle.js.map   789 kB        12, 2, 15  [emitted]  
    13.bundle.js.map  2.08 kB           13, 15  [emitted]  
    14.bundle.js.map   303 kB           14, 15  [emitted]  
baypos.bundle.js.map  3.69 kB               15  [emitted]  baypos

mopemope01:08:26

こんなふうになる

mopemope01:08:56

真面目に使うとおもしろい

ayato_p01:08:00

面白そうですね

ayato_p01:08:50

ちなみに ClojureScript でそういう仕組みは僕は知らないですね。 modules くらいですかね

mopemope01:08:48

ですかねー

mopemope01:08:07

Om Next のやつ、ちゃんと見てないけどなんかごついのになるのかな?

tnoda09:08:32

Om Next のやつ,Euroclojure の講演動画しか見ていないんですけど,目玉の一つが Facebook の Relay が GraphQL を使って,Netflix の Falcor が JSON Graph を使って,それぞれ実現しているものを Datomic Pull のパタンを使って実現しようとしているところだと思いました。素直に Datomic を使う分にはいいんですけど,たとえばクライアント側に Datascript を使うとして,それ以外の自前のマイクロサービスをバックエンドにして繋げるのはどうするのがよいのか,ちょっと思いつかないです。

tnoda09:08:28

話は変わるのですが, Leiningen で C で書かれたネイティブライブラリをコンパイルして, jar を作りたいときの project.clj の書き方って,どこかにサンプルありませんか? Idiomatic だったり de facto だったりする方法があれば教えて欲しいです。無ければ Maven プロジェクトにしてしまおうかと思っています。

koji_yusa10:08:06

lein javacみたいにCソースをleiningen側でビルドするようなものは、自分はみたことないですね。 make系呼んだりぐらいはあるかもしれませんが。 確かにjavaだとjniから呼び出すCソースも一緒にしてるプロジェクトありますね。 clojureだとcoreにjni用の構文がないのも一因かなと思って、scalaのsbtプラグイン探したら作ってる人がいたりするんですね。 https://github.com/d40cht/sbt-cpp

ayato_p10:08:57

jvm 系言語のコンパイルだったら見るんですけどね。

koji_yusa10:08:23

webpackに、言及してる記事は見たことありますが、 http://swannodette.github.io/2015/02/23/hello-google-closure-modules/

koji_yusa10:08:17

これは試したことないですね。 https://github.com/thheller/shadow-build

tnoda11:08:46

いろいろと情報ありがとうございます。で, make && lein jar で jar ファイルを作れるところまでできたので,いけるところまでこの方法でやってみることにします。