Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
053dc3b
feat: tsconfig for storage
russellwheatley Jan 8, 2026
7ebedb9
package.json
russellwheatley Jan 8, 2026
22367cf
deleted old declaration files
russellwheatley Jan 8, 2026
6c24d19
chore: storage types
russellwheatley Jan 8, 2026
c6ba689
fix: task type
russellwheatley Jan 8, 2026
d4f35a5
chore: modular, namespaced, types and index
russellwheatley Jan 8, 2026
30e1642
convert the rest of the src files to TS
russellwheatley Jan 8, 2026
65b4e23
update web implementation
russellwheatley Jan 8, 2026
db33fe1
type-test
russellwheatley Jan 8, 2026
38185fc
Merge branch 'main' into storage-typescript
russellwheatley Jan 8, 2026
e225e38
remove type declarations from tsconfig root
russellwheatley Jan 8, 2026
aa82bda
remove js files
russellwheatley Jan 8, 2026
6997262
remove another js file
russellwheatley Jan 8, 2026
1eaae1a
fix: dependencies
russellwheatley Jan 8, 2026
ba4cdd6
fix: types and create storage private type
russellwheatley Jan 8, 2026
3abfb9e
chore: remove statics that are added at runtime via app
russellwheatley Jan 9, 2026
3219fbc
fix: update type
russellwheatley Jan 9, 2026
074f261
fix: web types
russellwheatley Jan 9, 2026
e09276a
fix: remove any and ignore
russellwheatley Jan 9, 2026
e2b1a53
fix: storage reference and list types
russellwheatley Jan 9, 2026
a84f1f4
fix: metadata
russellwheatley Jan 9, 2026
4ac3778
refactor: improve types to match existing and update StorageTask
russellwheatley Jan 12, 2026
e9a80d9
Merge branch 'main' into storage-typescript
russellwheatley Feb 2, 2026
0c3bfcd
yarn.lock
russellwheatley Feb 2, 2026
79f0e8e
fix: tsconfig paths
russellwheatley Feb 2, 2026
8f34cb5
fix(web): use types from firebase-js-sdk
russellwheatley Feb 2, 2026
f3711ea
fix: update package.json to match others after publish issues
russellwheatley Feb 2, 2026
2b72c0e
chore: license header
russellwheatley Feb 2, 2026
563524d
fix: internal types and remove any type
russellwheatley Feb 2, 2026
c352849
fix: remove unknown types
russellwheatley Feb 2, 2026
37daabe
fix: types in utils
russellwheatley Feb 2, 2026
0ffafc1
fix: update any to settablemetadata
russellwheatley Feb 2, 2026
0298e44
test: update jest paths
russellwheatley Feb 2, 2026
fd92732
chore: temp fix to ios workflow
russellwheatley Feb 2, 2026
77bc17b
chore: remove modular export
russellwheatley Feb 2, 2026
9c6b102
Merge branch 'main' into storage-typescript
russellwheatley Feb 3, 2026
813ebd8
fix: do not initialise property as null
russellwheatley Feb 3, 2026
ee5637f
fix: storage task observers
russellwheatley Feb 3, 2026
0caa7af
chore: example app for storage
russellwheatley Feb 3, 2026
b692b74
refactor: remove incorrect types from modular storage instance
russellwheatley Feb 10, 2026
b67e302
refactor: move namespaced types into own types file
russellwheatley Feb 10, 2026
6cddd31
chore: move export
russellwheatley Feb 10, 2026
b023354
chore:update exports
russellwheatley Feb 10, 2026
727fd15
refactor: keep index.d.ts as deprecated namespaced types
russellwheatley Feb 10, 2026
0b76f4b
chore: deprecate all namespaced types
russellwheatley Feb 10, 2026
720ca44
chore: remove usage of ReactNativeFirebase for modular exports
russellwheatley Feb 10, 2026
f826a6d
refactor: move ref methods to internal type
russellwheatley Feb 10, 2026
0431796
refactor: rename to StorageReference
russellwheatley Feb 10, 2026
d36c23d
fix: remove ts-ignore and augment modular deprecation arg
russellwheatley Feb 10, 2026
1654e46
chore: rename as StorageReferenceInternal
russellwheatley Feb 10, 2026
f2478aa
refactor: rename StorageReference to Reference
russellwheatley Feb 10, 2026
a57a0c7
chore: type as StorageReference
russellwheatley Feb 10, 2026
95a189f
fix: duplicate symbols
russellwheatley Feb 10, 2026
05775df
refactor: ListOptions match JS SDK for modular api
russellwheatley Feb 10, 2026
733e8fb
refactor: update ListResult to match firebase-js-sdk
russellwheatley Feb 10, 2026
a792650
refactor: SettableMetadata, UploadMetadata & FullMetadata. Also using…
russellwheatley Feb 10, 2026
f409528
refactor: TaskState and TaskEvent
russellwheatley Feb 10, 2026
4adb561
refactor: remove storage statics from modular
russellwheatley Feb 10, 2026
585a17d
fix: namespaced storage types
russellwheatley Feb 10, 2026
b22be10
refactor: Task related API to match firebase-js-sdk
russellwheatley Feb 11, 2026
3720376
Merge branch 'main' into storage-typescript
russellwheatley Feb 12, 2026
d323d5c
fix: should use Module for namespaced API
russellwheatley Feb 12, 2026
7940e32
fix: remove modular types from namespaced
russellwheatley Feb 12, 2026
c5a03fb
test: fix tests now class name has changed
russellwheatley Feb 12, 2026
e5fd9d8
test: fix typedoc generation
russellwheatley Feb 12, 2026
f10b05b
test: fix e2e tests
russellwheatley Feb 12, 2026
bd4f4bf
podfile.lock
russellwheatley Feb 12, 2026
cb465de
format
russellwheatley Feb 12, 2026
a582dfb
test: need to await test now as underlying logic awaits response
russellwheatley Feb 12, 2026
c5a36ac
chore: remove unknown conversions
russellwheatley Feb 12, 2026
195cbc7
refactor: add types to this.native
russellwheatley Feb 16, 2026
04746ab
refactor: give native method types, clean up public types
russellwheatley Feb 16, 2026
7bd47e7
fix: static runtime and types need to live in same file
russellwheatley Feb 16, 2026
d79423d
test: fix jest so it can find common types
russellwheatley Feb 16, 2026
b34366a
fix: fix tsconfig.json to tsc compile
russellwheatley Feb 16, 2026
f49dbdd
ci: create a script for checking RN types with firebase-js-sdk
russellwheatley Feb 26, 2026
e488ddf
fix: normalise types in parse
russellwheatley Feb 26, 2026
cb50f09
docs: update compare-types with README documentation
russellwheatley Feb 26, 2026
f66e0ce
ci: add workflow for comparing types
russellwheatley Feb 26, 2026
61278b7
chore: comment out remote-config
russellwheatley Feb 27, 2026
19bf8c9
chore: initial draft of comparing storage to firebase-js-sdk
russellwheatley Feb 27, 2026
e36025b
chore: comment out remote-config until merged
russellwheatley Feb 27, 2026
6377520
refactor: rename back to FirebaseStorage
russellwheatley Feb 27, 2026
c404f85
chore: update .gitignore
russellwheatley Feb 27, 2026
ca5b975
fix: use FirebaseStorage for StorageReference
russellwheatley Feb 27, 2026
2f88123
fix: throw error if types are now matching and api still in config.ts
russellwheatley Feb 27, 2026
5ab6782
chore: move EmulatorMockTokenOptions to different shape
russellwheatley Feb 27, 2026
0c5e4bc
chore: update README with more information on comparison script
russellwheatley Feb 27, 2026
4888620
chore:remove missing API from config
russellwheatley Feb 27, 2026
599b48c
Merge branch 'main' into storage-typescript
russellwheatley Mar 2, 2026
861d486
chore: tsconfig change for analyser script
russellwheatley Mar 2, 2026
873d6fb
Merge branch 'main' into storage-typescript
russellwheatley Mar 5, 2026
1c9945b
refactor!: use ref() instead of refFromUrl like firebase-js-sdk
russellwheatley Mar 5, 2026
4a166f1
refactor!: remove toString() modular to match JS SDK. use ref.toStrin…
russellwheatley Mar 5, 2026
0d521f1
refactor!: remove child(), use ref() instead to match JS
russellwheatley Mar 5, 2026
afed46b
chore: use overloads instead
russellwheatley Mar 5, 2026
58b0ab7
chore: remove duplicate overload
russellwheatley Mar 5, 2026
7a7c5ff
refactor!: make ListOptions.pageToken nullable like JS SDK
russellwheatley Mar 5, 2026
c9d5115
Merge branch 'main' into storage-typescript
russellwheatley Mar 26, 2026
29ab0b8
chore: format
russellwheatley Mar 26, 2026
0e5557e
chore: format
russellwheatley Mar 26, 2026
ea00568
fix: reuse logic in modular to maintain underlying implementation wit…
russellwheatley Mar 26, 2026
d04f064
chore: update sdk type path to array of strings
russellwheatley Mar 30, 2026
3ee0a27
Merge branch 'main' into storage-typescript
russellwheatley Apr 9, 2026
e9f464b
test(ios): patch fmt pod transitive dep to 12.1.0 for Xcode 26.4
mikehardy Apr 7, 2026
3a98dfe
fix: modular deprecation warnings firing because we have instances th…
russellwheatley Apr 9, 2026
a1d4bb6
fix: ref() so that url and path are passed to correct underlying method
russellwheatley Apr 10, 2026
3e6eda3
fix: if url is encoded, decode before checking if url
russellwheatley Apr 10, 2026
64a8ea1
test: update e2e test
russellwheatley Apr 10, 2026
2230f1b
test: fix unit tests so they actually test namespaced v modular
russellwheatley Apr 10, 2026
233805f
fix: isUrl is private function
russellwheatley Apr 10, 2026
f8ddfd6
chore: add api not covered in RNFB
russellwheatley Apr 10, 2026
6d0e1fe
format
russellwheatley Apr 10, 2026
52929ca
chore: remove dead code
russellwheatley Apr 10, 2026
f2d3bc4
refactor!: update upload api to use UploadMetadata and deprecate md5h…
russellwheatley Apr 10, 2026
23e2be4
test: update e2e tests using md5Hash (captial H on Hash)
russellwheatley Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 210 additions & 0 deletions .github/scripts/compare-types/packages/storage/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
/**
* Known differences between the firebase-js-sdk @firebase/storage public
* API and the @react-native-firebase/storage modular API.
*
* Each entry must have a `name` (the export name) and a `reason` explaining
* why the difference exists. Any difference NOT listed here will cause CI to
* fail so that new drift is caught and deliberately acknowledged.
*
* Sections:
* nameMapping — exports that exist in both packages but under different names
* missingInRN — firebase-js-sdk exports absent from RN Firebase
* extraInRN — RN Firebase exports not present in the firebase-js-sdk
* differentShape — exports present in both but with differing signatures/members
*/

