Skip to content

Commit 695cd82

Browse files
committed
Correct all deprecation warnings in addons
Reference: https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html Replace -> With react-addons-transition-group -> react-transition-group/TransitionGroup react-addons-css-transition-group -> react-transition-group/CSSTransitionGroup react-addons-update -> immutability-helper react-addons-test-utils -> react-dom/test-utils Prebundle new addons Update generator to extracted proptypes and ES6 export Include react-create-class in generator for non-es6 Update test fixtures to use createReactClass Replace therubyracer with mini_racer The ruby racer pegged libV8 to V3 which is too old for 'Set' which is now standard in JS. The ruby racer therefore cannot be supported this gem. Update README on PropType React is compiled away in JSX transformer using Import syntax Update javascript driver to headless chrome Update travis to remove phantom Replace React.DOM with React.createElement Stop checking for reactid as createElement doesnt make one React.DOM used reactid but createElement does not https://reactjs.org/blog/2016/03/07/react-v15-rc1.html#documentcreateelement-is-in-and-data-reactid-is-out Give Webpacker ES6 import always
1 parent a58f9bb commit 695cd82

File tree

91 files changed

+4046
-4537
lines changed

Some content is hidden

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

91 files changed

+4046
-4537
lines changed

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: ruby
22
sudo: required
33
dist: trusty
4+
addons:
5+
chrome: stable
46
cache:
57
bundler: true
68
yarn: true
@@ -32,9 +34,9 @@ matrix:
3234
- rvm: 2.1
3335
gemfile: gemfiles/rails_3.2.gemfile
3436
- rvm: 2.1
35-
gemfile: rails_4.0.5.gemfile
37+
gemfile: gemfiles/rails_4.0.5.gemfile
3638
- rvm: 2.1
37-
gemfile: rails_4.0_with_therubyracer.gemfile
39+
gemfile: gemfiles/rails_4.0_with_therubyracer.gemfile
3840
- rvm: 2.1
3941
gemfile: gemfiles/rails_4.2_sprockets_2.gemfile
4042
- rvm: 2.1
@@ -76,12 +78,6 @@ matrix:
7678
- rvm: jruby-9.1.9.0
7779

7880
before_install:
79-
- nvm install 7.8.0 && nvm use 7.8.0
80-
- mkdir travis-phantomjs
81-
- 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
82-
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
83-
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
84-
- phantomjs --version
8581
# Repo for Yarn
8682
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
8783
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Appraisals

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ appraise 'rails-4.0.5' do
1515
gem 'turbolinks'
1616
end
1717

18-
appraise 'rails-4.0-with-therubyracer' do
18+
appraise 'rails-4.0-with-mini_racer' do
1919
gem 'rails', '~> 4.0.13'
20-
gem 'therubyracer', '0.12.0', :platforms => :mri
20+
gem 'mini_racer', :platforms => :mri
21+
gem 'therubyrhino', :platforms => :jruby
2122
gem 'turbolinks'
2223
end
2324

@@ -55,7 +56,7 @@ appraise 'rails-5_no_sprockets_webpacker_1_1' do
5556
gem 'webpacker', '~> 1.1.0'
5657
# This ExecJS backend provides stateful context
5758
# which the default nodejs backend does not
58-
gem 'therubyracer', :platforms => :mri
59+
gem 'mini_racer', :platforms => :mri
5960
gem 'therubyrhino', :platforms => :jruby
6061
end
6162

@@ -64,7 +65,7 @@ appraise 'rails-5_no_sprockets_webpacker_1_x' do
6465
gem 'webpacker', '~> 1.2'
6566
# This ExecJS backend provides stateful context
6667
# which the default nodejs backend does not
67-
gem 'therubyracer', :platforms => :mri
68+
gem 'mini_racer', :platforms => :mri
6869
gem 'therubyrhino', :platforms => :jruby
6970
end
7071

@@ -73,7 +74,7 @@ appraise 'rails-5_no_sprockets_webpacker_2' do
7374
gem 'webpacker', '~> 2.0'
7475
# This ExecJS backend provides stateful context
7576
# which the default nodejs backend does not
76-
gem 'therubyracer', :platforms => :mri
77+
gem 'mini_racer', :platforms => :mri
7778
gem 'therubyrhino', :platforms => :jruby
7879
end
7980

@@ -82,7 +83,7 @@ appraise 'rails-5_no_sprockets_webpacker_3' do
8283
gem 'webpacker', '>= 3.0'
8384
# This ExecJS backend provides stateful context
8485
# which the default nodejs backend does not
85-
gem 'therubyracer', :platforms => :mri
86+
gem 'mini_racer', :platforms => :mri
8687
gem 'therubyrhino', :platforms => :jruby
8788
end
8889

