From 35682fd56ce985bd96966b551039fb0aba6ab20a Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 5 Apr 2020 21:57:17 +0200 Subject: [PATCH 1/2] [core] Avoid popper.js warning --- packages/material-ui/package.json | 2 +- packages/material-ui/src/Popper/Popper.d.ts | 2 +- packages/material-ui/src/Popper/Popper.js | 4 ++-- packages/material-ui/src/Popper/Popper.spec.tsx | 2 +- packages/material-ui/src/Popper/Popper.test.js | 6 +++--- yarn.lock | 10 +++++----- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/material-ui/package.json b/packages/material-ui/package.json index 79abdb6b2fef2b..feebd6ca434071 100644 --- a/packages/material-ui/package.json +++ b/packages/material-ui/package.json @@ -48,6 +48,7 @@ }, "dependencies": { "@babel/runtime": "^7.4.4", + "@material-ui/popper.js": "^1.16.0", "@material-ui/styles": "^4.9.6", "@material-ui/system": "^4.9.6", "@material-ui/types": "^5.0.0", @@ -55,7 +56,6 @@ "@types/react-transition-group": "^4.2.0", "clsx": "^1.0.2", "hoist-non-react-statics": "^3.3.2", - "popper.js": "^1.14.1", "prop-types": "^15.7.2", "react-is": "^16.8.0", "react-transition-group": "^4.3.0" diff --git a/packages/material-ui/src/Popper/Popper.d.ts b/packages/material-ui/src/Popper/Popper.d.ts index 9161a861b12fd1..4f051672f28d24 100644 --- a/packages/material-ui/src/Popper/Popper.d.ts +++ b/packages/material-ui/src/Popper/Popper.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import PopperJs, { ReferenceObject } from 'popper.js'; +import PopperJs, { ReferenceObject } from '@material-ui/popper.js'; import { PortalProps } from '../Portal'; import { TransitionProps } from '../transitions/transition'; diff --git a/packages/material-ui/src/Popper/Popper.js b/packages/material-ui/src/Popper/Popper.js index 6cbc3139b6ff6f..39de85976a6d7e 100644 --- a/packages/material-ui/src/Popper/Popper.js +++ b/packages/material-ui/src/Popper/Popper.js @@ -1,6 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import PopperJS from 'popper.js'; +import PopperJs from '@material-ui/popper.js'; import { chainPropTypes, refType } from '@material-ui/utils'; import { useTheme } from '@material-ui/styles'; import Portal from '../Portal'; @@ -123,7 +123,7 @@ const Popper = React.forwardRef(function Popper(props, ref) { } } - const popper = new PopperJS(getAnchorEl(anchorEl), tooltipRef.current, { + const popper = new PopperJs(getAnchorEl(anchorEl), tooltipRef.current, { placement: rtlPlacement, ...popperOptions, modifiers: { diff --git a/packages/material-ui/src/Popper/Popper.spec.tsx b/packages/material-ui/src/Popper/Popper.spec.tsx index e2649419fe84bb..1f5edbc6923c56 100644 --- a/packages/material-ui/src/Popper/Popper.spec.tsx +++ b/packages/material-ui/src/Popper/Popper.spec.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Tooltip from '@material-ui/core/Tooltip'; -import PopperJs from 'popper.js'; +import PopperJs from '@material-ui/popper.js'; interface Props { children: React.ReactElement; diff --git a/packages/material-ui/src/Popper/Popper.test.js b/packages/material-ui/src/Popper/Popper.test.js index a45468fb7c5292..36a73168bae19d 100644 --- a/packages/material-ui/src/Popper/Popper.test.js +++ b/packages/material-ui/src/Popper/Popper.test.js @@ -7,7 +7,7 @@ import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; import consoleErrorMock from 'test/utils/consoleErrorMock'; -import PopperJS from 'popper.js'; +import PopperJs from '@material-ui/popper.js'; import Grow from '../Grow'; import Popper from './Popper'; @@ -238,12 +238,12 @@ describe('', () => { const ref1 = React.createRef(); const ref2 = React.createRef(); const wrapper = mount(); - assert.strictEqual(ref1.current instanceof PopperJS, true); + assert.strictEqual(ref1.current instanceof PopperJs, true); wrapper.setProps({ popperRef: ref2, }); assert.strictEqual(ref1.current, null); - assert.strictEqual(ref2.current instanceof PopperJS, true); + assert.strictEqual(ref2.current instanceof PopperJs, true); }); }); diff --git a/yarn.lock b/yarn.lock index 3f241d404edee7..b03ec18b5ff7ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2017,6 +2017,11 @@ react-transition-group "^4.0.0" rifm "^0.7.0" +"@material-ui/popper.js@^1.16.0": + version "1.16.0" + resolved "https://registry.yarnpkg.com/@material-ui/popper.js/-/popper.js-1.16.0.tgz#7d6b00edb406610fe20f9ea94796738417ea817b" + integrity sha512-2NvFNg7lLt6xt3mrprgiqLAgR9eYgMhM3yKQGMlxyP0j41iHyOITK3ecBPFtxtp/3EvAoLMfi7ZOgtEPhcK6mg== + "@material-ui/react-transition-group@^4.2.0": version "4.2.0" resolved "https://registry.yarnpkg.com/@material-ui/react-transition-group/-/react-transition-group-4.2.0.tgz#afec833bbcc79f05a9b4d4828b3e07965cc7e321" @@ -12406,11 +12411,6 @@ pnp-webpack-plugin@1.5.0: dependencies: ts-pnp "^1.1.2" -popper.js@^1.14.1: - version "1.16.0" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.0.tgz#2e1816bcbbaa518ea6c2e15a466f4cb9c6e2fbb3" - integrity sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw== - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" From e800daf4453ef4d3a7eb817fca54218b9cb58f82 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 6 Apr 2020 17:48:32 +0200 Subject: [PATCH 2/2] [core] Use lts --- packages/material-ui/package.json | 2 +- packages/material-ui/src/Popper/Popper.d.ts | 2 +- packages/material-ui/src/Popper/Popper.js | 2 +- packages/material-ui/src/Popper/Popper.spec.tsx | 2 +- packages/material-ui/src/Popper/Popper.test.js | 2 +- yarn.lock | 10 +++++----- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/material-ui/package.json b/packages/material-ui/package.json index feebd6ca434071..e682bb751bf62c 100644 --- a/packages/material-ui/package.json +++ b/packages/material-ui/package.json @@ -48,7 +48,6 @@ }, "dependencies": { "@babel/runtime": "^7.4.4", - "@material-ui/popper.js": "^1.16.0", "@material-ui/styles": "^4.9.6", "@material-ui/system": "^4.9.6", "@material-ui/types": "^5.0.0", @@ -56,6 +55,7 @@ "@types/react-transition-group": "^4.2.0", "clsx": "^1.0.2", "hoist-non-react-statics": "^3.3.2", + "popper.js": "^1.16.1-lts", "prop-types": "^15.7.2", "react-is": "^16.8.0", "react-transition-group": "^4.3.0" diff --git a/packages/material-ui/src/Popper/Popper.d.ts b/packages/material-ui/src/Popper/Popper.d.ts index 4f051672f28d24..9161a861b12fd1 100644 --- a/packages/material-ui/src/Popper/Popper.d.ts +++ b/packages/material-ui/src/Popper/Popper.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import PopperJs, { ReferenceObject } from '@material-ui/popper.js'; +import PopperJs, { ReferenceObject } from 'popper.js'; import { PortalProps } from '../Portal'; import { TransitionProps } from '../transitions/transition'; diff --git a/packages/material-ui/src/Popper/Popper.js b/packages/material-ui/src/Popper/Popper.js index 39de85976a6d7e..1c492a2ce08cd9 100644 --- a/packages/material-ui/src/Popper/Popper.js +++ b/packages/material-ui/src/Popper/Popper.js @@ -1,6 +1,6 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import PopperJs from '@material-ui/popper.js'; +import PopperJs from 'popper.js'; import { chainPropTypes, refType } from '@material-ui/utils'; import { useTheme } from '@material-ui/styles'; import Portal from '../Portal'; diff --git a/packages/material-ui/src/Popper/Popper.spec.tsx b/packages/material-ui/src/Popper/Popper.spec.tsx index 1f5edbc6923c56..e2649419fe84bb 100644 --- a/packages/material-ui/src/Popper/Popper.spec.tsx +++ b/packages/material-ui/src/Popper/Popper.spec.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Tooltip from '@material-ui/core/Tooltip'; -import PopperJs from '@material-ui/popper.js'; +import PopperJs from 'popper.js'; interface Props { children: React.ReactElement; diff --git a/packages/material-ui/src/Popper/Popper.test.js b/packages/material-ui/src/Popper/Popper.test.js index 36a73168bae19d..d78d906c201b5d 100644 --- a/packages/material-ui/src/Popper/Popper.test.js +++ b/packages/material-ui/src/Popper/Popper.test.js @@ -7,7 +7,7 @@ import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; import consoleErrorMock from 'test/utils/consoleErrorMock'; -import PopperJs from '@material-ui/popper.js'; +import PopperJs from 'popper.js'; import Grow from '../Grow'; import Popper from './Popper'; diff --git a/yarn.lock b/yarn.lock index b03ec18b5ff7ce..ef7c94ce296c44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2017,11 +2017,6 @@ react-transition-group "^4.0.0" rifm "^0.7.0" -"@material-ui/popper.js@^1.16.0": - version "1.16.0" - resolved "https://registry.yarnpkg.com/@material-ui/popper.js/-/popper.js-1.16.0.tgz#7d6b00edb406610fe20f9ea94796738417ea817b" - integrity sha512-2NvFNg7lLt6xt3mrprgiqLAgR9eYgMhM3yKQGMlxyP0j41iHyOITK3ecBPFtxtp/3EvAoLMfi7ZOgtEPhcK6mg== - "@material-ui/react-transition-group@^4.2.0": version "4.2.0" resolved "https://registry.yarnpkg.com/@material-ui/react-transition-group/-/react-transition-group-4.2.0.tgz#afec833bbcc79f05a9b4d4828b3e07965cc7e321" @@ -12411,6 +12406,11 @@ pnp-webpack-plugin@1.5.0: dependencies: ts-pnp "^1.1.2" +popper.js@^1.16.1-lts: + version "1.16.1" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" + integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"