A Rails5, 动作电缆, Redux/ React ChatApp 示例,现在用Webpack/HMR进行快速开发
A Rails5, 动作电缆, Redux/ React ChatApp 示例,现在用Webpack/HMR进行快速开发
[Updated Feb 27, 2016] Now with Webpack and Hot Module Replacement (HMR) for rapid development
Rails5 brings the long-awaited ActionCable (integrated websockets) into the game. Combined with the Redux implementation of Flux - and of course React components - there's potential here for an interesting stack if you don't want to create a separate front-end app and use Rails5 as an API server (which it now more easily does out of the box as an option, BTW).
I spent some time over the holiday break pulling examples from:
..to create a very simple chat app. Live demo here.
If you're curious to learn more, I posted some background/motivation and a code walkthrough on my Medium account here. Another post discussing the webpack/HMR addition is coming soon.
Anyway, diving right into the setup (I'm assuming you are familiar with Rails/JavaScript):
config/database.yml.example to config/database.yml and setup your username to be whatever super user (PostgreSQL) you have on your local machine.bundle install and npm install and rails db:create and rails db:migrate and rails db:seed to add a quick "Hello World" message into the database.rails s and point your web browser to http://localhost:3000npm startThat's it for now!
暂无开放 Issues,或尚未同步最近议题。