Skip to content

Commit daef06f

Browse files
authored
fix(deps): upgrade react-native-quick-base64 to v3 (#1046)
1 parent 698ab5b commit daef06f

7 files changed

Lines changed: 56 additions & 15 deletions

File tree

.agents/rules/code-typescript.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Applies to `*.ts` and `*.tsx`.
1717
- Write explicit return types.
1818
- Keep functions minimal and modular.
1919
- Use Bun for package management; do not use npm/yarn/pnpm.
20+
- In the example app's `package.json`, pin dependency versions exactly. No caret (`^`) or tilde (`~`) ranges. Applies to `dependencies` and `devDependencies`. Use the version `bun.lock` resolved.
21+
- Library `package.json` (under `packages/*`) may use ranges (`^`, `>=`) for `dependencies` and `peerDependencies` to allow consumer flexibility.
2022
- For React, minimize `useEffect`; use named effect functions if unavoidable.
2123

2224
## Formatting

.github/ISSUE_TEMPLATE/BUILD_ERROR.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ body:
4141
"react-native": "^0.74.3",
4242
"react-native-quick-crypto": "^0.7.1",
4343
"@craftzdog/react-native-buffer": "^6.0.5",
44-
"react-native-quick-base64": "^2.1.2",
44+
"react-native-quick-base64": "3.0.0",
4545
...
4646
},
4747
validations:

bun.lock

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

example/ios/Podfile.lock

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,8 +1869,34 @@ PODS:
18691869
- ReactCommon/turbomodule/core
18701870
- SocketRocket
18711871
- Yoga
1872-
- react-native-quick-base64 (2.2.2):
1872+
- react-native-quick-base64 (3.0.0):
1873+
- boost
1874+
- DoubleConversion
1875+
- fast_float
1876+
- fmt
1877+
- glog
1878+
- hermes-engine
1879+
- RCT-Folly
1880+
- RCT-Folly/Fabric
1881+
- RCTRequired
1882+
- RCTTypeSafety
18731883
- React-Core
1884+
- React-debug
1885+
- React-Fabric
1886+
- React-featureflags
1887+
- React-graphics
1888+
- React-ImageManager
1889+
- React-jsi
1890+
- React-NativeModulesApple
1891+
- React-RCTFabric
1892+
- React-renderercss
1893+
- React-rendererdebug
1894+
- React-utils
1895+
- ReactCodegen
1896+
- ReactCommon/turbomodule/bridging
1897+
- ReactCommon/turbomodule/core
1898+
- SocketRocket
1899+
- Yoga
18741900
- react-native-safe-area-context (5.6.2):
18751901
- boost
18761902
- DoubleConversion
@@ -2815,7 +2841,7 @@ SPEC CHECKSUMS:
28152841
NitroMmkv: afbc5b2fbf963be567c6c545aa1efcf6a9cec68e
28162842
NitroModules: 11bba9d065af151eae51e38a6425e04c3b223ff3
28172843
OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7
2818-
QuickCrypto: 3f1a7a649aa230cafd9b3576bdbc101bd10eb0ca
2844+
QuickCrypto: b6fed48151d7fef2b33e8420c660dde2b421c396
28192845
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
28202846
RCTDeprecation: c4b9e2fd0ab200e3af72b013ed6113187c607077
28212847
RCTRequired: e97dd5dafc1db8094e63bc5031e0371f092ae92a
@@ -2850,7 +2876,7 @@ SPEC CHECKSUMS:
28502876
React-Mapbuffer: 91e0eab42a6ae7f3e34091a126d70fc53bd3823e
28512877
React-microtasksnativemodule: 1ead4fe154df3b1ba34b5a9e35ef3c4bdfa72ccb
28522878
react-native-fast-encoder: f2728ab5e520601ba04df15716722941d941495e
2853-
react-native-quick-base64: 6568199bb2ac8e72ecdfdc73a230fbc5c1d3aac4
2879+
react-native-quick-base64: e5eea0a73474108a7b80e33ce2c004a414649da2
28542880
react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460
28552881
React-NativeModulesApple: eff2eba56030eb0d107b1642b8f853bc36a833ac
28562882
React-oscompat: b12c633e9c00f1f99467b1e0e0b8038895dae436

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"react-native-fast-encoder": "0.3.1",
4040
"react-native-mmkv": "4.0.1",
4141
"react-native-nitro-modules": "0.33.2",
42-
"react-native-quick-base64": "2.2.2",
42+
"react-native-quick-base64": "3.0.0",
4343
"react-native-quick-crypto": "workspace:*",
4444
"react-native-safe-area-context": "5.6.2",
4545
"react-native-screens": "4.18.0",

packages/react-native-quick-crypto/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"registry": "https://registry.npmjs.org/"
107107
},
108108
"dependencies": {
109-
"@craftzdog/react-native-buffer": "6.1.0",
109+
"@craftzdog/react-native-buffer": "^6.1.2",
110110
"events": "3.3.0",
111111
"readable-stream": "4.7.0",
112112
"safe-buffer": "^5.2.1",
@@ -131,7 +131,7 @@
131131
"react": "*",
132132
"react-native": "*",
133133
"react-native-nitro-modules": ">=0.31.2",
134-
"react-native-quick-base64": ">=2.1.0",
134+
"react-native-quick-base64": ">=3.0.0",
135135
"expo": ">=48.0.0",
136136
"expo-build-properties": "*"
137137
},

packages/react-native-quick-crypto/src/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
// polyfill imports
22
import { Buffer } from '@craftzdog/react-native-buffer';
3+
import { toByteArray, fromByteArray } from 'react-native-quick-base64';
4+
5+
declare global {
6+
// eslint-disable-next-line no-var
7+
var base64ToArrayBuffer: (
8+
s: string,
9+
removeLinebreaks?: boolean,
10+
) => ArrayBuffer;
11+
// eslint-disable-next-line no-var
12+
var base64FromArrayBuffer: (b: ArrayBuffer, urlSafe?: boolean) => string;
13+
}
314

415
// API imports
516
import * as argon2Module from './argon2';
@@ -66,9 +77,11 @@ export const install = () => {
6677
// @ts-expect-error subtle isn't fully implemented and Cryptokey is missing
6778
global.crypto = QuickCrypto;
6879

69-
// Install base64 globals (base64ToArrayBuffer, base64FromArrayBuffer)
70-
// eslint-disable-next-line @typescript-eslint/no-require-imports
71-
require('react-native-quick-base64');
80+
// react-native-quick-base64 v3 no longer installs these globals on import.
81+
global.base64ToArrayBuffer = (s, removeLinebreaks) =>
82+
toByteArray(s, removeLinebreaks).buffer as ArrayBuffer;
83+
global.base64FromArrayBuffer = (b, urlSafe) =>
84+
fromByteArray(new Uint8Array(b), urlSafe);
7285
};
7386

7487
// random, cipher, hash use nextTick

0 commit comments

Comments
 (0)