diff --git a/package.json b/package.json index f5039710aa..052310f446 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "react-dropzone": "10.1.7", "react-hot-loader": "4.12.11", "react-measure": "2.3.0", - "react-popper": "1.3.3", + "react-popper": "1.3.7", "react-redux": "7.1.0", "react-router-dom": "5.0.1", "react-sortable-hoc": "1.9.1", @@ -140,10 +140,10 @@ "fbjs/isomorphic-fetch/node-fetch": "https://github.com/scottnonnenberg-signal/node-fetch.git#3e5f51e08c647ee5f20c43b15cf2d352d61c36b4" }, "devDependencies": { - "@babel/core": "7.5.5", + "@babel/core": "7.7.7", "@babel/plugin-proposal-class-properties": "7.7.4", - "@babel/preset-react": "7.0.0", - "@babel/preset-typescript": "7.3.3", + "@babel/preset-react": "7.7.4", + "@babel/preset-typescript": "7.7.7", "@storybook/addon-actions": "5.1.11", "@storybook/addon-knobs": "5.1.11", "@storybook/addons": "5.1.11", @@ -192,6 +192,7 @@ "babel-plugin-lodash": "3.3.4", "bower": "1.8.2", "chai": "4.1.2", + "core-js": "^2.4.0", "cross-env": "5.2.0", "css-loader": "3.2.0", "dashdash": "1.14.1", diff --git a/ts/components/Avatar.tsx b/ts/components/Avatar.tsx index 260e2b24fd..a19256e57e 100644 --- a/ts/components/Avatar.tsx +++ b/ts/components/Avatar.tsx @@ -17,7 +17,7 @@ export interface Props { onClick?: () => unknown; // Matches Popper's RefHandler type - innerRef?: (ref: HTMLElement | null) => void; + innerRef?: React.Ref; i18n: LocalizerType; } diff --git a/ts/components/AvatarPopup.tsx b/ts/components/AvatarPopup.tsx index 24faf7917f..ab37cc52b4 100644 --- a/ts/components/AvatarPopup.tsx +++ b/ts/components/AvatarPopup.tsx @@ -12,7 +12,7 @@ export type Props = { onViewArchive: () => unknown; // Matches Popper's RefHandler type - innerRef?: (ref: HTMLElement | null) => void; + innerRef?: React.Ref; style: React.CSSProperties; } & AvatarProps; diff --git a/ts/components/CompositionInput.tsx b/ts/components/CompositionInput.tsx index 8dab07a6fc..86a37f6368 100644 --- a/ts/components/CompositionInput.tsx +++ b/ts/components/CompositionInput.tsx @@ -16,7 +16,7 @@ import { } from 'draft-js'; import Measure, { ContentRect } from 'react-measure'; import { Manager, Popper, Reference } from 'react-popper'; -import { get, head, noop, trimEnd } from 'lodash'; +import { get, head, isFunction, noop, trimEnd } from 'lodash'; import classNames from 'classnames'; import emojiRegex from 'emoji-regex'; import { Emoji } from './emoji/Emoji'; @@ -188,16 +188,16 @@ const compositeDecorator = new CompositeDecorator([ }, ]); -type FunctionRef = (el: HTMLElement | null) => unknown; - // A selector which combines multiple react refs into a single, referentially-equal functional ref. const combineRefs = createSelector( - (r1: FunctionRef) => r1, - (_r1: any, r2: FunctionRef) => r2, + (r1: React.Ref) => r1, + (_r1: any, r2: React.Ref) => r2, (_r1: any, _r2: any, r3: React.MutableRefObject) => r3, (r1, r2, r3) => (el: HTMLDivElement) => { - r1(el); - r2(el); + if (isFunction(r1) && isFunction(r2)) { + r1(el); + r2(el); + } r3.current = el; } ); diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index dcdbe47593..854963d131 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -2564,6 +2564,240 @@ "reasonCategory": "falseMatch", "updated": "2019-12-11T01:10:06.091Z" }, + { + "rule": "jQuery-$(", + "path": "node_modules/create-react-context/node_modules/core-js/build/index.js", + "line": " if (name.indexOf(ns + \".\") === 0 && !in$(name, experimental)) {", + "lineNumber": 43, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-$(", + "path": "node_modules/create-react-context/node_modules/core-js/build/index.js", + "line": " function in$(x, xs){", + "lineNumber": 93, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/core.js", + "line": "\t return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", + "lineNumber": 1082, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/core.js", + "line": "\t symbolStatics[it] = useNative ? sym : wrap(sym);", + "lineNumber": 1135, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/core.js", + "line": "\t setTimeout: wrap(global.setTimeout),", + "lineNumber": 4496, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/library.js", + "line": "\t return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", + "lineNumber": 1033, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/library.js", + "line": "\t symbolStatics[it] = useNative ? sym : wrap(sym);", + "lineNumber": 1086, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/library.js", + "line": "\t setTimeout: wrap(global.setTimeout),", + "lineNumber": 4136, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/shim.js", + "line": "\t return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", + "lineNumber": 1068, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/shim.js", + "line": "\t symbolStatics[it] = useNative ? sym : wrap(sym);", + "lineNumber": 1121, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/client/shim.js", + "line": "\t setTimeout: wrap(global.setTimeout),", + "lineNumber": 4482, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/library/modules/es6.symbol.js", + "line": " return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", + "lineNumber": 142, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/library/modules/es6.symbol.js", + "line": " symbolStatics[it] = useNative ? sym : wrap(sym);", + "lineNumber": 195, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/library/modules/web.timers.js", + "line": " setTimeout: wrap(global.setTimeout),", + "lineNumber": 18, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/modules/es6.symbol.js", + "line": " return wrap(uid(arguments.length > 0 ? arguments[0] : undefined));", + "lineNumber": 142, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/modules/es6.symbol.js", + "line": " symbolStatics[it] = useNative ? sym : wrap(sym);", + "lineNumber": 195, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/create-react-context/node_modules/core-js/modules/web.timers.js", + "line": " setTimeout: wrap(global.setTimeout),", + "lineNumber": 18, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "fbjs-createNodesFromMarkup", + "path": "node_modules/create-react-context/node_modules/fbjs/lib/createNodesFromMarkup.js", + "line": "function createNodesFromMarkup(markup, handleScript) {", + "lineNumber": 51, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "fbjs-createNodesFromMarkup", + "path": "node_modules/create-react-context/node_modules/fbjs/lib/createNodesFromMarkup.js", + "line": " !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;", + "lineNumber": 53, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "DOM-innerHTML", + "path": "node_modules/create-react-context/node_modules/fbjs/lib/createNodesFromMarkup.js", + "line": " node.innerHTML = wrap[1] + markup + wrap[2];", + "lineNumber": 58, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "DOM-innerHTML", + "path": "node_modules/create-react-context/node_modules/fbjs/lib/createNodesFromMarkup.js", + "line": " node.innerHTML = markup;", + "lineNumber": 65, + "reasonCategory": "falseMatch", + "updated": "2020-01-06T20:40:04.973Z", + "reasonDetail": "" + }, + { + "rule": "fbjs-createNodesFromMarkup", + "path": "node_modules/create-react-context/node_modules/fbjs/lib/createNodesFromMarkup.js", + "line": " !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected