3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ミニマルなmiesというClojureScript leiningenテンプレート

Last updated at Posted at 2017-07-09

個人的に好きな [mies] (https://github.com/swannodette/mies) というleingenテンプレートがあるのだが、
提供している価値の割にはあまり知名度が無いようなので紹介してみる。

使いかた

leiningenが使える前提で

$ lein new mies project-name

特徴

  • 定期的に最新のClojureScriptに追従している
  • 元々の作者=現ClojureScriptのメンテナー (miesのメンテナンスは現在は別の方が行っている)
  • 基本的にはhello worldだけを行うClojureScriptソースだけが存在している
  • 目的別にビルド用シェル/cljスクリプトが用意されている(Windowsでも動くようにbatファイルもある)
    • build - 一度だけビルドする
    • watch - ソースの変更を検知して、自動的にビルドを実行する。開発中時はこれを使用する。
    • release - :optimizations :advancedを有効にしてビルドを行う。
    • repl - ブラウザに接続するreplを作成(個人的には [weasel] (https://github.com/tomjakubowski/weasel) を使用しているので使ったことは無い)

[figwheel] (https://github.com/bhauman/lein-figwheel/) は?

cljs-repl + 変更検知 + コードのホットロードをワンストップで提供できる強力なツールであることは間違い無いのだが、下記のデメリットがある:

  • 設定が多い → デフォルトは良い感じなのでただ使う分には問題にならないが、マスターするまでの学習量が多い
  • 単一ファイルのビルドが出来ない([参考] (https://github.com/bhauman/lein-figwheel/issues/126)) → 開発中でも単一ファイルのビルドが必要な制約が有る場合には使えない

他のxxxテンプレートは?

個人的な観測範囲だけで言うとあれもこれも依存関係として突っ込まれていたりするものが多い印象で、中々miesよりもミニマルな物に巡り合わない。

初心者に優しいのでは?説

watch関数を利用して変更→画面リロードのフローさえ許容できればClojureを学習する上で良く問題になる

  • エディタとの統合
  • ビルドツール(leiningen)の使い方

を一切知る事が無く開発を進めることが可能なので、これからClojure(Script)学習したいという人には以外と最適な物かも、という感想を持っている。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?