Skip to content

Commit 363edab

Browse files
committed
chore: Upgrade all dependencies and switch to react-testing-library
Also fix issues with website and remove ga and codefund
1 parent cb8297d commit 363edab

File tree

15 files changed

+3697
-4767
lines changed

15 files changed

+3697
-4767
lines changed

Diff for: .babelrc.js

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const modules = output == null ? false : output;
77
const options = {
88
presets: [['@babel/env', { loose: true, modules }], '@babel/react'],
99
plugins: [
10-
'@babel/plugin-syntax-dynamic-import',
11-
'@babel/proposal-object-rest-spread',
1210
['@babel/proposal-class-properties', { loose: true }],
1311
],
1412
};

Diff for: .eslintrc

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"extends": ["airbnb", "prettier"],
3-
"parser": "babel-eslint",
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:react/recommended",
5+
"plugin:import/recommended",
6+
"plugin:jsx-a11y/recommended",
7+
"plugin:prettier/recommended"
8+
],
9+
"parser": "@babel/eslint-parser",
10+
"settings": {
11+
"react": {
12+
"version": "detect"
13+
}
14+
},
415
"env": {
516
"browser": true,
617
"node": true
718
},
8-
"plugins": ["prettier"],
919
"rules": {
10-
"no-plusplus": "off",
11-
"prettier/prettier": "error",
12-
"react/require-default-props": "off",
13-
"react/jsx-filename-extension": ["error", { "extensions": [".js"] }],
14-
"react/jsx-props-no-spreading": "off",
15-
"react/forbid-prop-types": "off",
16-
"react/prefer-stateless-function": "off",
17-
"react/sort-comp": "off",
18-
"react/static-property-placement": "off",
19-
"react/state-in-constructor": "off",
2020
"jsx-a11y/no-static-element-interactions": "off",
2121
"import/no-extraneous-dependencies": [
2222
"error",
@@ -25,10 +25,12 @@
2525
"**/__tests__/**/*",
2626
"examples/src/**/*.js",
2727
"rollup.config.js",
28-
"webpack-new.config.js"
28+
"webpack.config.js"
2929
],
3030
"optionalDependencies": false
3131
}
32-
]
32+
],
33+
"no-unused-vars": ["error", { "ignoreRestSiblings": true }],
34+
"no-console": "error"
3335
}
3436
}

Diff for: .travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
language: node_js
22
node_js:
33
- 'lts/*'
4-
before_install:
5-
- curl -o- -L https://yarnpkg.com/install.sh | bash
6-
- export PATH="$HOME/.yarn/bin:$PATH"
74
cache:
85
yarn: true
96
script:

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2019 by Matt Zabriskie
1+
Copyright (c) Matt Zabriskie and Daniel Tschinder
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Diff for: examples/src/app.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import 'react-live/react-live.css';
43
import './example.less';
54
import SuperMario from './components/examples/SuperMario';
65
import MattGroening from './components/examples/MattGroening';

Diff for: examples/src/components/ExampleItem.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import T from 'prop-types';
33
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; // eslint-disable-line
44
import { LiveProvider, LiveEditor, LivePreview, LiveError } from 'react-live';
55
import classNames from 'clsx';
6+
import dracula from 'prism-react-renderer/themes/dracula';
67

78
const scope = { Tabs, Tab, TabList, TabPanel };
89

