@samitouri / QOS-React-2 / commits / 5f95fdee63

Updated create-react-class to 15.6.3 (and updated tests) (#12126)

Brian Vaughn committed Jan 31, 2018 at 09:41 UTC 5f95fdee638dc4e5614c3c09d2070f8281c1fe91
4 files changed +16 -23
package.json
+1 -1
@@ -45,7 +45,7 @@
45 "coffee-script": "^1.8.0",
46 "core-js": "^2.2.1",
47 "coveralls": "^2.11.6",
48 - "create-react-class": "^15.6.2",
48 + "create-react-class": "^15.6.3",
49 "cross-env": "^5.1.1",
50 "danger": "^3.0.4",
51 "del": "^2.0.2",
packages/react/src/__tests__/createReactClassIntegration-test.internal.js
+6 -20
@@ -37,13 +37,13 @@ describe('create-react-class-integration', () => {
37 displayName: 'MyComponent',
38 mixins: [
39 {
40 - componentWillMount() {
40 + UNSAFE_componentWillMount() {
41 this.log('mixin.componentWillMount');
42 },
43 componentDidMount() {
44 this.log('mixin.componentDidMount');
45 },
46 - componentWillUpdate() {
46 + UNSAFE_componentWillUpdate() {
47 this.log('mixin.componentWillUpdate');
48 },
49 componentDidUpdate() {
@@ -61,13 +61,13 @@ describe('create-react-class-integration', () => {
61 this.log('getInitialState');
62 return {};
63 },
64 - componentWillMount() {
64 + UNSAFE_componentWillMount() {
65 this.log('componentWillMount');
66 },
67 componentDidMount() {
68 this.log('componentDidMount');
69 },
70 - componentWillUpdate() {
70 + UNSAFE_componentWillUpdate() {
71 this.log('componentWillUpdate');
72 },
73 componentDidUpdate() {
@@ -85,25 +85,11 @@ describe('create-react-class-integration', () => {
85
86 const container = document.createElement('div');
87
88 - // TODO (RFC #6) The below lifecycle warnings are unavoidable for now,
89 - // Until create-react-class recognizes the UNSAFE_* methods.
90 - // (If we try to use them before them, it will error because
91 - // we are defining the same method twice.)
92 - // Update the above component to use the new UNSAFE_* methods
93 - // (and remove the expected warnings) once create-react-class has been updated.
94 - expect(() => ReactDOM.render(<Component />, container)).toWarnDev([
88 + expect(() => ReactDOM.render(<Component />, container)).toWarnDev(
89 'Warning: MyComponent: isMounted is deprecated. Instead, make sure to ' +
90 'clean up subscriptions and pending requests in componentWillUnmount ' +
91 'to prevent memory leaks.',
98 - 'componentWillMount is deprecated and will be removed in the next major version. ' +
99 - 'Use componentDidMount instead. As a temporary workaround, ' +
100 - 'you can rename to UNSAFE_componentWillMount.' +
101 - '\n\nPlease update the following components: MyComponent',
102 - 'componentWillUpdate is deprecated and will be removed in the next major version. ' +
103 - 'Use componentDidUpdate instead. As a temporary workaround, ' +
104 - 'you can rename to UNSAFE_componentWillUpdate.' +
105 - '\n\nPlease update the following components: MyComponent',
106 - ]);
92 + );
93
94 // Dedupe
95 ReactDOM.render(<Component />, container);
packages/react/src/__tests__/createReactClassIntegration-test.js
+1 -2
@@ -152,8 +152,7 @@ describe('create-react-class-integration', () => {
152 );
153 });
154
155 - // TODO (RFC #6) Reenable after create-react-class updated.
156 - xit('should warn when misspelling UNSAFE_componentWillReceiveProps', () => {
155 + it('should warn when misspelling UNSAFE_componentWillReceiveProps', () => {
156 expect(() =>
157 createReactClass({
158 UNSAFE_componentWillRecieveProps: function() {
yarn.lock
+8
@@ -1446,6 +1446,14 @@ create-react-class@^15.6.2:
1446 loose-envify "^1.3.1"
1447 object-assign "^4.1.1"
1448
1449 +create-react-class@^15.6.3:
1450 + version "15.6.3"
1451 + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036"
1452 + dependencies:
1453 + fbjs "^0.8.9"
1454 + loose-envify "^1.3.1"
1455 + object-assign "^4.1.1"
1456 +
1457 cross-env@^5.1.1:
1458 version "5.1.1"
1459 resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.1.1.tgz#b6d8ab97f304c0f71dae7277b75fe424c08dfa74"