Skip to content

Commit e457dd7

Browse files
authored
Fix security issues, JS peer dependencies, and some warnings (#523)
* Upgrade bootstrap-loader * Install unmet peer dependencies * Upgrade url-loader * Upgrade redux and react-redux * Remove deprecated babel-eslint * Replace react-addons-css-transition-group pachage * Modify App component to follow ROR API * Fix warning related deprecated or old rails config
1 parent 281cf10 commit e457dd7

File tree

7 files changed

+1832
-1696
lines changed

7 files changed

+1832
-1696
lines changed

client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Button from 'react-bootstrap/lib/Button';
1313
import Nav from 'react-bootstrap/lib/Nav';
1414
import NavItem from 'react-bootstrap/lib/NavItem';
1515
import Alert from 'react-bootstrap/lib/Alert';
16-
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
16+
import ReactCSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';
1717
import _ from 'lodash';
1818
import { injectIntl } from 'react-intl';
1919
import { defaultMessages } from 'libs/i18n/default';

client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Alert from 'react-bootstrap/lib/Alert';
22
import Immutable from 'immutable';
33
import React from 'react';
44
import PropTypes from 'prop-types';
5-
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
5+
import ReactCSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';
66
import _ from 'lodash';
77
import BaseComponent from '../../../../../libs/components/BaseComponent.jsx';
88

client/app/bundles/comments/startup/App.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import NonRouterCommentsContainer from '../containers/NonRouterCommentsContainer
77
function App(_props, _railsContext) {
88
const store = ReactOnRails.getStore('commentsStore');
99

10-
return (
11-
<Provider store={store}>
12-
<NonRouterCommentsContainer />
13-
</Provider>
14-
);
10+
return function AppComponent() {
11+
return (
12+
<Provider store={store}>
13+
<NonRouterCommentsContainer />
14+
</Provider>
15+
);
16+
};
1517
}
1618

1719
export default App;

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
module RailsReactTutorial
1212
class Application < Rails::Application
1313
# Initialize configuration defaults for originally generated Rails version.
14-
config.load_defaults 6.0
14+
config.load_defaults 7.0
1515

1616
# Configuration for the application, engines, and railties goes here.
1717

config/initializers/new_framework_defaults_6_1.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
# Be sure to restart your server when you modify this file.
34
#
45
# This file contains migration options to ease your Rails 6.1 upgrade.
@@ -43,7 +44,7 @@
4344
# Use new connection handling API. For most applications this won't have any
4445
# effect. For applications using multiple databases, this new API provides
4546
# support for granular connection swapping.
46-
# Rails.application.config.active_record.legacy_connection_handling = false
47+
Rails.application.config.active_record.legacy_connection_handling = false
4748

4849
# Make `form_with` generate non-remote forms by default.
4950
# Rails.application.config.action_view.form_with_generates_remote_forms = false

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@
3232
"@babel/plugin-transform-runtime": "^7.21.0",
3333
"@babel/preset-env": "^7.20.2",
3434
"@babel/preset-react": "^7.18.6",
35+
"@babel/runtime": "^7.17.9",
3536
"@rails/actioncable": "7.0.4-1",
3637
"autoprefixer": "^7.1.5",
3738
"axios": "^0.21.1",
3839
"babel-loader": "^9.1.2",
3940
"babel-plugin-macros": "^3.1.0",
4041
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
41-
"bootstrap-loader": "^4.0.2",
42+
"bootstrap-loader": "^4.0.4",
4243
"bootstrap-sass": "^3.4.3",
4344
"classnames": "^2.3.2",
4445
"compression-webpack-plugin": "9",
@@ -47,29 +48,33 @@
4748
"es5-shim": "^4.6.7",
4849
"estraverse": "^4.2.0",
4950
"expose-loader": "^4.0.0",
51+
"file-loader": "^6.2.0",
52+
"html-webpack-plugin": "^5.5.0",
5053
"immutable": "^3.8.2",
5154
"imports-loader": "^4.0.0",
5255
"intl": "^1.2.5",
5356
"jquery": "^3.2.1",
5457
"jquery-ujs": "^1.2.2",
58+
"js-yaml": "^4.1.0",
5559
"loader-utils": "^1.1.0",
5660
"lodash": "^4.17.4",
5761
"marked": "^4.0.0",
62+
"node-sass": "^8.0.0",
5863
"node-uuid": "^1.4.8",
5964
"postcss": "^8.4.5",
6065
"postcss-loader": "6.2.1",
6166
"prop-types": "^15.8.1",
6267
"react": "^17.0.2",
63-
"react-addons-css-transition-group": "^15.6.2",
6468
"react-bootstrap": "^0.31.5",
6569
"react-dom": "^17.0.2",
6670
"react-intl": "^5.24.1",
6771
"react-on-rails": "13.2.0",
68-
"react-redux": "^5.0.6",
72+
"react-redux": "^7.2.2",
6973
"react-router": "^4.2.0",
7074
"react-router-dom": "^4.2.2",
7175
"react-router-redux": "^4.0.8",
72-
"redux": "^3.7.2",
76+
"react-transition-group": "1.x",
77+
"redux": "^4.2.1",
7378
"redux-thunk": "^2.2.0",
7479
"resolve-url-loader": "^2.2.0",
7580
"sass": "^1.58.3",
@@ -79,7 +84,7 @@
7984
"style-loader": "^3.3.1",
8085
"terser-webpack-plugin": "5",
8186
"turbolinks": "^5.2.0",
82-
"url-loader": "^0.6.2",
87+
"url-loader": "^4.1.1",
8388
"webpack": "5",
8489
"webpack-assets-manifest": "5",
8590
"webpack-cli": "5",
@@ -89,7 +94,6 @@
8994
"@babel/eslint-parser": "^7.16.5",
9095
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
9196
"@webpack-cli/serve": "^1.6.0",
92-
"babel-eslint": "^8.0.2",
9397
"babel-jest": "^27.2.1",
9498
"body-parser": "^1.20.2",
9599
"eslint": "^8.35.0",

0 commit comments

Comments
 (0)