Skip to content

Commit 9db6eed

Browse files
committed
upgrade dependencies
1 parent e118b6c commit 9db6eed

File tree

7 files changed

+2378
-2191
lines changed

7 files changed

+2378
-2191
lines changed

.size-snapshot.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"dist/cjs/react-popper-tooltip.js": {
3-
"bundled": 14475,
4-
"minified": 7771,
5-
"gzipped": 2286
3+
"bundled": 14432,
4+
"minified": 7751,
5+
"gzipped": 2292
66
},
77
"dist/esm/react-popper-tooltip.js": {
8-
"bundled": 14436,
9-
"minified": 7747,
10-
"gzipped": 2282,
8+
"bundled": 14393,
9+
"minified": 7727,
10+
"gzipped": 2287,
1111
"treeshaked": {
1212
"rollup": {
13-
"code": 7311,
14-
"import_statements": 250
13+
"code": 172,
14+
"import_statements": 152
1515
},
1616
"webpack": {
17-
"code": 8465
17+
"code": 8447
1818
}
1919
}
2020
}

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,41 +46,41 @@
4646
"react-dom": "^16.6.0"
4747
},
4848
"dependencies": {
49-
"@babel/runtime": "^7.4.5",
50-
"react-popper": "^1.3.3"
49+
"@babel/runtime": "^7.6.2",
50+
"react-popper": "^1.3.4"
5151
},
5252
"devDependencies": {
53-
"@babel/cli": "^7.4.4",
54-
"@babel/core": "^7.4.5",
55-
"@babel/plugin-proposal-class-properties": "^7.4.4",
56-
"@babel/plugin-transform-runtime": "^7.4.4",
57-
"@babel/preset-env": "^7.4.5",
53+
"@babel/cli": "^7.6.2",
54+
"@babel/core": "^7.6.2",
55+
"@babel/plugin-proposal-class-properties": "^7.5.5",
56+
"@babel/plugin-transform-runtime": "^7.6.2",
57+
"@babel/preset-env": "^7.6.2",
5858
"@babel/preset-react": "^7.0.0",
59-
"@babel/preset-typescript": "^7.3.3",
60-
"@types/jest": "^24.0.13",
61-
"@types/react": "^16.8.18",
62-
"@types/react-dom": "^16.8.4",
63-
"@typescript-eslint/eslint-plugin": "^1.9.0",
64-
"@typescript-eslint/parser": "^1.9.0",
65-
"docz": "^1.2.0",
59+
"@babel/preset-typescript": "^7.6.0",
60+
"@testing-library/react": "^9.3.0",
61+
"@types/jest": "^24.0.18",
62+
"@types/react": "^16.9.5",
63+
"@types/react-dom": "^16.9.1",
64+
"@typescript-eslint/eslint-plugin": "^2.3.3",
65+
"@typescript-eslint/parser": "^2.3.3",
66+
"docz": "^1.3.2",
6667
"docz-plugin-css": "^0.11.0",
6768
"docz-theme-default": "^1.2.0",
68-
"eslint": "^5.16.0",
69-
"eslint-config-prettier": "^4.3.0",
70-
"eslint-plugin-jsx-a11y": "^6.2.1",
71-
"eslint-plugin-prettier": "^3.1.0",
72-
"eslint-plugin-react": "^7.13.0",
73-
"jest": "^24.8.0",
69+
"eslint": "^6.5.1",
70+
"eslint-config-prettier": "^6.4.0",
71+
"eslint-plugin-jsx-a11y": "^6.2.3",
72+
"eslint-plugin-prettier": "^3.1.1",
73+
"eslint-plugin-react": "^7.16.0",
74+
"jest": "^24.9.0",
7475
"pre-commit": "^1.2.2",
75-
"prettier": "^1.17.1",
76-
"react": "^16.8.6",
77-
"react-dom": "^16.8.6",
78-
"react-hot-loader": "^4.8.8",
79-
"react-testing-library": "^7.0.1",
80-
"rollup": "^1.12.3",
81-
"rollup-plugin-babel": "^4.3.2",
82-
"rollup-plugin-node-resolve": "^5.0.0",
83-
"rollup-plugin-size-snapshot": "^0.8.0",
84-
"typescript": "^3.4.5"
76+
"prettier": "^1.18.2",
77+
"react": "^16.10.2",
78+
"react-dom": "^16.10.2",
79+
"react-hot-loader": "^4.12.14",
80+
"rollup": "^1.23.1",
81+
"rollup-plugin-babel": "^4.3.3",
82+
"rollup-plugin-node-resolve": "^5.2.0",
83+
"rollup-plugin-size-snapshot": "^0.10.0",
84+
"typescript": "^3.6.3"
8585
}
8686
}

