Skip to content

Commit

Permalink
Use platform native UUID generation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidje13 committed Oct 28, 2023
1 parent c81f147 commit 4dcb35b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 98 deletions.
20 changes: 0 additions & 20 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"pwd-hasher": "1.x",
"shared-reducer-backend": "3.x",
"tslib": "2.6.x",
"uuid": "9.x",
"websocket-express": "3.x",
"ws": "8.x"
},
Expand All @@ -36,7 +35,6 @@
"@rollup/plugin-typescript": "11.x",
"@tsconfig/strictest": "2.x",
"@types/node": "20.x",
"@types/uuid": "9.x",
"http-proxy-middleware": "2.x",
"lean-test": "2.x",
"prettier": "3.0.3",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/export/RetroJsonExport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4 } from 'uuid';
import { randomUUID } from 'node:crypto';
import {
type Retro,
type RetroData,
Expand Down Expand Up @@ -86,7 +86,7 @@ export function exportRetroItem(item: RetroItem): RetroItemJsonExport {

export function importRetroItem(item: RetroItemJsonExport): RetroItem {
return {
id: uuidv4(),
id: randomUUID(),
created: importTimestamp(item.created),
category: item.category,
group: item.group,
Expand Down
4 changes: 2 additions & 2 deletions backend/src/services/RetroArchiveService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4 } from 'uuid';
import { randomUUID } from 'node:crypto';
import { type Collection, type DB } from 'collection-storage';
import { encryptByRecordWithMasterKey } from '../import-wrappers/collection-storage-wrap';
import {
Expand Down Expand Up @@ -28,7 +28,7 @@ export class RetroArchiveService {
data: RetroData,
created?: number,
): Promise<string> {
const id = uuidv4();
const id = randomUUID();
const now = Date.now();

await this.archiveCollection.add({
Expand Down
4 changes: 2 additions & 2 deletions backend/src/services/RetroService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { randomUUID } from 'node:crypto';
import listCommands from 'json-immutability-helper/commands/list';
import { context, type Spec } from 'json-immutability-helper';
import { v4 as uuidv4 } from 'uuid';
import { type Collection, type DB } from 'collection-storage';
import {
encryptByRecordWithMasterKey,
Expand Down Expand Up @@ -93,7 +93,7 @@ export class RetroService {
format: string,
): Promise<string> {
validateSlug(slug);
const id = uuidv4();
const id = randomUUID();

try {
await this.retroCollection.add({
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/actions/retro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
type UserProvidedRetroItemDetails,
} from '../shared/api-entities';
import { type RetroDispatchSpec } from '../api/RetroTracker';
import { uuidv4 } from '../helpers/uuidv4';

const IRRELEVANT_WHITESPACE = /[ \t\v]+/g;
const PADDING = /^[ \r\n]+|[ \r\n]+$/g;
Expand Down Expand Up @@ -34,7 +33,7 @@ export const addRetroItem = (
}

const item: RetroItem = {
id: uuidv4(),
id: crypto.randomUUID(),
category,
group,
created: Date.now(),
Expand Down
68 changes: 0 additions & 68 deletions frontend/src/helpers/uuidv4.ts

This file was deleted.

0 comments on commit 4dcb35b

Please sign in to comment.