Skip to content

Commit 2b7cff0

Browse files
committed
Merge branch 'master' of https://github.com/reactjs/react-rails
2 parents 945f095 + e2b435d commit 2b7cff0

File tree

463 files changed

+47070
-25179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

463 files changed

+47070
-25179
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
*.gem
22
Gemfile.lock
33
*.log
4-
test/dummy/tmp
5-
test/dummy/public/packs
4+
test/*/tmp
5+
test/*/public/packs
66
gemfiles/*.lock
77
*.swp
88
/vendor/react

.rubocop.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
AllCops:
2+
TargetRubyVersion: 2.1
3+
DisplayCopNames: true
4+
Exclude:
5+
- test/dummy_sprockets/**/*
6+
- test/dummy_webpacker1/**/*
7+
- test/dummy_webpacker2/**/*
8+
- test/dummy_webpacker3/**/*
9+
- node_modules/**/*
10+
- react_ujs/**/*

.travis.yml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
language: ruby
22
sudo: required
33
dist: trusty
4+
addons:
5+
chrome: stable
46
cache:
57
bundler: true
68
yarn: true
79
rvm:
810
- 2.3.0
911
- 2.1
10-
- jruby-9.0.1.0
12+
- jruby-9.1.9.0
1113

1214
gemfile:
1315
# These have webpacker:
1416
- gemfiles/rails_4.2_sprockets_4.gemfile
15-
- gemfiles/rails_5_no_sprockets_webpacker.gemfile
17+
- gemfiles/rails_5_no_sprockets_webpacker_1_1.gemfile
18+
- gemfiles/rails_5_no_sprockets_webpacker_1_x.gemfile
19+
- gemfiles/rails_5_no_sprockets_webpacker_2.gemfile
20+
- gemfiles/rails_5_no_sprockets_webpacker_3.gemfile
1621
# These don't have webpacker:
1722
- gemfiles/rails_3.2.gemfile
1823
- gemfiles/rails_4.0.5.gemfile
@@ -29,42 +34,50 @@ matrix:
2934
- rvm: 2.1
3035
gemfile: gemfiles/rails_3.2.gemfile
3136
- rvm: 2.1
32-
gemfile: rails_4.0.5.gemfile
37+
gemfile: gemfiles/rails_4.0.5.gemfile
3338
- rvm: 2.1
34-
gemfile: rails_4.0_with_therubyracer.gemfile
39+
gemfile: gemfiles/rails_4.0_with_therubyracer.gemfile
3540
- rvm: 2.1
3641
gemfile: gemfiles/rails_4.2_sprockets_2.gemfile
3742
- rvm: 2.1
3843
gemfile: gemfiles/rails_4.2_sprockets_3.gemfile
3944
- rvm: 2.1
4045
gemfile: gemfiles/rails_4.2_sprockets_4.gemfile
4146
- rvm: 2.1
42-
gemfile: gemfiles/rails_5_no_sprockets_webpacker.gemfile
47+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_1_1.gemfile
48+
- rvm: 2.1
49+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_1_x.gemfile
50+
- rvm: 2.1
51+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_2.gemfile
52+
- rvm: 2.1
53+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_3.gemfile
4354
- rvm: 2.1
4455
gemfile: gemfiles/rails_5_no_sprockets.gemfile
4556
- rvm: 2.1
4657
gemfile: gemfiles/rails_5.1_sprockets_4.gemfile
47-
- rvm: jruby-9.0.1.0
58+
- rvm: jruby-9.1.9.0
4859
gemfile: gemfiles/rails_4.0.gemfile
49-
- rvm: jruby-9.0.1.0
60+
- rvm: jruby-9.1.9.0
5061
gemfile: rails_4.0_with_therubyracer.gemfile
51-
- rvm: jruby-9.0.1.0
62+
- rvm: jruby-9.1.9.0
5263
gemfile: gemfiles/rails_4.1.gemfile
53-
- rvm: jruby-9.0.1.0
64+
- rvm: jruby-9.1.9.0
5465
gemfile: gemfiles/rails_4.2_sprockets_2.gemfile
55-
- rvm: jruby-9.0.1.0
56-
gemfile: gemfiles/rails_5_no_sprockets_webpacker.gemfile
66+
- rvm: jruby-9.1.9.0
67+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_1_1.gemfile
68+
- rvm: jruby-9.1.9.0
69+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_1_x.gemfile
70+
- rvm: jruby-9.1.9.0
71+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_2.gemfile
72+
- rvm: jruby-9.1.9.0
73+
gemfile: gemfiles/rails_5_no_sprockets_webpacker_3.gemfile
74+
- rvm: jruby-9.1.9.0
75+
gemfile: gemfiles/rails_5_no_sprockets.gemfile
5776

5877
allow_failures:
59-
- rvm: jruby-9.0.1.0
78+
- rvm: jruby-9.1.9.0
6079

