{"id":15504507,"url":"https://github.com/alanbsmith/react-webpack-rails","last_synced_at":"2025-04-23T01:07:10.508Z","repository":{"id":56891247,"uuid":"58471125","full_name":"alanbsmith/react-webpack-rails","owner":"alanbsmith","description":"A simple tool for getting up and running with React-Webpack in Rails.","archived":false,"fork":false,"pushed_at":"2016-09-28T16:53:52.000Z","size":30,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T01:07:04.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanbsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-10T15:05:26.000Z","updated_at":"2017-07-23T11:29:16.000Z","dependencies_parsed_at":"2022-08-20T16:00:53.897Z","dependency_job_id":null,"html_url":"https://github.com/alanbsmith/react-webpack-rails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Freact-webpack-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Freact-webpack-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Freact-webpack-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Freact-webpack-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanbsmith","download_url":"https://codeload.github.com/alanbsmith/react-webpack-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250349053,"owners_count":21415914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:18:35.013Z","updated_at":"2025-04-23T01:07:10.491Z","avatar_url":"https://github.com/alanbsmith.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React::Webpack::Rails\nA simple installation tool for getting up and running with React + Webpack in Rails.\n\n_* This is still in the early stages of development, and is experimental. Feedback is appreciated, and pull requests are welcome._\n\n## OVERVIEW\nThis is a minimalist approach to integrating React and Webpack with Rails. There's nothing really hidden in the gem. The point is to be transparent about what is being added to your app and why.\n\nThere are several goals for this gem:\n\n* Provide a lightweight gem for integrating React and Webpack to Rails\n* Easy asset compiling for development and production\n* Fluid development workflow\n* Easy npm module integration\n* single step server for development\n* single asset compilation for deployment\n\n## INSTALLATION\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'react-webpack-rails'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install react-webpack-rails\n\n\n## GENERATOR TOOL\n_* not currently supporting HAML_\n\n$ rails g react:webpack:install\n\n### WHAT THIS GENERATES\n**EMPTY DIRECTORIES**\n* `client/components`\n* `app/assets/webpack`\n\n**BASE FILES**\n* `webpack.config.js`\n* `.babelrc`\n* `app/helpers/react_helper.rb`\n* `client/index.js`\n* `Procfile`\n* `lib/tasks/assets.rake`\n\n**GEMS**\n\n* `foreman`\n\n_* you can skip immediate installation_\n\n**NODE MODULES**\n\n* `babel-core`\n* `babel-loader`\n* `babel-preset-es2015`\n* `babel-preset-react`\n* `classnames`\n* `react`\n* `react-dom`\n* `webpack`\n\n_* you can skip immediate installation_\n\n**APPENDING WEBPACK WATCH TASK**\n* `\"watch\": \"webpack --watch --colors --progress\"`\n\n**APPENDING ASSETS INTO THE PIPELINE**\n* `javascript_include_tag` to `app/views/layouts/application.html.erb`\n* `Rails.application.config.assets.precompile += %w( bundle.js )` to `config/initializers/assets.rb`\n\n\n## DEVELOPMENT\nThe generator installs Foreman and adds a Procfile to fire up Webpack and the Rails server in a single command:\n\n    $ foreman start\n\nYou can also run these separately if you'd like.\n\n```\nnpm run watch\n```\n```\nrails server\n```\n\nIf everything went well, you should be able to view your app at http://localhost:3000\n\n You can add your components to `client/components/` and be sure to list them in `client/index.js`\n\nYou can call components in the view with an `erb` tag for your components and props: `\u003c%= react_component :Dropdown, listItems: [1,2,3,4] %\u003e`\n\n## PRODUCTION\nA rake task for precompiling the webpack assets is added by the generator. This essentially adds the Webpack/Babel transpiling to the precompilation task that runs when you deploy to production. So you should never need to have two separate build tasks.\n\n## CONTRIBUTING\n\nBug reports and pull requests are welcome on GitHub at https://github.com/alanbsmith/react-webpack-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## LICENSE\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanbsmith%2Freact-webpack-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanbsmith%2Freact-webpack-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanbsmith%2Freact-webpack-rails/lists"}