@@ -53,17 +54,18 @@ export default class ExampleItem extends Component {
5354
</h3>
5455
{this.renderHint()}
5556
<LiveProvider
56-
mountStylesheet={false}
5757
scope={scope}
5858
code={this.props.code}
59+
theme={dracula}
5960
noInline
6061
>
6162
<LiveError />
6263
<div className="live-preview">
6364
<div className={editorClassNames}>
64-
<LiveEditor ignoreTabKey />
65+
<LiveEditor />
6566
</div>
6667
<LivePreview
68+
className="react-live-preview"
6769
style={{ dir: this.props.direction === 'rtl' ? 'rtl' : 'ltr' }}
6870
/>
6971
</div>

Diff for: examples/src/components/examples/MattGroening.js

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ const code = `const Component = (
6262
</TabPanel>
6363
<TabPanel>
6464
<p>Chinese-Martian intern at Planet Express. Fonfon Ru of Kif Kroker.</p>
65-
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/f/fd/FuturamaAmyWong.png/140px-FuturamaAmyWong.png" alt="Amy Wong" />
6665
</TabPanel>
6766
<TabPanel>
6867
<p>Many times great-nephew of Fry. CEO and owner of Planet Express delivery company. Tenured professor of Mars University.</p>

Diff for: examples/src/example.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ h1, h2, h3 {
153153
color: @link-color;
154154
text-decoration: none;
155155
font-size: .7em;
156-
}
156+
}
157157

158158
.react-live-preview {
159159
padding: 2em;

Diff for: examples/src/index.html

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
<!doctype html>
22
<head>
3-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117743005-1"></script>
4-
<script>
5-
window.dataLayer = window.dataLayer || [];
6-
function gtag(){dataLayer.push(arguments);}
7-
gtag('js', new Date());
8-
9-
gtag('config', 'UA-117743005-1');
10-
</script>
113
<meta charset="utf-8">
124
<title>React-Tabs</title>
135
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width">
@@ -26,7 +18,6 @@
2618
<h1 class="page-header__title">React Tabs</h1>
2719
<h2 class="page-header__subtitle">An accessible and easy tab component for <a href="https://reactjs.org/" target="_blank" class="page-header__link" rel="noopener noreferrer">ReactJS</a>.</h2>
2820
<a href="https://github.com/reactjs/react-tabs" class="page-header__button" target="_blank" rel="noopener noreferrer">View on GitHub</a>
29-
<div id="codefund"></div>
3021
</div>
3122
</header>
3223
<div class="page-body">
@@ -41,9 +32,7 @@ <h2 class="page-header__subtitle">An accessible and easy tab component for <a hr
4132
<div class="container">
4233
<div>Supported by</div>
4334
<div><a href="https://www.browserstack.com"><img src="images/Browserstack-logo.svg" alt="Browserstack" class="browserstack"></a></div>
44-
<div>Copyright &copy; <a href="https://twitter.com/TschinderDaniel" target="_blank" rel="noopener noreferrer">Daniel Tschinder</a> 2017-2018. MIT Licensed.</div>
45-
<div>This website uses google analytics. <a href="https://tools.google.com/dlpage/gaoptout" target="_blank" rel="noopener noreferrer">Opt-out here</a>.</div>
35+
<div>Copyright &copy; <a href="https://github.com/danez" target="_blank" rel="noopener noreferrer">Daniel Tschinder</a> 2017-2020. MIT Licensed.</div>
4636
</div>
4737
</footer>
48-
<script src="https://codefund.app/properties/113/funder.js" async></script>
4938
</body>

Diff for: package.json

+38-38
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"scripts": {
88
"clean:commonjs": "rimraf lib",
99
"clean:umd": "rimraf dist",
10-
"create-github-release": "conventional-github-releaser -p angular",
1110
"build:commonjs": "cross-env BABEL_OUTPUT=commonjs babel src/ --out-dir lib/ --ignore **/__tests__,**/__mocks__",
1211
"build:esm": "babel src/ --out-dir esm/ --ignore **/__tests__,**/__mocks__",
1312
"build:umd": "rollup -c",
@@ -18,7 +17,7 @@
1817
"prepublishOnly": "yarn run build",
1918
"release": "semantic-release",
2019
"test": "cross-env BABEL_OUTPUT=commonjs jest",
21-
"start": "webpack-dev-server --inline --content-base examples/",
20+
"start": "webpack serve --inline --content-base examples/ --port 8000",
2221
"website": "run-s website:clean website:build website:redirect",
2322
"website:clean": "rimraf examples/dist",
2423
"website:build": "cross-env BABEL_TARGET=examples NODE_ENV=production webpack",
@@ -53,57 +52,58 @@
5352
"devDependencies": {
5453
"@babel/cli": "^7.0.0",
5554
"@babel/core": "^7.0.0",
55+
"@babel/eslint-parser": "^7.12.1",
5656
"@babel/plugin-external-helpers": "^7.0.0",
5757
"@babel/plugin-proposal-class-properties": "^7.0.0",
5858
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
5959
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
6060
"@babel/preset-env": "^7.0.0",
6161
"@babel/preset-react": "^7.0.0",
62-
"babel-core": "^7.0.0-0",
63-
"babel-eslint": "^10.0.1",
62+
"@testing-library/dom": "^7.29.0",
63+
"@testing-library/jest-dom": "^5.11.6",
64+
"@testing-library/react": "^11.2.2",
65+
"@testing-library/user-event": "^12.5.0",
6466
"babel-jest": "^26.0.1",
65-
"babel-loader": "^8.0.0",
66-
"babel-plugin-transform-react-remove-prop-types": "^0.4.15",
67-
"conventional-github-releaser": "^3.1.2",
67+
"babel-loader": "^8.2.2",
68+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
6869
"cross-env": "^7.0.2",
69-
"css-loader": "^3.3.2",
70-
"enzyme": "^3.5.0",
71-
"enzyme-adapter-react-16": "^1.3.0",
70+
"css-loader": "^5.0.1",
71+
"enzyme": "^3.11.0",
7272
"eslint": "^7.1.0",
73-
"eslint-config-airbnb": "^18.0.1",
74-
"eslint-config-prettier": "^6.7.0",
75-
"eslint-plugin-import": "^2.14.0",
76-
"eslint-plugin-jsx-a11y": "^6.1.1",
77-
"eslint-plugin-prettier": "^3.0.1",
78-
"eslint-plugin-react": "^7.11.1",
79-
"file-loader": "^6.0.0",
80-
"hoist-non-react-statics": "^3.0.1",
81-
"html-loader": "^1.1.0",
82-
"html-webpack-plugin": "^4.3.0",
73+
"eslint-config-prettier": "^7.0.0",
74+
"eslint-plugin-import": "^2.22.1",
75+
"eslint-plugin-jsx-a11y": "^6.4.1",
76+
"eslint-plugin-prettier": "^3.2.0",
77+
"eslint-plugin-react": "^7.21.5",
78+
"file-loader": "^6.2.0",
79+
"hoist-non-react-statics": "^3.3.2",
80+
"html-loader": "^1.3.2",
81+
"html-webpack-plugin": "^4.5.0",
8382
"husky": "^4.2.5",
84-
"jest": "^26.0.1",
85-
"less-loader": "^6.1.0",
83+
"jest": "^26.6.3",
84+
"less": "^3.13.0",
85+
"less-loader": "^7.1.0",
8686
"lint-staged": "^10.2.6",
87-
"mini-css-extract-plugin": "^0.9.0",
87+
"mini-css-extract-plugin": "^1.3.3",
8888
"npm-run-all": "^4.1.3",
89-
"prettier": "^2.0.5",
90-
"react": "^16.4.2",
91-
"react-dom": "^16.4.2",
92-
"react-live": "^1.11.0",
93-
"react-modal": "^3.5.1",
94-
"react-test-renderer": "^16.4.2",
89+
"prettier": "^2.2.1",
90+
"react": "^17.0.1",
91+
"react-dom": "^17.0.1",
92+
"react-live": "^2.2.3",
93+
"react-modal": "^3.12.1",
94+
"react-test-renderer": "^17.0.1",
9595
"rimraf": "^3.0.0",
96-
"rollup": "^2.10.8",
97-
"rollup-plugin-babel": "^4.0.2",
96+
"rollup": "^2.34.2",
97+
"rollup-plugin-babel": "^4.4.0",
9898
"rollup-plugin-commonjs": "^10.1.0",
99-
"rollup-plugin-ignore": "^1.0.3",
99+
"rollup-plugin-ignore": "^1.0.9",
100100
"rollup-plugin-node-resolve": "^5.2.0",
101-
"rollup-plugin-replace": "^2.0.0",
102-
"rollup-plugin-terser": "^6.0.1",
103-
"semantic-release": "^17.0.7",
104-
"webpack": "^4.17.1",
105-
"webpack-cli": "^3.1.0",
106-
"webpack-dev-server": "^3.1.7"
101+
"rollup-plugin-replace": "^2.2.0",
102+
"rollup-plugin-terser": "^7.0.2",
103+
"semantic-release": "^17.3.0",
104+
"webpack": "^5.10.1",
105+
"webpack-cli": "^4.2.0",
106+
"webpack-dev-server": "^3.11.0"
107107
},
108108
"dependencies": {
109109
"clsx": "^1.1.0",

Diff for: src/components/UncontrolledTabs.js

-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ export default class UncontrolledTabs extends Component {
311311
this.setSelected(index, e);
312312
return;
313313
}
314-
// eslint-disable-next-line no-cond-assign
315314
} while ((node = node.parentNode) != null);
316315
};
317316

0 commit comments

Comments
 (0)