Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a react on rails pro column to compare #1310

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ In some cases, having multiple `require.context` entries may be desired. Example

- Refactoring a typical Rails application into a Rails API with an (eventually) separate Single Page Application (SPA). For this use case, one can add a separate pack in addition to the typical `application` one. React components can be shared between the packs but the new pack can use a minimal Rails view layout, different default styling, etc.
- In a larger application, you might find it helpful to split your JavaScript by routes/controllers to avoid serving unused components and improve your site performance by keeping bundles smaller. For example, you might have separate bundles for homepage, search, and checkout routes. In that scenario, you can add an array of `require.context` component directory paths via `useContexts` to `server_rendering.js`, to allow for [Server-Side Rendering](#server-side-rendering) across your application:

```js
// server_rendering.js
var homepageRequireContext = require.context('homepage', true);
Expand Down Expand Up @@ -784,7 +784,7 @@ For example, to change the [ES6 Component template](https://github.com/reactjs/r

### 2.7 to 3.0
- Keep your `react_ujs` up to date: `yarn upgrade`
- **Drop support for Webpacker:** Before any ReactRails upgrade, make sure upgrading from Webpacker to Shakapacker 7. For more information check out Shakapacker
- **Drop support for Webpacker:** Before any ReactRails upgrade, make sure upgrading from Webpacker to Shakapacker 7. For more information check out Shakapacker
- **SSR:** ReactRails 3.x requires separate compilations for server & client bundles. See [Webpack config](https://github.com/reactjs/react-rails/tree/master/test/dummy/config/webpack) directory in the dummy app to addapt the new implementation.

### 2.3 to 2.4
Expand All @@ -807,22 +807,22 @@ For the vast majority of cases this will get you most of the migration:

## Migrating from `react-rails` to `react_on_rails`

### Why to migrate?
### Why migrate

[`react_on_rails`](https://github.com/shakacode/react_on_rails/) offers several additional features for a Rails + React application. The following is a table of features comparison.

| **Feature** | **react-rails** | **react-on-rails** |
| ----------------------- |:---------------:|:------------------:|
| Sprockets | ✅ | ❌ |
| Shakapacker | ✅ | ✅ |
| SSR | ✅ | ✅ |
| SSR with HMR | ✅ | |
| SSR with React-Router | ❌ | |
| SSR with Code Splitting | ❌ | |
| Node SSR | ❌ | |
| Advanced Redux support | ❌ | |
| ReScript support | ❌ | |
| I18n support | ❌ | |
| **Feature** | **react-rails** | **react-on-rails** | **react-on-rails pro** |
| ----------------------- |:---------------:|:------------------:|:----------------------:|
| Sprockets | ✅ | ❌ | ❌ |
| Shakapacker | ✅ | ✅ | ✅ |
| SSR | ✅ | ✅ | ✅ |
| SSR with HMR | ✅ | ❌ | ✅ |
| SSR with React-Router | ❌ | ❌ | ✅ |
| SSR with Code Splitting | ❌ | ❌ | ✅ |
| Node SSR | ❌ | ❌ | ✅ |
| Advanced Redux support | ❌ | ❌ | ✅ |
| ReScript support | ❌ | ❌ | ✅ |
| I18n support | ❌ | ❌ | ✅ |
Comment on lines +819 to +825
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this?

In react-webpack-rails-tutorial we demonstrate many of these items use react_on_rails.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting the PR message:

I'm not sure about what's free in react-on-rails. Can you confirm the table is right?

I only guessed from what's said in the website:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification.

An older comparison between features offered by react-rails and react_on_rails can be found on react_on_rails official docs: Shakapacker (Rails/Webpacker) React Integration Options

I close the PR for now. You can update the PR with more solid references so we can review it again.

Thanks for your PR.


`react_on_rails` offers better performance and bundle optimizations, especially with the option of getting a subscription to `react_on_rails_pro`.

Expand Down