Skip to content

Commit 07c6012

Browse files
committed
refactor: Remove uuid dependency and replace with crypto.randomUUID
1 parent d2ff824 commit 07c6012

File tree

5 files changed

+5
-24
lines changed

5 files changed

+5
-24
lines changed

package-lock.json

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
"react-number-format": "^5.4.4",
7373
"react-redux": "^8.1.3",
7474
"react-router-dom": "^6.22.3",
75-
"throttle-debounce": "^5.0.2",
76-
"uuid": "^11.1.0"
75+
"throttle-debounce": "^5.0.2"
7776
},
7877
"devDependencies": {
7978
"@pega/configs": "^0.7.1",

packages/react-sdk-components/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"react-datepicker": "^4.25.0",
3232
"react-number-format": "^5.4.4",
3333
"react-redux": "^8.1.3",
34-
"throttle-debounce": "^5.0.2",
35-
"uuid": "^11.1.0"
34+
"throttle-debounce": "^5.0.2"
3635
},
3736
"devDependencies": {
3837
"@pega/pcore-pconnect-typedefs": "~3.2.2"

packages/react-sdk-components/src/components/infra/DashboardFilter/DashboardFilter.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-shadow */
22
import { forwardRef, PropsWithChildren, useEffect, useRef, useState } from 'react';
33
import { TextField } from '@mui/material';
4-
import { v4 as uuidv4 } from 'uuid';
54
import { debounce } from 'throttle-debounce';
65
import DatePicker from 'react-datepicker';
76

@@ -20,7 +19,7 @@ interface DashboardFilterProps extends PConnProps {
2019

2120
export default function DashboardFilter(props: PropsWithChildren<DashboardFilterProps>) {
2221
const { children, name, filterProp, type = '', metadata = null, getPConnect } = props;
23-
const { current: filterId } = useRef(uuidv4());
22+
const { current: filterId } = useRef(crypto.randomUUID());
2423

2524
const [startDate, setStartDate] = useState(null);
2625
const [endDate, setEndDate] = useState(null);

packages/react-sdk-components/src/components/template/DefaultForm/utils/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { v4 as uuidv4 } from 'uuid';
2-
31
export const mapStateToProps: any = (_, ownProps) => {
42
const { getPConnect } = ownProps;
53

@@ -24,5 +22,5 @@ export const getKeyForMappedField = field => {
2422
return JSON.stringify(pConnect.meta);
2523
}
2624

27-
return uuidv4();
25+
return crypto.randomUUID();
2826
};

0 commit comments

Comments
 (0)