All Projects → netguru → React_webpack_rails

netguru / React_webpack_rails

Licence: mit
Simple and lightweight react-webpack-rails integration.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to React webpack rails

Hyperstack
Hyperstack ALPHA https://hyperstack.org
Stars: ✭ 463 (+86.69%)
Mutual labels:  webpack, rails
Docker Rails React Starter
A basic docker-compose, Rails and React / Webpack starter kit
Stars: ✭ 52 (-79.03%)
Mutual labels:  webpack, rails
Kails
A Web App like Ruby on Rails with Koa2, Webpack and Postgres
Stars: ✭ 512 (+106.45%)
Mutual labels:  webpack, rails
Webpacker
Use Webpack to manage app-like JavaScript modules in Rails
Stars: ✭ 5,282 (+2029.84%)
Mutual labels:  webpack, rails
Vueport
Single file components for Rails with Vue JS and Webpack
Stars: ✭ 141 (-43.15%)
Mutual labels:  webpack, rails
Hyper React
The project has moved to Hyperstack!!
Stars: ✭ 295 (+18.95%)
Mutual labels:  webpack, rails
Vue Rails Form Builder Demo
An example of Rails app using vue-form-for gem
Stars: ✭ 12 (-95.16%)
Mutual labels:  webpack, rails
Kickoff tailwind
A rapid Rails 6 application template for personal use bundled with Tailwind CSS
Stars: ✭ 287 (+15.73%)
Mutual labels:  webpack, rails
Simpacker
Use modern JavaScript build system in Rails.
Stars: ✭ 100 (-59.68%)
Mutual labels:  webpack, rails
Npm Pipeline Rails
Use npm as part of your Rails asset pipeline
Stars: ✭ 93 (-62.5%)
Mutual labels:  webpack, rails
Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+362.5%)
Mutual labels:  webpack, rails
Webpacker React
Webpacker plugin to integrate React in your Rails application
Stars: ✭ 201 (-18.95%)
Mutual labels:  webpack, rails
Limestone
Boilerplate Rails 6 SaaS application with Webpack, Stimulus and Docker integration.
Stars: ✭ 191 (-22.98%)
Mutual labels:  webpack, rails
Docker Web Framework Examples
Example apps that demonstate how to use Docker with your favorite web frameworks.
Stars: ✭ 204 (-17.74%)
Mutual labels:  webpack, rails
Mercury
Mercury Editor: The Rails WYSIWYG editor that allows embedding full page editing capabilities directly inline.
Stars: ✭ 2,629 (+960.08%)
Mutual labels:  rails
Frontend Webpack Boilerplate
Simple starter webpack 5 project template supporting SASS/PostCSS, Babel ES7, browser syncing, code linting. Easy project setup having multiple features and developer friendly tools.
Stars: ✭ 242 (-2.42%)
Mutual labels:  webpack
Acts As Messageable
Gem that allows communication between the models.
Stars: ✭ 242 (-2.42%)
Mutual labels:  rails
Sample apps
Railsチュートリアルの各章が終わった状態を集めたリポジトリです。
Stars: ✭ 240 (-3.23%)
Mutual labels:  rails
Scenic
Scenic is maintained by Derek Prior, Caleb Hearth, and you, our contributors.
Stars: ✭ 2,856 (+1051.61%)
Mutual labels:  rails
Reset Css
An unmodified* copy of Eric Meyer's CSS reset. PostCSS, webpack, Sass, and Less friendly.
Stars: ✭ 244 (-1.61%)
Mutual labels:  webpack

ReactWebpackRails

Travis CI

!! DEPRECATED !!

Consider using Webpacker instead.

If you are looking for view helpers and/or redux integrations, see:

  1. react-rails (currently using webpacker)
  2. react-on-rails (migration to webpacker in progress, using forked version now)

Rails - Webpack setup with React integration.

This gem provides easy and convenient way to build modern JavaScript stack on top of Rails applications using Webpack and React.

Features

Plugins:

  • rwr-alt plugin that makes it possible to populate and share Alt stores between react component located in different parts of rails views.
  • rwr-redux allows to use redux state containers in a rails views.
  • rwr-react_router react-router integration.
  • rwr-view_helpers handy view helpers.

Installation

Add this line to your application's Gemfile:

gem 'react_webpack_rails'

Execute:

$ bundle

Then run installation:

$ rails g react_webpack_rails:install

read more about install generator

Babel

By default, react-webpack-rails uses Babel Stage 1 - Proposal. If you want to change the stage, you can do so in the .babelrc file. It is however not recommended to use Stage 0 in a production app, because the features present there can be dropped, which would break your application.

Usage

Check docs for detailed api description.

to use hot-reloading add partial in your application.html.erb to <body>:

(it's not needed when you want to use just webpack in watch mode without hot-reloading)

<%= render 'layouts/react_hot_assets' %>

Register component in index.js

import Component from './components/some-component';
RWR.registerComponent('customComponentName', Component);

Use it in rails view

<%= react_component('customComponentName', { user: User.last }) %>

Use it in javascript file

const element = $('#my-element');
RWR.renderComponent('customComponentName', {user_id: 1}, element);

Render component in controller

def action_name
  render react_component: 'customComponentName', props: { user_id: 1 }
end

Development environment

Run webpack in watch mode using script:

$ npm start

Run webpack in hot-auto-reloading mode using script (to use it you have to add react_hot_assets partial as mentioned before):

$ npm run start-hot-dev

If you are using server side render in components (it's enabled by default in generated example), run node server:

$ npm run rwr-node-dev-server

Production environment

Run webpack in production mode before compiling assets using script:

$ npm run build

If you are using server side render (it's enabled by default in generated example), run node server:

$ npm run rwr-node-server

Deployment

Check docs/deployment.md

Contributing

See the contribution guide.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].