Skip to content

Commit aa30bdb

Browse files
authored
chore: add optional dependency support for expo CLI and improved docs (#2027)
* chore: add optional dependency suppport for expo CLI and improved docs * fix: vale linting errors * fix: vale linting errors * chore: update yarn.lock file * fix: update yarn.lock file * refactor: remove redundant sampleapp change * docs: fix native_handlers.mdx version info in link * docs: fix getting_started.mdx version info in link * refactor: setClipboardString usage
1 parent 6c447dd commit aa30bdb

File tree

23 files changed

+759
-1456
lines changed

23 files changed

+759
-1456
lines changed

.styles/Vocab/Base/accept.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ npm
3535
Notifee
3636
colorScheme
3737
performant
38-
virtualized
38+
virtualized
39+
rncli
40+
RNCLI

docusaurus/docs/reactnative/basics/getting_started.mdx

Lines changed: 118 additions & 135 deletions
Large diffs are not rendered by default.

docusaurus/docs/reactnative/customization/native_handlers.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ An `async` function that compresses an image and returns the local `uri` of the
4141

4242
**Expo:** [`expo-image-manipulator`](https://docs.expo.io/versions/latest/sdk/imagemanipulator/)
4343

44+
### `setClipboardString`
45+
46+
An function to copy strings or text in the message.
47+
48+
**React Native:** [`react-native-clipboard`](https://github.com/react-native-clipboard/clipboard)
49+
50+
**Expo:** [`expo-clipboard`](https://docs.expo.dev/versions/latest/sdk/clipboard/)
51+
4452
### `deleteFile`
4553

4654
A function that deletes a file at a given local `uri`.

examples/ExpoMessaging/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@
1515
"expo": "~47.0.9",
1616
"expo-av": "~13.0.2",
1717
"expo-blur": "~12.0.1",
18-
"expo-clipboard": "~4.0.1",
19-
"expo-document-picker": "~11.0.1",
2018
"expo-file-system": "~15.1.1",
21-
"expo-haptics": "~12.0.1",
2219
"expo-image-manipulator": "~11.0.0",
2320
"expo-image-picker": "~14.0.2",
2421
"expo-media-library": "~15.0.0",
25-
"expo-sharing": "~11.0.1",
2622
"expo-splash-screen": "~0.17.5",
2723
"expo-status-bar": "~1.4.2",
2824
"react": "18.1.0",

examples/ExpoMessaging/yarn.lock

Lines changed: 135 additions & 156 deletions
Large diffs are not rendered by default.

examples/SampleApp/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ EXTERNAL SOURCES:
838838
SPEC CHECKSUMS:
839839
boost: a7c83b31436843459a1961bfd74b96033dc77234
840840
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
841-
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
841+
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
842842
FBLazyVector: a6454570f573a0f6f1d397e5a95c13e8e45d1700
843843
FBReactNativeSpec: 09e8dfba44487e5dc4882a9f5318cde67549549c
844844
Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
@@ -859,7 +859,7 @@ SPEC CHECKSUMS:
859859
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
860860
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
861861
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
862-
glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85
862+
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
863863
GoogleAds-IMA-iOS-SDK: b01284e3bf3d64ba948de6692ffda531452c3713
864864
GoogleAppMeasurement: 4c19f031220c72464d460c9daa1fb5d1acce958e
865865
GoogleDataTransport: 1c8145da7117bd68bbbed00cf304edb6a24de00f

package/expo-package/package.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,33 @@
2121
"expo-image-manipulator": "*",
2222
"expo-image-picker": ">=14.1.0",
2323
"expo-media-library": "*",
24-
"expo-sharing": "*"
24+
"expo-sharing": "*",
25+
"expo-av": "*"
26+
},
27+
"peerDependenciesMeta": {
28+
"expo-av": {
29+
"optional": true
30+
},
31+
"expo-clipboard": {
32+
"optional": true
33+
},
34+
"expo-document-picker": {
35+
"optional": true
36+
},
37+
"expo-sharing": {
38+
"optional": true
39+
},
40+
"expo-haptics": {
41+
"optional": true
42+
}
2543
},
2644
"devDependencies": {
2745
"@react-native-community/netinfo": "^6.0.0",
2846
"expo": "^44.0.0",
29-
"expo-av": "^12.0.4",
30-
"expo-clipboard": "^3.1.0",
31-
"expo-document-picker": "^9.1.2",
3247
"expo-file-system": "^11.0.2",
33-
"expo-haptics": "^10.0.0",
3448
"expo-image-manipulator": "^9.1.0",
35-
"expo-image-picker": "14.1.1",
36-
"expo-media-library": "^12.0.2",
37-
"expo-sharing": "^9.1.2"
49+
"expo-image-picker": "^14.1.1",
50+
"expo-media-library": "^12.0.2"
3851
},
3952
"scripts": {
4053
"prepack": " cp ../../README.md .",

package/expo-package/src/handlers/Sound.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
import type { AVPlaybackSource, AVPlaybackStatus, AVPlaybackStatusToSet } from 'expo-av';
2-
31
import { AudioComponent } from '../optionalDependencies/Video';
42

53
export const Sound = {
64
initializeSound: AudioComponent
7-
? async (
8-
source: AVPlaybackSource,
9-
initialStatus: AVPlaybackStatusToSet,
10-
onPlaybackStatusUpdate: (playbackStatus: AVPlaybackStatus) => void,
11-
) => {
5+
? async (source, initialStatus, onPlaybackStatusUpdate: (playbackStatus) => void) => {
126
const { sound } = await AudioComponent.Sound.createAsync(
137
source,
148
initialStatus,

package/expo-package/src/handlers/Video.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VideoComponent } from '../optionalDependencies/Video';
1+
import { VideoComponent } from '../optionalDependencies';
22

33
export const Video = VideoComponent
44
? ({ onPlaybackStatusUpdate, paused, resizeMode, style, uri, videoRef }) => (

package/expo-package/src/handlers/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ export * from './deleteFile';
33
export * from './getLocalAssetUri';
44
export * from './getPhotos';
55
export * from './NetInfo';
6-
export * from './pickDocument';
76
export * from './saveFile';
8-
export * from './setClipboardString';
9-
export * from './shareImage';
107
export * from './Sound';
118
export * from './takePhoto';
12-
export * from './triggerHaptic';
139
export * from './Video';
1410
export * from './oniOS14GalleryLibrarySelectionChange';

0 commit comments

Comments
 (0)