Skip to content

Commit

Permalink
replace use-subscription -> use-sync-external-store
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Oct 24, 2024
1 parent 15ef4a3 commit 79064c4
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 41 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/client/contexts/VideoConfContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRoom } from '@rocket.chat/core-typings';
import { createContext, useContext } from 'react';
import type { Subscription } from 'use-subscription';
import { useSubscription } from 'use-subscription';
import type { Subscription } from 'use-sync-external-store';
import { useSubscription } from 'use-sync-external-store';

import type { DirectCallData, ProviderCapabilities, CallPreferences, VideoConfManager } from '../lib/VideoConfManager';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/providers/VideoConfProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRoom } from '@rocket.chat/core-typings';
import type { ReactElement, ReactNode } from 'react';
import React, { useState, useMemo, useEffect } from 'react';
import type { Unsubscribe } from 'use-subscription';
import type { Unsubscribe } from 'use-sync-external-store';

import type { VideoConfPopupPayload } from '../contexts/VideoConfContext';
import { VideoConfContext } from '../contexts/VideoConfContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useTranslation, useUserPreference, useLayout, useSetting } from '@rocke
import { useMutation } from '@tanstack/react-query';
import type { ReactElement, MouseEventHandler, FormEvent, ClipboardEventHandler, MouseEvent } from 'react';
import React, { memo, useRef, useReducer, useCallback } from 'react';
import { useSubscription } from 'use-subscription';
import { useSubscription } from 'use-sync-external-store';

import { createComposerAPI } from '../../../../../app/ui-message/client/messageBox/createComposerAPI';
import type { FormattingButton } from '../../../../../app/ui-message/client/messageBox/messageBoxFormatting';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IconButton, Box, Margins } from '@rocket.chat/fuselage';
import { useSetting } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React, { memo } from 'react';
import { useSubscription } from 'use-subscription';
import { useSubscription } from 'use-sync-external-store';

import { getUserDisplayName } from '../../../../../lib/getUserDisplayName';
import { QuoteAttachment } from '../../../../components/message/content/attachments/QuoteAttachment';
Expand Down
2 changes: 0 additions & 2 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
"@types/supports-color": "~7.2.1",
"@types/textarea-caret": "^3.0.3",
"@types/ua-parser-js": "^0.7.39",
"@types/use-subscription": "^1.0.2",
"@types/use-sync-external-store": "^0.0.6",
"@types/uuid": "^8.3.4",
"@types/xml-crypto": "~1.4.6",
Expand Down Expand Up @@ -436,7 +435,6 @@
"underscore": "^1.13.7",
"universal-perf-hooks": "^1.0.1",
"url-polyfill": "^1.1.12",
"use-subscription": "~1.6.0",
"use-sync-external-store": "^1.2.2",
"uuid": "^8.3.2",
"webdav": "^4.11.4",
Expand Down
4 changes: 1 addition & 3 deletions apps/uikit-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"react-router-dom": "^6.11.2",
"react-split-pane": "^0.1.92",
"react-virtuoso": "^4.7.1",
"reactflow": "^11.7.2",
"use-subscription": "^1.8.2"
"reactflow": "^11.7.2"
},
"devDependencies": {
"@types/react": "~17.0.80",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "~17.0.25",
"@types/use-subscription": "^1.0.2",
"@typescript-eslint/eslint-plugin": "~5.60.1",
"@typescript-eslint/parser": "~5.60.1",
"@vitejs/plugin-react": "^4.0.0",
Expand Down
31 changes: 0 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9063,7 +9063,6 @@ __metadata:
"@types/supports-color": "npm:~7.2.1"
"@types/textarea-caret": "npm:^3.0.3"
"@types/ua-parser-js": "npm:^0.7.39"
"@types/use-subscription": "npm:^1.0.2"
"@types/use-sync-external-store": "npm:^0.0.6"
"@types/uuid": "npm:^8.3.4"
"@types/xml-crypto": "npm:~1.4.6"
Expand Down Expand Up @@ -9264,7 +9263,6 @@ __metadata:
underscore: "npm:^1.13.7"
universal-perf-hooks: "npm:^1.0.1"
url-polyfill: "npm:^1.1.12"
use-subscription: "npm:~1.6.0"
use-sync-external-store: "npm:^1.2.2"
uuid: "npm:^8.3.2"
webdav: "npm:^4.11.4"
Expand Down Expand Up @@ -10169,7 +10167,6 @@ __metadata:
"@types/react": "npm:~17.0.80"
"@types/react-beautiful-dnd": "npm:^13.1.8"
"@types/react-dom": "npm:~17.0.25"
"@types/use-subscription": "npm:^1.0.2"
"@typescript-eslint/eslint-plugin": "npm:~5.60.1"
"@typescript-eslint/parser": "npm:~5.60.1"
"@vitejs/plugin-react": "npm:^4.0.0"
Expand All @@ -10188,7 +10185,6 @@ __metadata:
react-virtuoso: "npm:^4.7.1"
reactflow: "npm:^11.7.2"
typescript: "npm:~5.6.3"
use-subscription: "npm:^1.8.2"
vite: "npm:^4.5.5"
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -13323,13 +13319,6 @@ __metadata:
languageName: node
linkType: hard

"@types/use-subscription@npm:^1.0.2":
version: 1.0.2
resolution: "@types/use-subscription@npm:1.0.2"
checksum: 10/e547d8ffdf8410c985c271a30903cd754687a6514a67192378213590f707a0f516e0c11930cba10bd7e98dc4f7917e066b3b8d37a622d02b6fcf3c5df530e467
languageName: node
linkType: hard

"@types/use-sync-external-store@npm:^0.0.6":
version: 0.0.6
resolution: "@types/use-sync-external-store@npm:0.0.6"
Expand Down Expand Up @@ -38012,26 +38001,6 @@ __metadata:
languageName: node
linkType: hard

"use-subscription@npm:^1.8.2":
version: 1.8.2
resolution: "use-subscription@npm:1.8.2"
dependencies:
use-sync-external-store: "npm:^1.2.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
checksum: 10/6b17f92a75405a4e6015d7762b459a43435f34d0bb9a72e512e305d6d3a61bd170e6666c3a62c2c3c7af1b7ba0b45c5a597b7eeea54c46e1cabf8ef0f971d44e
languageName: node
linkType: hard

"use-subscription@npm:~1.6.0":
version: 1.6.0
resolution: "use-subscription@npm:1.6.0"
peerDependencies:
react: ^18.0.0
checksum: 10/afce4295e439069d6139079c7c3a12ac3e6c4e81cd9b1622e62934e007d8cf2885f6aae5bd8de4f031d3eb5bd3cea2fd83d9be8c3da9542d4ba0a9de170be274
languageName: node
linkType: hard

"use-sync-external-store@npm:1.2.0":
version: 1.2.0
resolution: "use-sync-external-store@npm:1.2.0"
Expand Down

0 comments on commit 79064c4

Please sign in to comment.