src/Tooltip.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ class Tooltip extends Component<TooltipProps> {
1111
public static contextType = TooltipContext;
1212

1313
private observer?: MutationObserver;
14-
private tooltipRef = React.createRef<HTMLElement>();
14+
private tooltipRef!: HTMLElement | null;
1515

1616
public componentDidMount() {
1717
const {trigger} = this.props;
1818
const observer = (this.observer = new MutationObserver(() => {
1919
this.props.scheduleUpdate();
2020
}));
21-
observer.observe(this.tooltipRef.current!, MUTATION_OBSERVER_CONFIG);
21+
observer.observe(this.tooltipRef!, MUTATION_OBSERVER_CONFIG);
2222

2323
if (trigger !== 'none') {
2424
const {
@@ -84,10 +84,7 @@ class Tooltip extends Component<TooltipProps> {
8484
}
8585

8686
private handleOutsideClick?: EventListener = event => {
87-
if (
88-
this.tooltipRef.current &&
89-
!this.tooltipRef.current.contains(event.target as Node)
90-
) {
87+
if (this.tooltipRef && !this.tooltipRef.contains(event.target as Node)) {
9188
const {parentOutsideClickHandler} = this.context;
9289
const {hideTooltip, clearScheduled} = this.props;
9390

@@ -100,10 +97,7 @@ class Tooltip extends Component<TooltipProps> {
10097
};
10198

10299
private handleOutsideRightClick?: EventListener = event => {
103-
if (
104-
this.tooltipRef.current &&
105-
!this.tooltipRef.current.contains(event.target as Node)
106-
) {
100+
if (this.tooltipRef && !this.tooltipRef.contains(event.target as Node)) {
107101
const {parentOutsideRightClickHandler} = this.context;
108102
const {hideTooltip, clearScheduled} = this.props;
109103

@@ -138,8 +132,7 @@ class Tooltip extends Component<TooltipProps> {
138132
);
139133

140134
private getTooltipRef = (ref: HTMLElement | null) => {
141-
// @ts-ignore
142-
this.tooltipRef.current = ref;
135+
this.tooltipRef = ref;
143136
this.props.innerRef(ref);
144137
};
145138

tests/TooltipTrigger.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import {cleanup, fireEvent, render} from 'react-testing-library';
2+
import {fireEvent, render} from '@testing-library/react';
33
import TooltipTrigger from '../src';
44

55
interface BasicTooltipTriggerProps {
@@ -57,7 +57,6 @@ window.MutationObserver = class {
5757
};
5858

5959
jest.useFakeTimers();
60-
afterEach(cleanup);
6160

6261
it('matches snapshot', () => {
6362
render(

tests/__mocks__/popper.js.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// https://github.com/FezVrasta/popper.js/issues/478#issuecomment-341506071
2+
export default class Popper {
3+
constructor() {
4+
return {
5+
destroy: () => {},
6+
scheduleUpdate: () => {}
7+
};
8+
}
9+
}

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
66
"lib": [
77
"dom",
8-
"dom.iterable",
98
"esnext"
109
], /* Specify library files to be included in the compilation. */
1110
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -50,7 +49,7 @@
5049
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
5150
// "typeRoots": [], /* List of folders to include type definitions from. */
5251
// "types": [], /* Type declaration files to be included in compilation. */
53-
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
52+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
5453
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
5554
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
5655

0 commit comments

Comments
 (0)