6180
before_install:
62-
- nvm install 7.8.0 && nvm use 7.8.0
63-
- mkdir travis-phantomjs
64-
- wget https://rmosolgo.github.io/assets/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
65-
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
66-
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
67-
- phantomjs --version
6881
# Repo for Yarn
6982
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
7083
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Appraisals

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,101 @@
1-
appraise "rails-3.2" do
1+
appraise 'rails-3.2' do
22
gem 'rails', '~> 3.2.21'
33
gem 'rack-cache', '~> 1.6.1'
44
# Modern turbolinks depends on `Rails.application.assets` which no-worky
55
gem 'turbolinks', '~> 2.0'
66
end
77

8-
appraise "rails-4.0.5" do
8+
appraise 'rails-4.0.5' do
99
# Depends on sprockets-rails ~> 2.0.0. Support for
1010
# `Rails.application.assets_manifest` which is used by
1111
# `ServerRendering::ManifestContainer` has only been added in
1212
# sprockets-rails 2.2.2. Ensure that server rendering falls back to
1313
# `ServerRendering::EnvironmentContainer`.`
1414
gem 'rails', '4.0.5'
15-
gem "turbolinks"
15+
gem 'turbolinks'
1616
end
1717

18-
appraise "rails-4.0-with-therubyracer" do
18+
appraise 'rails-4.0-with-therubyracer' do
1919
gem 'rails', '~> 4.0.13'
20-
gem 'therubyracer', '0.12.0', :platform => :mri
21-
gem "turbolinks"
20+
gem 'therubyracer', '0.12.0', :platforms => :mri
21+
gem 'turbolinks'
2222
end
2323

24-
appraise "rails-4.1" do
24+
appraise 'rails-4.1' do
2525
gem 'rails', '~> 4.1.10'
2626
# Just to make sure we support old Turbolinks:
27-
gem "turbolinks", "~> 2.3.0"
27+
gem 'turbolinks', '~> 2.3.0'
2828
end
2929

30-
appraise "rails-4.2-sprockets_2" do
30+
appraise 'rails-4.2-sprockets_2' do
3131
gem 'rails', '~> 4.2.1'
32-
gem "sprockets", "~> 2.12"
33-
gem "turbolinks"
32+
gem 'sprockets', '~> 2.12'
33+
gem 'turbolinks'
3434
end
3535

36-
appraise "rails-4.2-sprockets_3" do
36+
appraise 'rails-4.2-sprockets_3' do
3737
gem 'rails', '~> 4.2.1'
38-
gem "sprockets", "~> 3.5"
39-
gem "turbolinks", "~> 2.5.0"
38+
gem 'sprockets', '~> 3.5'
39+
gem 'turbolinks', '~> 2.5.0'
4040
end
4141

42-
appraise "rails-4.2-sprockets_4" do
42+
appraise 'rails-4.2-sprockets_4' do
4343
gem 'rails', '~> 4.2.1'
44-
gem "sprockets", "~> 4.0.x"
45-
gem "turbolinks", "~> 2.5.0"
46-
gem "webpacker", github: "rails/webpacker"
44+
gem 'sprockets', '~> 4.0.x'
45+
gem 'turbolinks', '~> 2.5.0'
4746
# This ExecJS backend provides stateful context
4847
# which the default nodejs backend does not
49-
gem "mini_racer"
48+
gem 'mini_racer', :platforms => :mri
5049
end
5150

52-
appraise "rails-5_no_sprockets_webpacker" do
51+
# no_sprockets is a magical name from sprockets_helper.rb in test to
52+
# load in certain tests or not.
53+
appraise 'rails-5_no_sprockets_webpacker_1_1' do
5354
gem 'rails', '~> 5.0.0'
54-
gem "webpacker", github: "rails/webpacker"
55+
gem 'webpacker', '~> 1.1.0'
5556
# This ExecJS backend provides stateful context
5657
# which the default nodejs backend does not
57-
gem "therubyracer"
58+
gem 'therubyracer', :platforms => :mri
59+
gem 'therubyrhino', :platforms => :jruby
5860
end
5961

