GithubHelp home page GithubHelp logo

shakacode / react_on_rails Goto Github PK

View Code? Open in Web Editor NEW
5.1K 81.0 627.0 71.57 MB

Integration of React + Webpack + Rails + rails/webpacker including server-side rendering of React, enabling a better developer experience and faster client performance.

Home Page: https://www.shakacode.com/react-on-rails/docs/

License: MIT License

Ruby 67.48% JavaScript 13.40% HTML 9.33% Shell 0.64% TypeScript 8.41% SCSS 0.55% CSS 0.01% ReScript 0.18% Procfile 0.01%
react-rails react-components redux-store rails-views rails-development react webpack ruby-on-rails ruby-gem npm-module

react_on_rails's Introduction

reactrails


LicenseGem Version npm version Code Climate Coverage Status

Build Main Build JS Tests Build Rspec Tests Linting

News

  • ShakaCode now maintains the official successor to rails/webpacker, shakapacker.
  • Project is updated to support Rails 7 and Shakapacker v6+!

These are the docs for React on Rails 13. To see the older docs: v12 and v11.

About

React on Rails integrates Rails with (server rendering of) React.

This project is maintained by ShakaCode.

ShakaCode Upgrade Support

ShakaCode focuses on helping Ruby on Rails teams better use React and Webpack. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead.

For an overview of working with us, see our Client Engagement Model article and how we bill for time.

We also specialize in helping development teams lower infrastructure and CI costs. Check out our project Control Plane Flow, which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings.

If you think ShakaCode can help your project, click here to book a call with Justin Gordon, the creator of React on Rails.

React on Rails Pro

Are you interested in optimizing your webpack setup for React on Rails, including code splitting with react-router and loadable-components with server-side rendering for SEO and hot-reloading for developers? We did this for Popmenu, lowering Heroku costs 20-25% while getting a 73% decrease in average response times. Several years later, Popmenu serves tens of millions of SSR requests daily with React on Rails Pro.

If you're interested, read more about React on Rails Pro and book a call.

Documentation

See the documentation at shakacode.com/react-on-rails/docs.

Project Objective

To provide a high-performance framework for integrating Ruby on Rails with React, especially regarding React Server-Side Rendering for better SEO and improved performance.

Features and Why React on Rails?

Given that shakacode/shakapacker gem already provides basic React integration, why would you use "React on Rails"?

  1. Automatic configuration of what bundles are added to the page based on what React components are on the page. This results in faster browser loading time via smaller bundle sizes.
  2. Keep up with the latest changes in different versions of React. React 18 is supported.
  3. Easy passing of props directly from your Rails view to your React components rather than having your Rails view load and then make a separate request to your API. Tight integration with shakapacker (or its predecessor rails/webpacker).
  4. Server-Side Rendering (SSR), often used for SEO crawler indexing and UX performance.
  5. Automated optimized entry-point creation and bundle inclusion when placing a component on a page. With this feature, you no longer need to configure javascript_pack_tags and stylesheet_pack_tags on your layouts based on what’s shown. “It just works!”
  6. Redux and React Router integration with server-side-rendering.
  7. Internationalization (I18n) and (localization)
  8. A supportive community. This web search shows how live public sites are using React on Rails.
  9. ReScript Support.

See Rails/Webpacker React Integration Options for comparisons to other gems.

Online demo

ShakaCode Forum Premium Content

Requires creating a free account.

Prerequisites

Ruby on Rails >=5, rails/webpacker >= 4.2 or shakapacker > 6, Ruby >= 3.0.0

Support

Contributing

Bug reports and pull requests are welcome. To get started, see Contributing and the list of help wanted issues.

Work with Us

ShakaCode is hiring passionate software engineers to work on our projects, including HiChee!

License

The gem is available as open source under the terms of the MIT License.

Supporters

The following companies support our open-source projects, and ShakaCode uses their products!



JetBrains ScoutAPM Control Plane
BrowserStack Rails Autoscale Honeybadger Reviewable

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.