From 5a69693841c1f2fa02f7bf6f30eb149b50bf65c1 Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 3 Nov 2017 22:11:42 +0000 Subject: [PATCH 01/13] Cleanup sections of readme. WIP Doc --- README.md | 134 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 77 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index ddc03b0d9..9f5ec343b 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,39 @@ # react-rails [![Gem](https://img.shields.io/gem/v/react-rails.svg?style=flat-square)](http://rubygems.org/gems/react-rails) +[![npm](https://img.shields.io/npm/v/react_ujs.svg)](https://www.npmjs.com/package/react_ujs) [![Build Status](https://img.shields.io/travis/reactjs/react-rails/master.svg?style=flat-square)](https://travis-ci.org/reactjs/react-rails) [![Gemnasium](https://img.shields.io/gemnasium/reactjs/react-rails.svg?style=flat-square)](https://gemnasium.com/reactjs/react-rails) [![Code Climate](https://img.shields.io/codeclimate/github/reactjs/react-rails.svg?style=flat-square)](https://codeclimate.com/github/reactjs/react-rails) -[![Test Coverage](https://img.shields.io/codeclimate/coverage/github/reactjs/react-rails.svg?style=flat-square)](https://codeclimate.com/github/reactjs/react-rails/coverage) -Gem version 2.4.x onwards and master will no longer have React Addons. +React-Rails makes it easy to use [React](http://facebook.github.io/react/) and [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) in your Ruby on Rails (3.2 to 5+) application. -If you need to make changes for the prebundled react, see the migration docs here: -https://reactjs.org/blog/2016/11/16/react-v15.4.0.html -https://reactjs.org/blog/2017/04/07/react-v15.5.0.html -https://reactjs.org/blog/2017/06/13/react-v15.6.0.html - -`react-rails` makes it easy to use [React](http://facebook.github.io/react/) and [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) in your Ruby on Rails (3.2+) application. Learn more: +Automatic Server-side Rendering (SSR) with **Webpacker** 3+ down to 1.1 support! +## Learn more - React's [Getting Started guide](https://facebook.github.io/react/docs/getting-started.html) -- Use React & JSX [with Webpacker](#use-with-webpacker) or [with the asset pipeline](#use-with-asset-pipeline) -- Rendering [components in views](#view-helper) or [in controller actions](#controller-actions) -- [Server-side rendering](#server-side-rendering) +- Use React & JSX [with Webpacker](#get-started-with-webpacker) + - or [with the asset pipeline](#use-with-asset-pipeline) +- [Rendering components in views](#view-helper) + - or [Render directly in controller actions](#controller-actions) - [Generating components](#component-generator) in various formats -- [`ReactRailsUJS`](#ujs) for mounting and unmounting components - Automatically [camelizing props](#camelize-props) +- [Server-side rendering](#server-side-rendering) +- [`ReactRailsUJS`](#ujs) for mounting and unmounting components +- [Upgrading](#upgrading) 2.3 to 2.4 - [Related Projects](#related-projects) -- [Developing](#development) the gem +- [Contribute to](#contributing) the gem -## Installation +## Get started with Webpacker -Install from Rubygems as `react-rails`. +[or Get started with Sprockets](#use-with-asset-pipeline) -```ruby -gem "react-rails" -``` +[Webpacker](https://github.com/rails/webpacker) integrates modern JS tooling with Rails. -Get started with `rails g react:install`: - -``` -$ rails g react:install -``` - -## Use with Webpacker - -[Webpacker](https://github.com/rails/webpacker) integrates modern JS tooling with Rails. `ReactRailsUJS` allows you to gradually migrate to Webpacker. - -Get started by adding `webpacker` to your gemfile and installing `webpacker` and `react-rails`: +Add `webpacker` and `react-rails` to your gemfile and run the installers: ``` +$ bundle install $ rails webpacker:install $ rails webpacker:install:react $ rails generate react:install @@ -57,7 +45,15 @@ This gives you: - [`ReactRailsUJS`](#ujs) setup in `app/javascript/packs/application.js` - `app/javascript/packs/server_rendering.js` for [server-side rendering](#server-side-rendering) -When you add a component to `app/javascript/components/`, you can [render it in a Rails view](#view-helper): +Generate your first component: + +``` +$ rails g react:component HelloWorld greeting:string +``` + +Your component is added to `app/javascript/components/` by default. + +[Render it in a Rails view](#view-helper): ```erb <%= react_component("HelloWorld", { greeting: "Hello" }) %> @@ -74,8 +70,6 @@ The component name tells `react-rails` where to load the component. For example: This way, you can access top-level, default, or named exports. -If `require` fails, `react-rails` falls back to the global namespace approach described in [Use with Asset Pipeline](#use-with-asset-pipeline). - The `require.context` inserted into `packs/application.js` is used to load components. If you want to load components from a different directory, override it by calling `ReactRailsUJS.useContext`: ```js @@ -85,7 +79,12 @@ var ReactRailsUJS = require("react_ujs") ReactRailsUJS.useContext(myCustomContext) ``` -### Gotcha: Capitalization +If `require` fails to find your component, [`ReactRailsUJS`](#ujs) falls back to the global namespace, described in [Use with Asset Pipeline](#use-with-asset-pipeline). + +### File naming + +React-Rails supports plenty of file extensions such as: .js, .jsx.js, .js.jsx, .es6.js, .coffee, etcetera! +Sometimes this will cause a stumble when searching for filenames. Component File Name | `react_component` call -----|----- @@ -97,7 +96,7 @@ Component File Name | `react_component` call ## Use with Asset Pipeline -`react-rails` provides React.js & a UJS driver to the Rails asset pipeline. Get started by installing: +`react-rails` provides a pre-bundled React.js & a UJS driver to the Rails asset pipeline. Get started by installing: ``` $ rails g react:install @@ -113,7 +112,7 @@ This will: Now, you can create React components in `.jsx` files: -```js +```JSX // app/assets/javascripts/components/post.jsx window.Post = createReactClass({ @@ -171,7 +170,7 @@ MyApp::Application.configure do end ``` -Be sure to restart your Rails server after changing these files. See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/master/VERSIONS.md) to learn which version of React.js is included with your `react-rails` version. +Be sure to restart your Rails server after changing these files. See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/master/VERSIONS.md) to learn which version of React.js is included with your `react-rails` version. In some edge cases you may need to bust the sprockets cache with `rake tmp:clear` ## View Helper @@ -402,7 +401,7 @@ rails g react:component Post title:string published:bool published_by:instanceOf would generate: -```js +```JSX var Post = createReactClass({ propTypes: { title: PropTypes.string, @@ -480,29 +479,50 @@ You can also specify this option in `react_component`: <%= react_component('HelloMessage', {name: 'John'}, {camelize_props: true}) %> ``` -## Related Projects +## Upgrading -- [react\_on\_rails Gem](https://github.com/shakacode/react_on_rails): Integration of React with Rails utilizing Webpack, Babel, React, Redux, React-Router. -- [Ruby Hyperloop](http://ruby-hyperloop.org/): Use Ruby to build reactive user interfaces with React. -- [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) is a simple live-reloader for `react-rails`. -- [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering. -- [The Free React on Rails Course](https://learnetto.com/users/hrishio/courses/the-free-react-on-rails-5-course) A free video course which teaches the basics of React and how to get started using it in Rails with `react-rails`. +### 2.3 to 2.4 -## Development +React-Rails 2.4.x uses React 16+ which no longer has React Addons. Therefore the pre-bundled version of react no longer has an addons version, if you need addons still, there is the 2.3.1+ version of the gem that still has addons. -- Run tests with `rake test` or `appraisal rake test` +If you need to make changes for the prebundled react, see the migration docs here: + +- https://reactjs.org/blog/2016/11/16/react-v15.4.0.html +- https://reactjs.org/blog/2017/04/07/react-v15.5.0.html +- https://reactjs.org/blog/2017/06/13/react-v15.6.0.html + + +For the vast majority this will get you most of the migration: +- global find+replace `React.Prop` -> `Prop` +- add `import PropTypes from 'prop-types'` (Webpacker only) +- re-run `bundle exec rails webpacker:install:react` to update npm packages (Webpacker only) + +## Contributing + +We have a [Code of Conduct]() that you need to follow. +You can always help by submitting patches or triaging issues, even offering reproduction steps to issues is incredibly helpful! + +### Running tests +`rake test` or `bundle exec appraisal rake test` runs everything. +or run a specific suite using `bundle exec appraisal rake test` - Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows) - ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that ๐Ÿ‘ -- Update React assets with `rake react:update` + +### Updating the pre-bundled react +- Update React with `rake react:update` +It outputs an ironically webpacked couple of files into `lib/assets/react-source//react(-server).js` where it will be picked up by `sprockets` in `lib/react/rails/asset_variant.rb` + +### Updating ReactRailsUJS - Update the UJS with `rake ujs:update` -- Releases: - - To release a new RubyGems version: - - Increment the version in `lib/react/rails/version.rb` - - Add an entry to `VERSIONS.md` - - Update the changelog (find recent changes on GitHub by listing commits or showing closed PRs) - - Commit changes & push to master - - `bundle exec rake release`: pushes a tag to GitHub, builds a `.gem`, and pushes to RubyGems - - To release a new NPM version: - - Update the version in `react_ujs/package.json` - - Commit & push to master - - `bundle exec rake ujs:publish` (runs `npm publish`) +- To release a new NPM version: + - Update the version in `react_ujs/package.json` + - Commit & push to master + - `bundle exec rake ujs:publish` (runs `npm publish`) + +### Releasing the Gem +- To release a new RubyGems version: + - Increment the version in `lib/react/rails/version.rb` + - Add an entry to `VERSIONS.md` + - Update the changelog (find recent changes on GitHub by listing commits or showing closed PRs) + - Commit changes & push to master + - `bundle exec rake release`: pushes a tag to GitHub, builds a `.gem`, and pushes to RubyGems From ffa81f652bd3e643f5defd43d9c323e61b9685ef Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 3 Nov 2017 16:33:14 +0000 Subject: [PATCH 02/13] Use Hydrate clientside New deprecation in React 16, hydrate should be used client side. https://reactjs.org/blog/2017/09/26/react-v16.0.html#new-deprecations --- lib/assets/javascripts/react_ujs.js | 2 +- react_ujs/dist/react_ujs.js | 2 +- react_ujs/index.js | 2 +- yarn.lock | 47 ++++++++++++++++++----------- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/lib/assets/javascripts/react_ujs.js b/lib/assets/javascripts/react_ujs.js index 6ba57b427..2500098ad 100644 --- a/lib/assets/javascripts/react_ujs.js +++ b/lib/assets/javascripts/react_ujs.js @@ -315,7 +315,7 @@ var ReactRailsUJS = { } throw new Error(message + ". Make sure your component is available to render.") } else { - ReactDOM.render(React.createElement(constructor, props), node); + ReactDOM.hydrate(React.createElement(constructor, props), node); } } }, diff --git a/react_ujs/dist/react_ujs.js b/react_ujs/dist/react_ujs.js index 6ba57b427..2500098ad 100644 --- a/react_ujs/dist/react_ujs.js +++ b/react_ujs/dist/react_ujs.js @@ -315,7 +315,7 @@ var ReactRailsUJS = { } throw new Error(message + ". Make sure your component is available to render.") } else { - ReactDOM.render(React.createElement(constructor, props), node); + ReactDOM.hydrate(React.createElement(constructor, props), node); } } }, diff --git a/react_ujs/index.js b/react_ujs/index.js index 29e79dad9..4b7a82a35 100644 --- a/react_ujs/index.js +++ b/react_ujs/index.js @@ -90,7 +90,7 @@ var ReactRailsUJS = { } throw new Error(message + ". Make sure your component is available to render.") } else { - ReactDOM.render(React.createElement(constructor, props), node); + ReactDOM.hydrate(React.createElement(constructor, props), node); } } }, diff --git a/yarn.lock b/yarn.lock index 31d83b811..75e2442da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,8 +17,8 @@ acorn@^4.0.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" acorn@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7" + version "5.2.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" ajv-keywords@^1.1.1: version "1.5.1" @@ -76,8 +76,8 @@ array-unique@^0.2.1: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" asn1.js@^4.0.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40" + version "4.9.2" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" dependencies: bn.js "^4.0.0" inherits "^2.0.1" @@ -181,8 +181,8 @@ brorand@^1.0.1: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.0.8" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.8.tgz#c8fa3b1b7585bb7ba77c5560b60996ddec6d5309" + version "1.1.1" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -379,8 +379,8 @@ cryptiles@2.x.x: boom "2.x.x" crypto-browserify@^3.11.0: - version "3.11.1" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.1.tgz#948945efc6757a400d6e5e5af47194d10064279f" + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" dependencies: browserify-cipher "^1.0.0" browserify-sign "^4.0.0" @@ -392,6 +392,7 @@ crypto-browserify@^3.11.0: pbkdf2 "^3.0.3" public-encrypt "^4.0.0" randombytes "^2.0.0" + randomfill "^1.0.3" dashdash@^1.12.0: version "1.14.1" @@ -432,6 +433,10 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" +detect-libc@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.2.tgz#71ad5d204bf17a6a6ca8f450c61454066ef461e1" + diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -768,8 +773,8 @@ is-binary-path@^1.0.0: binary-extensions "^1.0.0" is-buffer@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" is-builtin-module@^1.0.0: version "1.0.0" @@ -1055,9 +1060,10 @@ node-libs-browser@^2.0.0: vm-browserify "0.0.4" node-pre-gyp@^0.6.36: - version "0.6.38" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.38.tgz#e92a20f83416415bb4086f6d1fb78b3da73d113d" + version "0.6.39" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" dependencies: + detect-libc "^1.0.2" hawk "3.1.3" mkdirp "^0.5.1" nopt "^4.0.1" @@ -1282,15 +1288,22 @@ randomatic@^1.1.3: is-number "^3.0.0" kind-of "^4.0.0" -randombytes@^2.0.0, randombytes@^2.0.1: +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79" dependencies: safe-buffer "^5.1.0" +randomfill@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.3.tgz#b96b7df587f01dd91726c418f30553b1418e3d62" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + rc@^1.1.7: - version "1.2.1" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" + version "1.2.2" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" dependencies: deep-extend "~0.4.0" ini "~1.3.0" @@ -1544,8 +1557,8 @@ tapable@^0.2.7, tapable@~0.2.5: resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" tar-pack@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + version "3.4.1" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" dependencies: debug "^2.2.0" fstream "^1.0.10" From 799941b510c2b6159b6f6c9931fad46c1aa0cbff Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 3 Nov 2017 21:38:11 +0000 Subject: [PATCH 03/13] Update versions, add myself to authors list --- package.json | 2 +- react-rails.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 431ee3f45..1e0988bab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react_ujs", - "version": "2.4.0", + "version": "2.4.1", "description": "Rails UJS for the react-rails gem", "main": "react_ujs/index.js", "files": [ diff --git a/react-rails.gemspec b/react-rails.gemspec index 352d447f7..4880ca2bb 100644 --- a/react-rails.gemspec +++ b/react-rails.gemspec @@ -11,8 +11,8 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/reactjs/react-rails' s.license = 'Apache-2.0' - s.author = ['Paul Oโ€™Shannessy', 'Robert Mosolgo'] - s.email = ['paul@oshannessy.com', 'rmosolgo@gmail.com'] + s.author = ['Paul Oโ€™Shannessy', 'Robert Mosolgo', 'Gregory Myers'] + s.email = ['paul@oshannessy.com', 'rmosolgo@gmail.com', 'neonmd@hotmail.co.uk'] s.add_development_dependency 'appraisal' s.add_development_dependency 'bundler', '>= 1.2.2' From 4721ff1df9edd0c4bf828597c9dfd1842fdfbce4 Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 3 Nov 2017 23:06:12 +0000 Subject: [PATCH 04/13] Update react_ujs to 2.4.1 --- package.json | 3 +++ yarn.lock | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index 1e0988bab..44d94872b 100644 --- a/package.json +++ b/package.json @@ -12,5 +12,8 @@ }, "devDependencies": { "webpack": "^2.3.3" + }, + "dependencies": { + "react_ujs": "^2.4.1" } } diff --git a/yarn.lock b/yarn.lock index 75e2442da..8ff1893e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1310,6 +1310,10 @@ rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +react_ujs@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/react_ujs/-/react_ujs-2.4.1.tgz#a0a9c83c258fe945a797b716e07a8f091d194e51" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" From 761179b4e868341b2a0ffd8d33bd4b377d5cbbbf Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 3 Nov 2017 23:45:37 +0000 Subject: [PATCH 05/13] Add Contributing guide, Code Of Conduct Also use doctoc for table of contents in readme Readme updated to reference other docs and looks cleaner Update Docs --- CODE_OF_CONDUCT.md | 46 ++++++++++++++ CONTRIBUTING.md | 153 +++++++++++++++++++++++++++++++++++++++++++++ ISSUE_TEMPLATE.md | 2 +- README.md | 81 +++++++++++++++--------- 4 files changed, 253 insertions(+), 29 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..87cde5da6 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at neonmd@hotmail.co.uk. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..10497d484 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,153 @@ +# Contributing to React-Rails + +๐ŸŽ‰ Thanks for taking the time to contribute! ๐ŸŽ‰ + +With 2 Million+ downloads of the react-rails Gem and another 100k+ downloads of react_ujs on NPM, you're helping the biggest React + Rails community! + +What follows is a set of guidelines for contributing to React-Rails, inside the [react-js Organization](https://github.com/reactjs), part of the wider [React Community](https://reactcommunity.org/) + +By contributing to React-Rails, you agree to abide by the [code of conduct](https://github.com/reactjs/react-rails/blob/master/CODE_OF_CONDUCT.md). + + + + + +- [How Can I Contribute?](#how-can-i-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Before Submitting A Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a-good-bug-report) + - [Your First Code Contribution](#your-first-code-contribution) + - [Pull Requests](#pull-requests) + - [Development](#development) + - [Local dev](#local-dev) + - [Running tests](#running-tests) + - [Updating the pre-bundled react](#updating-the-pre-bundled-react) + - [Updating ReactRailsUJS](#updating-reactrailsujs) + - [Releasing the Gem](#releasing-the-gem) +- [Styleguides](#styleguides) + - [Git Commit Messages](#git-commit-messages) + - [Ruby styleguide](#ruby-styleguide) +- [Issue and Pull Request Labels](#issue-and-pull-request-labels) + + + +## How Can I Contribute? + +### Reporting Bugs + +#### Before Submitting A Bug Report +* **Check the [wiki](https://github.com/reactjs/react-rails/wiki).** You might be able to find a guide on what you're experiencing. Most importantly, check if you can reproduce the problem [in the latest version of React-Rails with React_ujs](https://github.com/reactjs/react-rails/tree/master), sometimes we have already fixed the issue. +* **Perform a [cursory search](https://github.com/reactjs/react-rails/issues)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. If **the issue is closed** open a new issue with reproduction steps and reference the old one. +* **If the problem is with pre-rendering, turn off pre-rendering and look at Chrome's developer console**, that normally reveals more details about what the true error message is if it's a syntax error in a component or failing to require a component file. + +#### How Do I Submit A (Good) Bug Report? +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). +Create an issue and provide the following information by filling in [the template](ISSUE_TEMPLATE.md). + +Explain the problem and include additional details to help maintainers reproduce the problem: + +* **Use a clear and descriptive title** for the issue to identify the problem. +* **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you did, but explain how you did it**. For example, If you're using Browserify instead of Webpacker, how did you do it? +* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, Gists, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). +* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. +* **Explain which behavior you expected to see instead and why.** +* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. + +Include details about your configuration and environment, React-Rails integrates many tools, versions of many things could be the culprit, though we try test as many as reasonable in our [Travis Build](.travis.yml) + +* **Which version of React-Rails are you using?** +* **Which version of React_UJS are you using?** +* **Which version of Webpacker/Sprockets are you using?** +* **Which version of Rails are you using?** + +### Your First Code Contribution + +Unsure where to begin contributing to React-Rails? You can start by looking through these `help-wanted` issues: + +* [Help wanted issues][help-wanted] + +This issue list is sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have. + +#### Pull Requests + +See [git commit message style](#git-commit-messages) + +* Fill in [the required template](PULL_REQUEST_TEMPLATE.md) +* Do not include issue numbers in the PR title +* Include screenshots and animated GIFs in your pull request whenever possible. +* Follow the [styleguides](#styleguides) where possible but readability is the most important! +* Include intention-revealing [Minitest](https://github.com/seattlerb/minitest) tests in the `./test` folder. It's important people know *why* a test exists by reading it more than *what* it does, we can read the source for the *what*. +* Document new code where you're able. + +#### Development + +##### Local dev + +Clone down the [react-rails-example-app](https://github.com/bookofgreg/react-rails-example-app), it has several branches for different scenarios. It's designed to contain very simple examples of each feature of React-Rails. + +To develop Ruby code, change the Gemfile to point to a local copy of react-rails. +``` +gem 'react-rails', path: '../react-rails' +``` + +To develop the React_UJS NPM Package, make your changes and run `npm pack` to make a `.tgz` bundle, then in react-rails-example-app `yarn add ../react_ujs-.tgz` + +##### Running tests + +`bundle exec appraisal install` to install gems on every gemfile Appraisal contains. +`rake test` or `bundle exec appraisal rake test` runs everything. +or run a specific suite using `bundle exec appraisal rake test` +- Find appraisal names in [Appraisals](Appraisals) +- Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows) +- ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that ๐Ÿ‘ + +##### Updating the pre-bundled react +- Update React with `rake react:update` +It outputs an ironically webpacked couple of files into `lib/assets/react-source//react(-server).js` where it will be picked up by `sprockets` in `lib/react/rails/asset_variant.rb` + +##### Updating ReactRailsUJS +- Update the UJS with `rake ujs:update` +- (For Maintainers) To release a new NPM version: + - Update the version in `react_ujs/package.json` + - Commit & push to master + - `bundle exec rake ujs:publish` (runs `npm publish`) + +##### Releasing the Gem +- (For Maintainers) To release a new RubyGems version: + - Increment the version in `lib/react/rails/version.rb` + - Add an entry to `VERSIONS.md` + - Update the [changelog](CHANGELOG.md) (find recent changes on GitHub by listing commits or showing closed PRs) + - Commit changes & push to master + - `bundle exec rake release`: pushes a tag to GitHub, builds a `.gem`, and pushes to RubyGems + +## Styleguides + +### Git Commit Messages + +* Use the present tense ("Add feature" not "Added feature") +* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") +* Limit the first line to 72 characters or less +* Reference issues and pull requests liberally after the first line +* * When only changing documentation, include `[ci skip]` in the [commit description](https://docs.travis-ci.com/user/customizing-the-build/#Skipping-a-build) so we don't waste Travis's Open source resources. +* Consider starting the commit message with an applicable emoji: + * :art: `:art:` when improving the format/structure of the code + * :racehorse: `:racehorse:` when improving performance + * :memo: `:memo:` when writing docs + * :bug: `:bug:` when fixing a bug + * :fire: `:fire:` when removing code or files + * :green_heart: `:green_heart:` when fixing the CI build + * :white_check_mark: `:white_check_mark:` when adding tests + * :lock: `:lock:` when dealing with security + * :arrow_up: `:arrow_up:` when upgrading dependencies + * :arrow_down: `:arrow_down:` when downgrading dependencies + * :shirt: `:shirt:` when removing linter warnings + +### Ruby styleguide + +Ruby Style in this repo should attempt to follow the standard ruby styles as defined in `Rubocop`. This is more of a guide than a rule so use common sense, readability is more important than the style guide! + +## Issue and Pull Request Labels + +Todo + +Finally, thanks to the [Atom Organization](https://github.com/atom) where this Contributing guide is based! :heart: :green_heart: diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 03ba44fcc..8a93580d0 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ -Help us help you! Please choose one: +Help us help you! Have you looked for similar issues? Do you have reproduction steps? [Contributing Guide](CONTRIBUTING.md#reporting-bugs) - [ ] My app crashes with `react-rails`, so I've included the stack trace and the exact steps which make it crash. - [ ] My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior. diff --git a/README.md b/README.md index 9f5ec343b..4ec98f083 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,40 @@ React-Rails makes it easy to use [React](http://facebook.github.io/react/) and [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) in your Ruby on Rails (3.2 to 5+) application. -Automatic Server-side Rendering (SSR) with **Webpacker** 3+ down to 1.1 support! +Automatic Server-side Rendering (SSR) for SEO benefits with **Webpacker** 1.1 to 3+ and Sprockets 2 to 4 support! + +Example app code available here: https://github.com/BookOfGreg/react-rails-example-app + + + + + +- [Learn more](#learn-more) +- [Get started with Webpacker](#get-started-with-webpacker) + - [File naming](#file-naming) +- [Use with Asset Pipeline](#use-with-asset-pipeline) + - [Custom JSX Transformer](#custom-jsx-transformer) + - [React.js versions](#reactjs-versions) +- [View Helper](#view-helper) + - [Custom View Helper](#custom-view-helper) +- [UJS](#ujs) + - [Mounting & Unmounting](#mounting--unmounting) + - [Event Handling](#event-handling) + - [`getConstructor`](#getconstructor) +- [Server-Side Rendering](#server-side-rendering) + - [Configuration](#configuration) + - [JavaScript State](#javascript-state) + - [Custom Server Renderer](#custom-server-renderer) +- [Controller Actions](#controller-actions) +- [Component Generator](#component-generator) + - [Use with JBuilder](#use-with-jbuilder) + - [Camelize Props](#camelize-props) +- [Upgrading](#upgrading) + - [2.3 to 2.4](#23-to-24) +- [Related Projects](#related-projects) +- [Contributing](#contributing) + + ## Learn more - React's [Getting Started guide](https://facebook.github.io/react/docs/getting-started.html) @@ -483,46 +516,38 @@ You can also specify this option in `react_component`: ### 2.3 to 2.4 +Keep your `react_ujs` up to date, `yarn upgrade` + React-Rails 2.4.x uses React 16+ which no longer has React Addons. Therefore the pre-bundled version of react no longer has an addons version, if you need addons still, there is the 2.3.1+ version of the gem that still has addons. -If you need to make changes for the prebundled react, see the migration docs here: +If you need to make changes in your components for the prebundled react, see the migration docs here: - https://reactjs.org/blog/2016/11/16/react-v15.4.0.html - https://reactjs.org/blog/2017/04/07/react-v15.5.0.html - https://reactjs.org/blog/2017/06/13/react-v15.6.0.html -For the vast majority this will get you most of the migration: +For the vast majority of cases this will get you most of the migration: - global find+replace `React.Prop` -> `Prop` - add `import PropTypes from 'prop-types'` (Webpacker only) - re-run `bundle exec rails webpacker:install:react` to update npm packages (Webpacker only) +## Related Projects + +- [webpacker-react](https://github.com/renchap/webpacker-react): Integration of React with Rails utilizing Webpack with Hot Module Replacement (HMR). +- [react\_on\_rails](https://github.com/shakacode/react_on_rails): Integration of React with Rails utilizing Webpack, Redux, React-Router. +- [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) Simple live-reloader for `react-rails`. +- [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering. +- [Ruby Hyperloop](http://ruby-hyperloop.org/): Use Ruby to build reactive user interfaces with React. + ## Contributing -We have a [Code of Conduct]() that you need to follow. +๐ŸŽ‰ Thanks for taking the time to contribute! ๐ŸŽ‰ + +With 2 Million+ downloads of the react-rails Gem and another 100k+ downloads of react_ujs on NPM, you're helping the biggest React + Rails community! + +By contributing to React-Rails, you agree to abide by the [code of conduct](https://github.com/reactjs/react-rails/blob/master/CODE_OF_CONDUCT.md). + You can always help by submitting patches or triaging issues, even offering reproduction steps to issues is incredibly helpful! -### Running tests -`rake test` or `bundle exec appraisal rake test` runs everything. -or run a specific suite using `bundle exec appraisal rake test` - - Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows) - - ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that ๐Ÿ‘ - -### Updating the pre-bundled react -- Update React with `rake react:update` -It outputs an ironically webpacked couple of files into `lib/assets/react-source//react(-server).js` where it will be picked up by `sprockets` in `lib/react/rails/asset_variant.rb` - -### Updating ReactRailsUJS -- Update the UJS with `rake ujs:update` -- To release a new NPM version: - - Update the version in `react_ujs/package.json` - - Commit & push to master - - `bundle exec rake ujs:publish` (runs `npm publish`) - -### Releasing the Gem -- To release a new RubyGems version: - - Increment the version in `lib/react/rails/version.rb` - - Add an entry to `VERSIONS.md` - - Update the changelog (find recent changes on GitHub by listing commits or showing closed PRs) - - Commit changes & push to master - - `bundle exec rake release`: pushes a tag to GitHub, builds a `.gem`, and pushes to RubyGems +Please see our [Contribution guide](https://github.com/reactjs/react-rails/blob/master/CONTRIBUTING.md) for more info. From 067779f8c8731d3613751483c2dec530eea302f4 Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:06:09 +0000 Subject: [PATCH 06/13] Try to make the intro more informative --- README.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4ec98f083..4e3c14235 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,18 @@ -# react-rails +# React-Rails [![Gem](https://img.shields.io/gem/v/react-rails.svg?style=flat-square)](http://rubygems.org/gems/react-rails) -[![npm](https://img.shields.io/npm/v/react_ujs.svg)](https://www.npmjs.com/package/react_ujs) +[![npm](https://img.shields.io/npm/v/react_ujs.svg?style=flat-square)](https://www.npmjs.com/package/react_ujs) [![Build Status](https://img.shields.io/travis/reactjs/react-rails/master.svg?style=flat-square)](https://travis-ci.org/reactjs/react-rails) [![Gemnasium](https://img.shields.io/gemnasium/reactjs/react-rails.svg?style=flat-square)](https://gemnasium.com/reactjs/react-rails) [![Code Climate](https://img.shields.io/codeclimate/github/reactjs/react-rails.svg?style=flat-square)](https://codeclimate.com/github/reactjs/react-rails) + +React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. It: +* Automatically renders React server-side and client-side +* Supports Webpacker 3.x, 2.x, 1.1+ +* Supports Sprockets 4.x, 3.x, 2.x +* Lets you use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](), [Coffeescript]() + React-Rails makes it easy to use [React](http://facebook.github.io/react/) and [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) in your Ruby on Rails (3.2 to 5+) application. Automatic Server-side Rendering (SSR) for SEO benefits with **Webpacker** 1.1 to 3+ and Sprockets 2 to 4 support! @@ -16,7 +23,6 @@ Example app code available here: https://github.com/BookOfGreg/react-rails-examp -- [Learn more](#learn-more) - [Get started with Webpacker](#get-started-with-webpacker) - [File naming](#file-naming) - [Use with Asset Pipeline](#use-with-asset-pipeline) @@ -43,19 +49,11 @@ Example app code available here: https://github.com/BookOfGreg/react-rails-examp -## Learn more -- React's [Getting Started guide](https://facebook.github.io/react/docs/getting-started.html) -- Use React & JSX [with Webpacker](#get-started-with-webpacker) - - or [with the asset pipeline](#use-with-asset-pipeline) -- [Rendering components in views](#view-helper) - - or [Render directly in controller actions](#controller-actions) -- [Generating components](#component-generator) in various formats -- Automatically [camelizing props](#camelize-props) -- [Server-side rendering](#server-side-rendering) -- [`ReactRailsUJS`](#ujs) for mounting and unmounting components -- [Upgrading](#upgrading) 2.3 to 2.4 -- [Related Projects](#related-projects) -- [Contribute to](#contributing) the gem + +The React-Rails Wiki has lots of additional information about React-Rails including many "how-to" articles and answers to the most frequently asked questions. Please browse the Wiki after finishing this README: + +https://github.com/reactjs/React-Rails/wiki + ## Get started with Webpacker From c1d6ac1f13665173fc6717bd914a179ae3a526cf Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:08:39 +0000 Subject: [PATCH 07/13] Contents heading to break up page --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e3c14235..b26a5dc16 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Example app code available here: https://github.com/BookOfGreg/react-rails-examp - +## Contents - [Get started with Webpacker](#get-started-with-webpacker) - [File naming](#file-naming) From a7256a00045faf7c081dae175218ef76c20d25e5 Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:09:32 +0000 Subject: [PATCH 08/13] Complete some links --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index b26a5dc16..0144bdcbc 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,7 @@ React-Rails is a flexible tool to use [React](http://facebook.github.io/react/) * Automatically renders React server-side and client-side * Supports Webpacker 3.x, 2.x, 1.1+ * Supports Sprockets 4.x, 3.x, 2.x -* Lets you use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](), [Coffeescript]() - -React-Rails makes it easy to use [React](http://facebook.github.io/react/) and [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) in your Ruby on Rails (3.2 to 5+) application. - -Automatic Server-side Rendering (SSR) for SEO benefits with **Webpacker** 1.1 to 3+ and Sprockets 2 to 4 support! +* Lets you use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](http://es6-features.org/), [Coffeescript](http://coffeescript.org/) Example app code available here: https://github.com/BookOfGreg/react-rails-example-app From 3958670e70488cee032bab50dbd515f5ebfb37e3 Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:26:13 +0000 Subject: [PATCH 09/13] Move Github templates to .github folder --- ISSUE_TEMPLATE.md => .github/ISSUE_TEMPLATE.md | 0 .github/PULL_REQUEST_TEMPLATE.md | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) rename ISSUE_TEMPLATE.md => .github/ISSUE_TEMPLATE.md (100%) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..23e6177b5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +### Summary + +Provide a general description of the code changes in your pull +request... were there any bugs you had fixed? If so, mention them. If +these bugs have open GitHub issues, be sure to tag them here as well, +to keep the conversation linked together. + +### Other Information + +If there's anything else that's important and relevant to your pull +request, mention that information here. This could include +benchmarks, or other information. + +If you are updating any of the CHANGELOG files or are asked to update the +CHANGELOG files by reviewers, please add the CHANGELOG entry at the top of the file. + +Thanks for contributing! From 41b0d791717e04b246eaa7f98163464eb978eb46 Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:27:29 +0000 Subject: [PATCH 10/13] Update links to templates --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10497d484..492349604 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ By contributing to React-Rails, you agree to abide by the [code of conduct](http #### How Do I Submit A (Good) Bug Report? Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). -Create an issue and provide the following information by filling in [the template](ISSUE_TEMPLATE.md). +Create an issue and provide the following information by filling in [the template](.github/ISSUE_TEMPLATE.md). Explain the problem and include additional details to help maintainers reproduce the problem: @@ -72,7 +72,7 @@ This issue list is sorted by total number of comments. While not perfect, number See [git commit message style](#git-commit-messages) -* Fill in [the required template](PULL_REQUEST_TEMPLATE.md) +* Fill in [the required template](.github/PULL_REQUEST_TEMPLATE.md) * Do not include issue numbers in the PR title * Include screenshots and animated GIFs in your pull request whenever possible. * Follow the [styleguides](#styleguides) where possible but readability is the most important! From b68e7e3a9fc5c5d4853209021f64aebaaa0c149e Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:30:21 +0000 Subject: [PATCH 11/13] Update Help Wanted link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 492349604..297fbf94f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ Include details about your configuration and environment, React-Rails integrates Unsure where to begin contributing to React-Rails? You can start by looking through these `help-wanted` issues: -* [Help wanted issues][help-wanted] +* [Help wanted issues](https://github.com/reactjs/react-rails/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) This issue list is sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have. From 16f6fc5ac500e7cb257887eaaadd35d802ae3f4a Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 4 Nov 2017 12:34:18 +0000 Subject: [PATCH 12/13] Bring back Learnetto link #664 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0144bdcbc..be9d02b32 100644 --- a/README.md +++ b/README.md @@ -529,6 +529,7 @@ For the vast majority of cases this will get you most of the migration: ## Related Projects - [webpacker-react](https://github.com/renchap/webpacker-react): Integration of React with Rails utilizing Webpack with Hot Module Replacement (HMR). +- [The Free React on Rails Course](https://learnetto.com/users/hrishio/courses/the-free-react-on-rails-5-course) A free video course which teaches the basics of React and how to get started using it in Rails with `react-rails`. - [react\_on\_rails](https://github.com/shakacode/react_on_rails): Integration of React with Rails utilizing Webpack, Redux, React-Router. - [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) Simple live-reloader for `react-rails`. - [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering. From 7bfe62b8822f8dc5b15321bc2de8b0cbd273801f Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Sat, 4 Nov 2017 13:31:26 +0000 Subject: [PATCH 13/13] Update ISSUE_TEMPLATE.md Borrow content from Rails' Issue template. It emphasizes reproduction. --- .github/ISSUE_TEMPLATE.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8a93580d0..484307f1c 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,9 +1,23 @@ Help us help you! Have you looked for similar issues? Do you have reproduction steps? [Contributing Guide](CONTRIBUTING.md#reporting-bugs) -- [ ] My app crashes with `react-rails`, so I've included the stack trace and the exact steps which make it crash. -- [ ] My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior. -- [ ] I'm trying to use `react-rails` with another library, but I'm having trouble. I've described my JavaScript management setup (eg, Sprockets, Webpack...), how I'm trying to use this other library, and why it's not working. -- [ ] I have another issue to discuss. +### Steps to reproduce + +(Guidelines for creating a bug report are [available +here](../CONTRIBUTING.md#reporting-bugs)) + +### Expected behavior +Tell us what should happen + +### Actual behavior +Tell us what happens instead + +### System configuration +**Sprockets or Webpacker version**: +**React-Rails version**: +**Rect_UJS version**: +**Rails version**: +**Ruby version**: + -------