Giter Club home page Giter Club logo

typescript-react-rx-fluxlike-spa's Introduction

TypeScript-React-Rx-Fluxlike

個人的なFluxっぽいアーキテクチャのボイラープレート

モチベーション

背景

  • ReactのJSXは便利がよいなーと個人的に感じている。
  • しかし、Reactはビューに状態があって気持ち悪い。
    • 関心事は分離させたい。
    • StatelssComponentのみでReactを使いたい。
  • Fluxの単方向性はシンプルで良いと思ったので、Fluxっぽいアーキテクチャを使いたい。

解決策

  • Rxで状態を管理し、Reactで描画する。
    • RxがReactのStateの役割を担う。
    • Rxを用いて状態を管理して、ReactDOMにその状態を渡してDOM生成をすることで実現した。

概要図

完全なReduxと構成が少し違うが、Fluxの**は則っているつもり 概要

入っているフレームワーク等

  • 実装
    • React
      • JSXを用いたビュー生成
    • RxJS
      • BehaviourSubject,Subjectを用いた状態管理
    • inversify
      • DependencyInjection
    • Express
      • サーバー用に、Webフレームワーク
  • テスト
    • mocha
    • power-assert
    • enzyme
      • React用テストユーティリティ
  • ビルド・コマンド
    • gulp

gulpコマンド

  • frontend
    • gulp
      • コンパイル
    • gulp develop
      • localhost:8000に立ち上げ
      • frontend側のコードが書き換わるたびにコンパイルが走る。
    • gulp test
      • テストを走らせる
  • server
    • gulp
      • サーバー立ち上げ
      • frontendのコードを書き換えのたびにコンパイルする。
      • serverのコードを書き換えるたびに自動的にサーバーを立ち上げ直し

備考

開発スピードは落ちますが、CleanArchitectureとFluxの合わせ技のようなアーキテクチャを使うときもあります。 https://github.com/sato0203/TypeScript-React-CleanFlux

typescript-react-rx-fluxlike-spa's People

Contributors

sato0203 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.