60-
appraise "rails-5-no_sprockets" do
62+
appraise 'rails-5_no_sprockets_webpacker_1_x' do
63+
gem 'rails', '~> 5.0.0'
64+
gem 'webpacker', '~> 1.2'
65+
# This ExecJS backend provides stateful context
66+
# which the default nodejs backend does not
67+
gem 'therubyracer', :platforms => :mri
68+
gem 'therubyrhino', :platforms => :jruby
69+
end
70+
71+
appraise 'rails-5_no_sprockets_webpacker_2' do
72+
gem 'rails', '~> 5.0.0'
73+
gem 'webpacker', '~> 2.0'
74+
# This ExecJS backend provides stateful context
75+
# which the default nodejs backend does not
76+
gem 'therubyracer', :platforms => :mri
77+
gem 'therubyrhino', :platforms => :jruby
78+
end
79+
80+
appraise 'rails-5_no_sprockets_webpacker_3' do
81+
gem 'rails', '~> 5.0.0'
82+
gem 'webpacker', '>= 3.0'
83+
# This ExecJS backend provides stateful context
84+
# which the default nodejs backend does not
85+
gem 'therubyracer', :platforms => :mri
86+
gem 'therubyrhino', :platforms => :jruby
87+
end
88+
89+
appraise 'rails-5-no_sprockets' do
6190
# Appraisal adds `turbolinks` to this gemfile because it is
6291
# present in `./Gemfile`.
6392
# But it causes this gemfile to break, so it must be removed
6493
# from `./gemfiles/rails_5_no_sprockets.gemfile` manually.
6594
gem 'rails', '~> 5.0.0'
6695
end
6796

68-
appraise "rails-5.1-sprockets_4" do
69-
gem "rails", "5.1.0.rc1"
70-
gem "sprockets", "~> 4.0.x"
71-
gem "turbolinks", "~> 5.0.0"
97+
appraise 'rails-5.1-sprockets_4' do
98+
gem 'rails', '~> 5.1'
99+
gem 'sprockets', '~> 4.0.x'
100+
gem 'turbolinks', '~> 5.0.0'
72101
end

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88

99
#### Bug Fixes
1010

11+
## 2.3.0
12+
13+
#### New Features
14+
15+
- Webpacker and Webpack 3 support #777
16+
- Update to React 15.6.2 #789
17+
18+
#### Deprecation
19+
20+
#### Bug Fixes
21+
1122
## 2.2.1
1223

1324
#### New Features

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ source 'http://rubygems.org'
22

33
gemspec
44
# This is an optional dev-dependency, required whenever sprockets is required
5-
gem "turbolinks"

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Then restart your development server.
9090

9191
This will:
9292

93-
- add some `//= require`s to `application.js`
93+
- add some `//= require`s to `application.js`
9494
- add a `components/` directory for React components
9595
- add `server_rendering.js` for [server-side rendering](#server-side-rendering)
9696

@@ -108,7 +108,7 @@ window.Post = React.createClass({
108108
// or, equivalent:
109109
class Post extends React.Component {
110110
render() {
111-
return <h1>{this.props.title}</h1>
111+
return <h1>{this.props.title}</h1>
112112
}
113113
}
114114
```
@@ -194,7 +194,7 @@ react_component(component_class_name, props={}, html_options={})
194194
- `html_options` may include:
195195
- `tag:` to use an element other than a `div` to embed `data-react-class` and `data-react-props`.
196196
- `prerender: true` to render the component on the server.
197-
- `camelize_props` to [transform a props hash](#camelize_props)
197+
- `camelize_props` to [transform a props hash](#camelize-props)
198198
- `**other` Any other arguments (eg `class:`, `id:`) are passed through to [`content_tag`](http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag).
199199

200200

@@ -475,13 +475,26 @@ You can also specify this option in `react_component`:
475475
## Related Projects
476476

477477
- [react\_on\_rails Gem](https://github.com/shakacode/react_on_rails): Integration of React with Rails utilizing Webpack, Babel, React, Redux, React-Router.
478-
- [Ruby Hyperloop](http://ruby-hyperloop.io/): Use Ruby to build reactive user interfaces with React.
478+
- [Ruby Hyperloop](http://ruby-hyperloop.org/): Use Ruby to build reactive user interfaces with React.
479479
- [react-rails-hot-loader](https://github.com/rmosolgo/react-rails-hot-loader) is a simple live-reloader for `react-rails`.
480480
- [react-rails-benchmark_renderer](https://github.com/pboling/react-rails-benchmark_renderer) adds performance instrumentation to server rendering.
481481
- [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`.
482482

483483
## Development
484484

485485
- Run tests with `rake test` or `appraisal rake test`
486+
- Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows)
487+
- ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that 👍
486488
- Update React assets with `rake react:update`
487489
- Update the UJS with `rake ujs:update`
490+
- Releases:
491+
- To release a new RubyGems version:
492+
- Increment the version in `lib/react/rails/version.rb`
493+
- Add an entry to `VERSIONS.md`
494+
- Update the changelog (find recent changes on GitHub by listing commits or showing closed PRs)
495+
- Commit changes & push to master
496+
- `bundle exec rake release`: pushes a tag to GitHub, builds a `.gem`, and pushes to RubyGems
497+
- To release a new NPM version:
498+
- Update the version in `react_ujs/package.json`
499+
- Commit & push to master
500+
- `bundle exec rake ujs:publish` (runs `npm publish`)

0 commit comments

Comments
 (0)