import type { PackageConfig } from '../../src/types';

const config: PackageConfig = {
// ---------------------------------------------------------------------------
// Name mapping
// ---------------------------------------------------------------------------
nameMapping: {},

// ---------------------------------------------------------------------------
// Missing in RN Firebase
// ---------------------------------------------------------------------------
missingInRN: [
{
name: 'StorageError',
reason:
'RN Firebase surfaces Storage failures as `NativeFirebaseError` instances from ' +
'`@react-native-firebase/app` rather than exporting the firebase-js-sdk web ' +
'`StorageError` subclass.',
},
{
name: 'StorageErrorCode',
reason:
'RN Firebase does not export the firebase-js-sdk `StorageErrorCode` enum. ' +
'Errors instead expose native bridge `code` strings via `NativeFirebaseError`.',
},
],

// ---------------------------------------------------------------------------
// Extra in RN Firebase
// ---------------------------------------------------------------------------
extraInRN: [
{
name: 'setMaxOperationRetryTime',
reason:
'RN Firebase-specific function for setting the maximum retry time for ' +
'non-upload/download operations on Android and iOS. The firebase-js-sdk ' +
'exposes this as a writable property on the `FirebaseStorage` instance.',
},
{
name: 'setMaxUploadRetryTime',
reason:
'RN Firebase-specific function for setting the maximum upload retry time ' +
'on Android and iOS. The firebase-js-sdk exposes this as a writable property ' +
'on the `FirebaseStorage` instance.',
},
{
name: 'setMaxDownloadRetryTime',
reason:
'RN Firebase-specific function for setting the maximum download retry time ' +
'on Android and iOS. No direct equivalent exists in the firebase-js-sdk.',
},
{
name: 'putFile',
reason:
'RN Firebase-specific function that uploads a file from a local device path. ' +
'No equivalent exists in the firebase-js-sdk web API.',
},
{
name: 'writeToFile',
reason:
'RN Firebase-specific function that downloads a file to a local device path. ' +
'No equivalent exists in the firebase-js-sdk web API.',
},
{
name: 'TaskSnapshot',
reason:
'RN Firebase-specific interface extending `UploadTaskSnapshot` with an optional ' +
'`error` field for native task error state. No equivalent in the firebase-js-sdk.',
},
{
name: 'TaskResult',
reason:
'RN Firebase type alias for `UploadResult`, kept for API consistency with the ' +
'native task system. No direct equivalent in the firebase-js-sdk.',
},
{
name: 'TaskSnapshotObserver',
reason:
'RN Firebase type alias for `StorageObserver<TaskSnapshot>`. ' +
'No direct equivalent in the firebase-js-sdk.',
},
{
name: 'Task',
reason:
'RN Firebase type alias for `UploadTask`, used as the return type of ' +
'`uploadBytesResumable`, `uploadString`, `putFile`, and `writeToFile`. ' +
'Kept for consistency with the native task system.',
},
{
name: 'Subscribe',
reason:
'RN Firebase-specific generic type for task event subscription functions. ' +
'No direct equivalent in the firebase-js-sdk public API.',
},
{
name: 'NativeFirebaseError',
reason:
'Re-export of the RN Firebase native bridge error type used in place of ' +
'`StorageError` / `FirebaseError`. No equivalent in the firebase-js-sdk.',
},
],

// ---------------------------------------------------------------------------
// Different shape
// ---------------------------------------------------------------------------
differentShape: [
{
name: 'FirebaseStorage',
reason:
'RN Firebase adds a `maxDownloadRetryTime` property (android & iOS only) ' +
'not present in the firebase-js-sdk `FirebaseStorage`. Additionally, ' +
'`maxUploadRetryTime` and `maxOperationRetryTime` are declared `readonly` ' +
'in RN Firebase (they are set via dedicated modular functions) whereas the ' +
'firebase-js-sdk declares them as mutable properties.',
},
{
name: 'StorageObserver',
reason:
'The `error` callback parameter uses `NativeFirebaseError` instead of ' +
'`StorageError`. Both represent Firebase Storage errors but the RN type ' +
'extends the native bridge error structure.',
},
{
name: 'UploadTask',
reason:
'RN Firebase returns `Promise<boolean>` from `cancel()`, `pause()`, and ' +
'`resume()` to communicate asynchronously with the native iOS/Android modules, ' +
'whereas the firebase-js-sdk returns a synchronous `boolean`. Error callback ' +
'types also use `NativeFirebaseError` instead of `StorageError`.',
},
{
name: 'EmulatorMockTokenOptions',
reason:
'The firebase-js-sdk `EmulatorMockTokenOptions` (from `@firebase/util`) is a ' +
'complex type `({ user_id: string } | { sub: string }) & Partial<FirebaseIdToken>` ' +
'representing a full mock JWT payload. RN Firebase defines a simplified version ' +
'`{ mockUserToken?: string | null }` that only accepts a pre-encoded token string, ' +
'since the native bridge does not need to construct JWT payloads directly.',
},
{
name: 'connectStorageEmulator',
reason:
'The optional `options` parameter type differs: the firebase-js-sdk accepts ' +
'`{ mockUserToken?: EmulatorMockTokenOptions | string }` (an inline object ' +
'literal) while RN Firebase accepts its own `EmulatorMockTokenOptions` interface.',
},
{
name: 'getStream',
reason:
'Returns `NodeJS.ReadableStream` in RN Firebase instead of `ReadableStream` ' +
'(the Web Streams API type). The Node.js stream type is used because the ' +
'React Native environment does not have the Web Streams API.',
},
{
name: 'uploadBytes',
reason:
'Returns `Promise<TaskResult>` in RN Firebase instead of `Promise<UploadResult>`. ' +
'`TaskResult` is a type alias for `UploadResult`, so the runtime shape is identical; ' +
'the different name is for consistency with the native task system.',
},
{
name: 'uploadBytesResumable',
reason:
'Returns `Task` in RN Firebase instead of `UploadTask`. `Task` is a type alias ' +
'for `UploadTask`, so the runtime shape is identical; the different name is for ' +
'consistency with the native task system.',
},
{
name: 'uploadString',
reason:
'Returns `Task` in RN Firebase instead of `Promise<UploadResult>` — the upload ' +
'is resumable via the native task system. The `format` parameter is typed as an ' +
"explicit string union `'raw' | 'base64' | 'base64url' | 'data_url'` instead of " +
'the `StringFormat` type alias, which is semantically identical.',
},
{
name: 'TaskEvent',
reason:
"The firebase-js-sdk declares `TaskEvent` as a string literal type `'state_changed'`. " +
'RN Firebase declares it as a const object `{ STATE_CHANGED: "state_changed" }` and ' +
'derives the type via `(typeof TaskEvent)[keyof typeof TaskEvent]`. Both resolve to ' +
"the same value `'state_changed'` at runtime.",
},
{
name: 'TaskState',
reason:
'The firebase-js-sdk declares `TaskState` as a string literal union. RN Firebase ' +
'declares it as a const object and derives the type via ' +
'`(typeof TaskState)[keyof typeof TaskState]`. The RN const additionally includes ' +
"a `CANCELLED` alias (with double-L) for `'canceled'` for backwards compatibility.",
},
],
};

export default config;
Loading
Loading