You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Greg Weber explains how languages like Haskell and Elm are informing the design of Javascript libraries like Redux. He traces the evolution of front end coding from the simple to the complex and back towoard simplicity with carefully managed mutable state. This talk is based on work he did at the Haskell startup Front Row Education refactoring their front-end code. (Slides here) Summary Front row
JSDOMはnode環境でDOMをシミュレートするやつ。React.addons.TestUtilsはReactに同梱されているテストツール。この2つがあわさり最強に見える。 今作ってるライブラリのために、しばらくブラウザ使わずにテストしてたけど、ブラウザ立ち上げる必要なくて非常に快適。これ https://github.com/mizchi/arda/tree/master/test JSDOM、昔はとにかく不安定な印象だったけど、最近はよくできてる印象。見なおした。 コード # globalにdocumentとwindowを定義することで、DOM環境を参照できるようにする # 必ずReactの前に読み込むこと jsdom = require('jsdom').jsdom global.document = jsdom('<html><body></body></html>') # gl
結論 Sprocketsの動作を維持しつつ、npmやgulpなどのモダンなパワーも取り入れた、いいとこどりな環境を構築してみた。 やりたいこと SEOのため、Reactでserver-side renderingをしたい JSコードをES6で記述したい 既存のCoffeeScriptのコードも共存させたい(後ほど書き換える予定) npmやgulpといったモダンな環境でアセット管理をしたい browserifyを使いたい Sprocketsが実現している機能は維持したい そもそもSprocketsは何をしているか 周知のことでしょうが念のためおさらい。 ファイル毎の依存関係の管理 application.jsなどのマニュフェストファイルがやってること altJSのコンパイル アセットのminify アセットの連結 アセットファイル名にMD5フィンガープリントを挿入 Sprocketsの問題点
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く