Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
By, Michael Chan React is the best way to bring interactive UIs to your Rails apps. But using React.js on Rails can be hard. NPM libraries are difficult to include, JSX seems nonsensical, and “can we still use CoffeeScript?” There’s not one obvious path for working with React.js on Rails. In this talk, we’ll review the sordid past of Rails and JavaScript, explore the complementarity of React and Rails, and navigate the woes of integrating with NPM. We’ll discover why React is a natural fit for Rails today and how to make Rails love React in the future.
Date
Summary
Markdown supported
In this session at RailsConf 2015, Michael Chan presents 'React.js on Rails,' emphasizing the challenges and advantages of integrating React with Rails applications. The talk begins with an acknowledgment of JavaScript's historically problematic role within the Rails ecosystem, highlighting the complications of managing JavaScript libraries and frameworks. Chan describes his early experiences with JavaScript in the context of his application, Services, which led to significant learning from the use of frameworks like Batman JS. Key issues included the cumbersome management of separate client-side and server-side application architectures. To articulate the synergy between Rails and React, Chan presents several key points: - **Integration Challenges:** The transition to modern JavaScript frameworks like React can be rocky, with developers facing issues in state management and application structure when splitting front-end and back-end systems. - **Adopting React:** He emphasizes React's suitability in creating user interfaces that remain aligned with Rails principles — allowing developers to handle components effectively without fully abandoning the Rails stack. - **Real-Time Applications:** Chan describes how React supports sophisticated real-time interactions, illustrated through the use of tools like Pusher in building a real-time commenting feature. - **Component-Based Architecture:** He delves into the fundamental attributes of React components, covering their three main functions: rendering, receiving props, and maintaining state. He relates this to Rails partials to bridge the gap for Ruby developers. - **Efficient Updates:** React’s methodology optimizes the efficiency of updating components and managing state, using techniques like ’setState’ and lifecycle methods to control data flow. - **Practical Implementations:** The tutorial aspect of the talk offers hands-on instructions for creating a React-powered application within a Rails environment, illustrating concepts clearly with code examples. - **Utilization of React-Rails Gem:** He recommends the react-rails gem for smooth integration, mentioning its compatibility with TurboLinks and CoffeeScript as beneficial for developers looking to maximize efficiency while minimizing complexity. - **Future Considerations:** Conclusively, he advises attendees to embrace newer standards like ES6 and JSX, countering the previous hesitations towards these technologies to leverage React’s full potential. Through his talk, Chan motivates developers to adopt a thoughtful approach to integrating React within Rails, prioritizing simplicity and efficiency while embracing modern JavaScript practices. The main takeaway emphasizes limiting JavaScript usage to essentials, enhancing Rails UIs with React components intelligently without overwhelming the application.
Suggest modifications
Cancel