Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,50 @@

#### Bug Fixes

## 2.4.4

#### New Features

- React 16.2 prebundled #856, #874
- Use Fragments instead of Divs by default #856
- Explicitly support Ruby 2.5 #857
- Add support for controller rendering using `camelize_props` #869
- Many readme, doc and guide updates including Typescript #873, #865, #862, #854, #852, #849

#### Deprecation

- Drop explicit support for Ruby 2.1 #866
- Drop explicit support for Rails 3, 4.0, 4.1 #866
- If the gem continues to work on Ruby and Rails below what is in Travis, it is accidental.

#### Bug Fixes

- Correct behaviour of Turbolinks 5 mounting #868, 848
- Correct behaviour of JQuery3 removing "on" #867, 762

## 2.4.3

#### Bug Fixes

- Call ReactDOM.render() when react_component :prerender option is falsy, instead of ReactDOM.hydrate() #844, #842

## 2.4.2
#### Bug Fixes

- ReactDOM.hydrate() may not be defined for everyone, it will now use hydrate if it is defined or fallback to render #832

## 2.4.1

#### Breaking Changes

#### New Features

- Webpacker gets ES6 components by default #822
- ReactDOM.hydrate() #828
- Documentation updates #830

#### Deprecation

#### Bug Fixes

- Webpacker local manifest sometimes had double asset_hosts if the dev server was running #834 thanks @joeyparis

## 2.4.0
Expand All @@ -37,10 +61,6 @@
- (Sprockets) Prebundled React upgraded to 16 #792
- (Sprockets) Addons removed #792

#### New Features

#### Deprecation

#### Bug Fixes

- Coffeescript generator exports correctly #799, #800
Expand Down
3 changes: 2 additions & 1 deletion VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ You can control what version of React.js (and JSXTransformer) is used by `react-

| Gem | React.js |
|----------|----------|
| master | 16.1.1 |
| master | 16.2.0 |
| 2.4.4 | 16.2.0 |
| 2.4.3 | 16.1.1 |
| 2.4.2 | 16.1.1 |
| 2.4.1 | 16.0.0 |
Expand Down
72 changes: 64 additions & 8 deletions lib/assets/react-source/development/react-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2495,6 +2495,27 @@
*/
componentWillUnmount: 'DEFINE_MANY',

/**
* Replacement for (deprecated) `componentWillMount`.
*
* @optional
*/
UNSAFE_componentWillMount: 'DEFINE_MANY',

/**
* Replacement for (deprecated) `componentWillReceiveProps`.
*
* @optional
*/
UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',

/**
* Replacement for (deprecated) `componentWillUpdate`.
*
* @optional
*/
UNSAFE_componentWillUpdate: 'DEFINE_MANY',

// ==== Advanced methods ====

/**
Expand All @@ -2510,6 +2531,23 @@
updateComponent: 'OVERRIDE_BASE'
};

/**
* Similar to ReactClassInterface but for static methods.
*/
var ReactClassStaticInterface = {
/**
* This method is invoked after a component is instantiated and when it
* receives new props. Return an object to update state in response to
* prop changes. Return null to indicate no change to state.
*
* If an object is returned, its keys will be merged into the existing state.
*
* @return {object || null}
* @optional
*/
getDerivedStateFromProps: 'DEFINE_MANY_MERGED'
};

/**
* Mapping from class specification keys to special processing functions.
*
Expand Down Expand Up @@ -2744,6 +2782,7 @@
if (!statics) {
return;
}

for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
Expand All @@ -2760,14 +2799,25 @@
name
);

var isInherited = name in Constructor;
_invariant(
!isInherited,
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);
var isAlreadyDefined = name in Constructor;
if (isAlreadyDefined) {
var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)
? ReactClassStaticInterface[name]
: null;

_invariant(
specPolicy === 'DEFINE_MANY_MERGED',
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);

Constructor[name] = createMergedResultFunction(Constructor[name], property);

return;
}

Constructor[name] = property;
}
}
Expand Down Expand Up @@ -3077,6 +3127,12 @@
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
spec.displayName || 'A component'
);
warning(
!Constructor.prototype.UNSAFE_componentWillRecieveProps,
'%s has a method called UNSAFE_componentWillRecieveProps(). ' +
'Did you mean UNSAFE_componentWillReceiveProps()?',
spec.displayName || 'A component'
);
}

// Reduce time spent doing lookups by setting these on the prototype.
Expand Down
72 changes: 64 additions & 8 deletions lib/assets/react-source/development/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -18518,6 +18518,27 @@
*/
componentWillUnmount: 'DEFINE_MANY',

/**
* Replacement for (deprecated) `componentWillMount`.
*
* @optional
*/
UNSAFE_componentWillMount: 'DEFINE_MANY',

/**
* Replacement for (deprecated) `componentWillReceiveProps`.
*
* @optional
*/
UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',

/**
* Replacement for (deprecated) `componentWillUpdate`.
*
* @optional
*/
UNSAFE_componentWillUpdate: 'DEFINE_MANY',

// ==== Advanced methods ====

/**
Expand All @@ -18533,6 +18554,23 @@
updateComponent: 'OVERRIDE_BASE'
};

/**
* Similar to ReactClassInterface but for static methods.
*/
var ReactClassStaticInterface = {
/**
* This method is invoked after a component is instantiated and when it
* receives new props. Return an object to update state in response to
* prop changes. Return null to indicate no change to state.
*
* If an object is returned, its keys will be merged into the existing state.
*
* @return {object || null}
* @optional
*/
getDerivedStateFromProps: 'DEFINE_MANY_MERGED'
};

/**
* Mapping from class specification keys to special processing functions.
*
Expand Down Expand Up @@ -18767,6 +18805,7 @@
if (!statics) {
return;
}

for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
Expand All @@ -18783,14 +18822,25 @@
name
);

var isInherited = name in Constructor;
_invariant(
!isInherited,
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);
var isAlreadyDefined = name in Constructor;
if (isAlreadyDefined) {
var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)
? ReactClassStaticInterface[name]
: null;

_invariant(
specPolicy === 'DEFINE_MANY_MERGED',
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);

Constructor[name] = createMergedResultFunction(Constructor[name], property);

return;
}

Constructor[name] = property;
}
}
Expand Down Expand Up @@ -19100,6 +19150,12 @@
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
spec.displayName || 'A component'
);
warning(
!Constructor.prototype.UNSAFE_componentWillRecieveProps,
'%s has a method called UNSAFE_componentWillRecieveProps(). ' +
'Did you mean UNSAFE_componentWillReceiveProps()?',
spec.displayName || 'A component'
);
}

// Reduce time spent doing lookups by setting these on the prototype.
Expand Down
Loading