README.md

Lines changed: 7 additions & 16 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

@@ -99,7 +99,7 @@ Now, you can create React components in `.jsx` files:
9999
```js
100100
// app/assets/javascripts/components/post.jsx
101101

102-
window.Post = React.createClass({
102+
window.Post = createReactClass({
103103
render: function() {
104104
return <h1>{this.props.title}</h1>
105105
}
@@ -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
```
@@ -139,15 +139,6 @@ Components must be accessible from the top level, but they may be namespaced, fo
139139

140140
`//= require react` brings `React` into your project.
141141

142-
To include `React.addons`, add this config:
143-
144-
```ruby
145-
# config/application.rb
146-
MyApp::Application.configure do
147-
config.react.addons = true # defaults to false
148-
end
149-
```
150-
151142
By default, React's [development version] is provided to `Rails.env.development`. You can override the React build with a config:
152143

153144
```ruby
@@ -395,11 +386,11 @@ rails g react:component Post title:string published:bool published_by:instanceOf
395386
would generate:
396387

397388
```js
398-
var Post = React.createClass({
389+
var Post = createReactClass({
399390
propTypes: {
400-
title: React.PropTypes.string,
401-
published: React.PropTypes.bool,
402-
publishedBy: React.PropTypes.instanceOf(Person)
391+
title: PropTypes.string,
392+
published: PropTypes.bool,
393+
publishedBy: PropTypes.instanceOf(Person)
403394
},
404395

405396
render: function() {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "http://rubygems.org"
4+
5+
gem "rails", "~> 4.0.13"
6+
gem "mini_racer", platforms: :mri
7+
gem "therubyrhino", platforms: :jruby
8+
gem "turbolinks"
9+
10+
gemspec path: "../"

gemfiles/rails_5_no_sprockets_webpacker_1_1.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 5.0.0"
66
gem "webpacker", "~> 1.1.0"
7-
gem "therubyracer", platforms: :mri
7+
gem "mini_racer", platforms: :mri
88
gem "therubyrhino", platforms: :jruby
99

1010
gemspec path: "../"

gemfiles/rails_5_no_sprockets_webpacker_1_x.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 5.0.0"
66
gem "webpacker", "~> 1.2"
7-
gem "therubyracer", platforms: :mri
7+
gem "mini_racer", platforms: :mri
88
gem "therubyrhino", platforms: :jruby
99

1010
gemspec path: "../"

gemfiles/rails_5_no_sprockets_webpacker_2.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 5.0.0"
66
gem "webpacker", "~> 2.0"
7-
gem "therubyracer", platforms: :mri
7+
gem "mini_racer", platforms: :mri
88
gem "therubyrhino", platforms: :jruby
99

1010
gemspec path: "../"

gemfiles/rails_5_no_sprockets_webpacker_3.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 5.0.0"
66
gem "webpacker", ">= 3.0"
7-
gem "therubyracer", platforms: :mri
7+
gem "mini_racer", platforms: :mri
88
gem "therubyrhino", platforms: :jruby
99

1010
gemspec path: "../"

lib/assets/javascripts/JSXTransformer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15708,22 +15708,22 @@ function addDisplayName(displayName, object, state) {
1570815708
/**
1570915709
* Transforms the following:
1571015710
*
15711-
* var MyComponent = React.createClass({
15711+
* var MyComponent = createReactClass({
1571215712
* render: ...
1571315713
* });
1571415714
*
1571515715
* into:
1571615716
*
15717-
* var MyComponent = React.createClass({
15717+
* var MyComponent = createReactClass({
1571815718
* displayName: 'MyComponent',
1571915719
* render: ...
1572015720
* });
1572115721
*
1572215722
* Also catches:
1572315723
*
15724-
* MyComponent = React.createClass(...);
15725-
* exports.MyComponent = React.createClass(...);
15726-
* module.exports = {MyComponent: React.createClass(...)};
15724+
* MyComponent = createReactClass(...);
15725+
* exports.MyComponent = createReactClass(...);
15726+
* module.exports = {MyComponent: createReactClass(...)};
1572715727
*/
1572815728
function visitReactDisplayName(traverse, object, path, state) {
1572915729
var left, right;
@@ -15916,4 +15916,4 @@ function inlineSourceMap(sourceMap, sourceCode, sourceFilename) {
1591615916
module.exports = inlineSourceMap;
1591715917

1591815918
},{"buffer":3}]},{},[1])(1)
15919-
});
15919+
});

0 commit comments

Comments
 (0)