Skip to content

Commit

Permalink
fix(scrollbar): removed core-js dependency (#145)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir Gevak <[email protected]>
  • Loading branch information
v-gevak and Vladimir Gevak authored Jul 14, 2022
1 parent fb83bab commit 72da859
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const addPackagesDir = config => {
rule.oneOf.forEach(nestedRule => {
if (nestedRule.loader && nestedRule.loader.includes('babel-loader')) {
nestedRule.include.push(path.resolve(__dirname, '../packages'));
nestedRule.include.push(path.resolve(__dirname, '../node_modules/simplebar'));

if (isIeMode && nestedRule.options && nestedRule.options.presets) {
nestedRule.options.sourceType = 'unambiguous';
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"@popperjs/core": "^2.3.3",
"classnames": "^2.2.6",
"compute-scroll-into-view": "^1.0.13",
"core-js": "^3.0.1",
"date-fns": "^2.16.1",
"downshift": "^5.4.7",
"element-closest": "^3.0.2",
Expand All @@ -86,7 +85,7 @@
"react-transition-group": "^4.4.1",
"react-virtual": "^2.3.2",
"recharts": "^2.1.2",
"simplebar": "^5.3.6",
"simplebar": "^5.3.8",
"swiper": "^6.8.2",
"react-virtuoso": "^2.12.0",
"text-mask-core": "^5.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/scrollbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"@juggle/resize-observer": "^3.3.1",
"can-use-dom": "^0.1.0",
"classnames": "^2.2.6",
"core-js": "^3.0.1",
"lodash.debounce": "^4.0.8",
"lodash.memoize": "^4.1.2",
"lodash.throttle": "^4.1.1",
"react-merge-refs": "1.1.0"
"react-merge-refs": "1.1.0",
"simplebar": "^5.3.8"
},
"devDependencies": {
"@types/lodash.throttle": "^4.1.7"
Expand Down
2 changes: 1 addition & 1 deletion packages/scrollbar/src/Component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { HTMLAttributes, useEffect, useRef } from 'react';
import cn from 'classnames';
import mergeRefs from 'react-merge-refs';
import SimpleBar from 'simplebar/dist/simplebar-core.esm';
import SimpleBar from 'simplebar/src/simplebar';
import throttle from 'lodash.throttle';

import styles from './index.module.css';
Expand Down
7 changes: 1 addition & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ const baseConfig = {
'!src/**/*.d.ts',
],
plugins: [wildcardExternal(['@alfalab/core-components-*/*'])],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
/(core-js).+/,
],
plugins: [wildcardExternal(['@alfalab/core-components-*/*'])],
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
};

const multiInputPlugin = multiInput();
Expand Down
2 changes: 1 addition & 1 deletion typings/simplebar.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
declare module 'simplebar/dist/simplebar-core.esm' {
declare module 'simplebar/src/simplebar' {
declare namespace SimpleBar {
interface KnownClassNamesOptions {
contentEl?: string;
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23143,7 +23143,7 @@ simple-swizzle@^0.2.2:
dependencies:
is-arrayish "^0.3.1"

simplebar@^5.3.6:
simplebar@^5.3.8:
version "5.3.8"
resolved "https://registry.yarnpkg.com/simplebar/-/simplebar-5.3.8.tgz#4c133596780756a8170682d7fd8bfd23ea5220ab"
integrity sha512-LOHjyOcihx++zFN+vuktoZBGpCarFCtHIVDWXOf2VELbGDknq3Hw/sddafRp1aCg123VNkHWOFHUDHYEXAtufQ==
Expand Down

0 comments on commit 72da859

Please sign in to comment.