Skip to content

Commit 8f3461d

Browse files
authored
Merge pull request #160 from powersync-ja/remove-uuid-dependency
Remove uuid and react-native-get-random-values dependencies
2 parents 038e42a + 395ea24 commit 8f3461d

File tree

24 files changed

+50
-143
lines changed

24 files changed

+50
-143
lines changed

.changeset/heavy-dancers-drum.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@powersync/common': patch
3+
'@powersync/web': patch
4+
---
5+
6+
Remove uuid dependency

.changeset/proud-falcons-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/react-native': patch
3+
---
4+
5+
Remove react-native-get-random-values dependency

demos/angular-supabase-todolist/angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"object-hash",
2525
"event-iterator",
2626
"can-ndjson-stream",
27-
"uuid",
2827
"lodash",
2928
"js-logger",
3029
"websocket"

demos/django-react-native-todolist/library/stores/AbstractStore.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Needed to import early for uuids
2-
import 'react-native-get-random-values';
31
import _ from 'lodash';
42
import { action, makeObservable, observable } from 'mobx';
53
import { AbstractModel } from '../models/AbstractModel';

demos/django-react-native-todolist/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@react-navigation/drawer": "^6.6.15",
2020
"@react-navigation/native": "^6.1.17",
2121
"@supabase/supabase-js": "^2.42.4",
22-
"@types/react-native-get-random-values": "^1.8.2",
2322
"base-64": "^1.0.0",
2423
"expo": "~50.0.15",
2524
"expo-constants": "~15.4.5",
@@ -39,7 +38,6 @@
3938
"react-native-encrypted-storage": "^4.0.3",
4039
"react-native-fetch-api": "^3.0.0",
4140
"react-native-gesture-handler": "~2.14.1",
42-
"react-native-get-random-values": "~1.8.0",
4341
"react-native-polyfill-globals": "^3.1.0",
4442
"react-native-prompt-android": "^1.1.0",
4543
"react-native-reanimated": "~3.6.3",
@@ -52,7 +50,6 @@
5250
"react-navigation-stack": "^2.10.4",
5351
"text-encoding": "^0.7.0",
5452
"typed-async-storage": "^3.1.2",
55-
"uuid": "^9.0.1",
5653
"web-streams-polyfill": "^3.3.3"
5754
},
5855
"devDependencies": {

demos/example-electron/vite.renderer.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default defineConfig((env) => {
2626
// https://github.com/vitejs/vite/issues/11672#issuecomment-1415820673
2727
exclude: ['@journeyapps/wa-sqlite', '@powersync/web'],
2828
include: [
29-
'@powersync/web > uuid',
3029
'@powersync/web > event-iterator',
3130
'@powersync/web > js-logger',
3231
'@powersync/web > lodash/throttle',

demos/example-nextjs/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@
3333
"react-dom": "^18.2.0",
3434
"remixicon": "^2.5.0",
3535
"shiki": "^0.10.1",
36-
"simplify-js": "^1.2.4",
37-
"uuid": "9.0.1"
36+
"simplify-js": "^1.2.4"
3837
},
3938
"devDependencies": {
4039
"@types/lodash": "^4.14.202",
4140
"@types/node": "^20.11.25",
4241
"@types/react": "^18.2.64",
4342
"@types/react-dom": "^18.2.21",
44-
"@types/uuid": "9.0.8",
4543
"autoprefixer": "^10.4.18",
4644
"babel-loader": "^9.1.3",
4745
"css-loader": "^6.10.0",

demos/example-vite/vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export default defineConfig({
1919
// https://github.com/vitejs/vite/issues/11672#issuecomment-1415820673
2020
exclude: ['@journeyapps/wa-sqlite', '@powersync/web'],
2121
include: [
22-
'@powersync/web > uuid',
2322
'@powersync/web > event-iterator',
2423
'@powersync/web > js-logger',
2524
'@powersync/web > lodash/throttle',

demos/react-native-supabase-group-chat/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"react-native": "0.73.4",
5050
"react-native-fetch-api": "^3.0.0",
5151
"react-native-gesture-handler": "~2.14.1",
52-
"react-native-get-random-values": "~1.8.0",
5352
"react-native-pager-view": "6.2.3",
5453
"react-native-polyfill-globals": "^3.1.0",
5554
"react-native-reanimated": "~3.6.2",

demos/react-native-supabase-todolist/library/powersync/PhotoAttachmentQueue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as FileSystem from 'expo-file-system';
2-
import { v4 as uuid } from 'uuid';
2+
import { randomUUID } from 'expo-crypto';
33
import { AppConfig } from '../supabase/AppConfig';
44
import { AbstractAttachmentQueue, AttachmentRecord, AttachmentState } from '@powersync/attachments';
55
import { TODO_TABLE } from './AppSchema';
@@ -23,7 +23,7 @@ export class PhotoAttachmentQueue extends AbstractAttachmentQueue {
2323
}
2424

2525
async newAttachmentRecord(record?: Partial<AttachmentRecord>): Promise<AttachmentRecord> {
26-
const photoId = record?.id ?? uuid();
26+
const photoId = record?.id ?? randomUUID();
2727
const filename = record?.filename ?? `${photoId}.jpg`;
2828
return {
2929
id: photoId,

0 commit comments

Comments
 (0)