From af8545462820a7bbbbcf2fc6aaa33364aff4fe8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20=C3=98vernes?= Date: Mon, 5 Sep 2022 13:04:47 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=96Remove=20popperjs=20dependency=20(#246?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ➖removed popperjs dependency from core-react * ➖removed popperjs dependency from lab-react * 📝Marked usePopper as deprecated in eds-utils --- packages/eds-core-react/package.json | 1 - packages/eds-core-react/pnpm-lock.yaml | 3 +-- packages/eds-core-react/stories/utils/Utils.docs.mdx | 2 +- packages/eds-lab-react/package.json | 1 - packages/eds-lab-react/pnpm-lock.yaml | 5 +++-- packages/eds-utils/src/hooks/usePopper.ts | 1 + 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/eds-core-react/package.json b/packages/eds-core-react/package.json index 33a8e5c07e..f8a693a58a 100644 --- a/packages/eds-core-react/package.json +++ b/packages/eds-core-react/package.json @@ -103,7 +103,6 @@ "@equinor/eds-tokens": "workspace:*", "@equinor/eds-utils": "workspace:*", "@floating-ui/react-dom-interactions": "^0.6.6", - "@popperjs/core": "2.9.2", "downshift": "^6.1.7", "react-fast-compare": "3.2.0" }, diff --git a/packages/eds-core-react/pnpm-lock.yaml b/packages/eds-core-react/pnpm-lock.yaml index fc2e9a5568..ed67bfc16c 100644 --- a/packages/eds-core-react/pnpm-lock.yaml +++ b/packages/eds-core-react/pnpm-lock.yaml @@ -13,7 +13,6 @@ specifiers: '@equinor/eds-utils': workspace:* '@floating-ui/react-dom-interactions': ^0.6.6 '@mdx-js/react': 1.6.22 - '@popperjs/core': 2.9.2 '@rollup/plugin-babel': ^5.3.1 '@rollup/plugin-commonjs': ^22.0.0 '@rollup/plugin-node-resolve': ^13.3.0 @@ -63,7 +62,6 @@ dependencies: '@equinor/eds-tokens': link:../eds-tokens '@equinor/eds-utils': link:../eds-utils '@floating-ui/react-dom-interactions': 0.6.6_wsn53pslsboo2rytzocxzsur7i - '@popperjs/core': 2.9.2 downshift: 6.1.7_react@17.0.2 react-fast-compare: 3.2.0 @@ -2220,6 +2218,7 @@ packages: /@popperjs/core/2.9.2: resolution: {integrity: sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==} + dev: true /@rollup/plugin-babel/5.3.1_wkwocc4dsk7bd65om3dnrhmmbq: resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} diff --git a/packages/eds-core-react/stories/utils/Utils.docs.mdx b/packages/eds-core-react/stories/utils/Utils.docs.mdx index fc61a1a834..b083cf8280 100644 --- a/packages/eds-core-react/stories/utils/Utils.docs.mdx +++ b/packages/eds-core-react/stories/utils/Utils.docs.mdx @@ -99,7 +99,7 @@ function useOutsideClick( ``` ### usePopper - +#### ⚠️ DEPRECATED - this hook is no longer used internally and will be removed in a future version. Eds now uses [floating-ui](https://floating-ui.com/). A hook that wraps [react-popper](https://www.npmjs.com/package/react-popper). Used for positioning popup elements such as `Popover`, `Menu` and `Tooltip`. diff --git a/packages/eds-lab-react/package.json b/packages/eds-lab-react/package.json index dfdbb3b105..acaa1df8c5 100644 --- a/packages/eds-lab-react/package.json +++ b/packages/eds-lab-react/package.json @@ -105,7 +105,6 @@ "@equinor/eds-icons": "workspace:*", "@equinor/eds-tokens": "workspace:*", "@equinor/eds-utils": "workspace:*", - "@popperjs/core": "2.9.2", "date-fns": "^2.28.0", "downshift": "^6.1.7", "react-datepicker": "^4.7.0", diff --git a/packages/eds-lab-react/pnpm-lock.yaml b/packages/eds-lab-react/pnpm-lock.yaml index e02a3da70d..1c24b75f1c 100644 --- a/packages/eds-lab-react/pnpm-lock.yaml +++ b/packages/eds-lab-react/pnpm-lock.yaml @@ -13,7 +13,6 @@ specifiers: '@equinor/eds-tokens': workspace:* '@equinor/eds-utils': workspace:* '@mdx-js/react': 1.6.22 - '@popperjs/core': 2.9.2 '@rollup/plugin-babel': ^5.3.1 '@rollup/plugin-commonjs': ^22.0.0 '@rollup/plugin-node-resolve': ^13.3.0 @@ -66,7 +65,6 @@ dependencies: '@equinor/eds-icons': link:../eds-icons '@equinor/eds-tokens': link:../eds-tokens '@equinor/eds-utils': link:../eds-utils - '@popperjs/core': 2.9.2 date-fns: 2.28.0 downshift: 6.1.7_react@17.0.2 react-datepicker: 4.7.0_sfoxds7t5ydpegc3knd667wn6m @@ -4938,6 +4936,7 @@ packages: /bindings/1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + requiresBuild: true dependencies: file-uri-to-path: 1.0.0 dev: true @@ -6829,6 +6828,7 @@ packages: /file-uri-to-path/1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + requiresBuild: true dev: true optional: true @@ -9473,6 +9473,7 @@ packages: /nan/2.15.0: resolution: {integrity: sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==} + requiresBuild: true dev: true optional: true diff --git a/packages/eds-utils/src/hooks/usePopper.ts b/packages/eds-utils/src/hooks/usePopper.ts index 5a47bcc6a1..603245cc86 100644 --- a/packages/eds-utils/src/hooks/usePopper.ts +++ b/packages/eds-utils/src/hooks/usePopper.ts @@ -46,6 +46,7 @@ const autoWidthModifier = { }, } as PopperModifier +/** @deprecated This hook is no longer used internally and will be removed in a future version. */ export const usePopper = ({ anchorEl = null, popperEl = null,