Skip to content

refactor(remote-config)!: migrate to TypeScript#8972

Merged
mikehardy merged 39 commits intomainfrom
remote-config-ts
Apr 27, 2026
Merged

refactor(remote-config)!: migrate to TypeScript#8972
mikehardy merged 39 commits intomainfrom
remote-config-ts

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented Apr 13, 2026

Description

Breaking Changes

  • breaking: the primary modular remote-config types now use Firebase JS SDK names: LogLevel, FetchStatus, Value, and RemoteConfigSettings. types/remote-config.ts#L21-L37

  • breaking: RemoteConfig.settings is now typed as RemoteConfigSettings, which uses fetchTimeoutMillis rather than the older RNFB-style fetchTimeMillis on the modular surface. types/remote-config.ts#L34-L37 types/remote-config.ts#L55-L63

  • breaking: modular getAll() and getValue() now return SDK-aligned types: Record<string, Value> and Value. modular.ts#L91-L123

  • breaking: modular setLogLevel() now matches the Firebase JS SDK signature and returns void. modular.ts#L126-L133

  • breaking: the legacy modular helper exports fetchTimeMillis(), settings(), and lastFetchStatus() have been removed from @react-native-firebase/remote-config. Modular callers should read remoteConfig.fetchTimeMillis, remoteConfig.settings, and remoteConfig.lastFetchStatus from the RemoteConfig instance instead. types/remote-config.ts#L55-L63

  • breaking: modular fetch() has been removed. Modular callers should use fetchConfig(remoteConfig) instead; the RNFB-only modular expirationDurationSeconds helper is no longer part of the public modular API. modular.ts#L81-L86

  • breaking: modular setConfigSettings() and setDefaults() have been removed. Modular callers should use remoteConfig.settings = ... and remoteConfig.defaultConfig = ... on the RemoteConfig instance instead. types/remote-config.ts#L55-L63

  • breaking: modular onConfigUpdated() has been removed. Modular callers should use onConfigUpdate(remoteConfig, observer) instead. modular.ts#L165-L174 types/remote-config.ts#L39-L49

  • breaking: deprecated RemoteConfigValue.value and .source getters have been removed. Callers should use asString() and getSource() instead. 69ffd4c

  • breaking - Remove LastFetchStatus, ValueSource, ConfigSettings, ConfigDefaults, ConfigValue, ConfigValues, LastFetchStatusType, and RemoteConfigLogLevel from modular exports f22f19b

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@russellwheatley russellwheatley changed the title refactor(remote-config): add typescript package scaffolding refactor(remote-config): migrate to TypeScript Apr 13, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-firebase Error Error Apr 27, 2026 1:09am

Request Review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Remote Config package to use TypeScript and aligns its structure with the modular API of the Firebase JS SDK. Key changes include the introduction of comprehensive type definitions for internal, namespaced, and modular APIs, the implementation of modular API functions, and the adoption of react-native-builder-bob for the build process. Feedback was provided regarding the reset method implementation on iOS, suggesting a cleaner way to resolve the promise.

Comment thread packages/remote-config/lib/namespaced.ts Outdated
@russellwheatley russellwheatley changed the title refactor(remote-config): migrate to TypeScript refactor(remote-config)!: migrate to TypeScript Apr 14, 2026
…at still have methods (such as StorageReference) and fire console warning incorrectly
@russellwheatley russellwheatley marked this pull request as ready for review April 17, 2026 11:52
@mikehardy
Copy link
Copy Markdown
Collaborator

Updated to main and re-pushed to verify things still work since we're not using a merge queue here

release notes will come from the commit, so here's the draft of the commit message pulled from the description:


BREAKING CHANGE: remote-config types now match firebase-js-sdk as closely as possible

Please see https://rnfirebase.io/migrating-to-v25 for help migrating if needed

react-native-firebase has a goal to be a drop-in replacement for firebase-js-sdk, with native extensions and performance. It has always worked that way at the javascript level but the typescript types have been divergent

We are fixing that as we refactor to typescript. Please bear with us as we get closer to our goal of react-native-firebase matching firebase-js-sdk both in functionality where possible, but also in exact typescript typing.

Specifics for Remote Config:

  • the primary modular remote-config types now use Firebase JS SDK names: LogLevel, FetchStatus, Value, and RemoteConfigSettings
  • RemoteConfig.settings is now typed as RemoteConfigSettings, which uses fetchTimeoutMillis rather than the older RNFB-style fetchTimeMillis on the modular surface
  • modular getAll() and getValue() now return SDK-aligned types: Record<string, Value> and Value
  • modular setLogLevel() now matches the Firebase JS SDK signature and returns void
  • the legacy modular helper exports fetchTimeMillis(), settings(), and lastFetchStatus() have been removed from @react-native-firebase/remote-config. Modular callers should read remoteConfig.fetchTimeMillis, remoteConfig.settings, and remoteConfig.lastFetchStatus from the RemoteConfig instance instead
  • modular fetch() has been removed. Modular callers should use fetchConfig(remoteConfig) instead; the RNFB-only modular expirationDurationSeconds helper is no longer part of the public modular API
  • modular setConfigSettings() and setDefaults() have been removed. Modular callers should use remoteConfig.settings = ... and remoteConfig.defaultConfig = ... on the RemoteConfig instance instead
  • modular onConfigUpdated() has been removed. Modular callers should use onConfigUpdate(remoteConfig, observer) instead
  • deprecated RemoteConfigValue.value and .source getters have been removed. Callers should use asString() and getSource() instead
  • Remove LastFetchStatus, ValueSource, ConfigSettings, ConfigDefaults, ConfigValue, ConfigValues, LastFetchStatusType, and RemoteConfigLogLevel from modular exports

Copy link
Copy Markdown
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go to me, excellent!

}
return Reflect.get(target, prop, receiver);
},
set(target: any, prop: string | symbol, value: unknown, receiver: unknown) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you weren't wrong, this is an ever-deepening rabbit-hole of proxied introspective javascript trickery in order to emit these deprecation warnings - will be great when it's modular-only

Comment on lines +166 to +169
// To make Firebase web v9 API compatible, we update the settings first so it immediately
// updates settings on the instance. We then pass to underlying SDK to update. We do this because
// there is no way to "await" a setter. We can't delegate to `setConfigSettings()` as it is setup
// for native.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was curious how you were going to handle the lack of async on the properties, I think this is fair - restriction will go away with TurboModules in the future and in the present having it work consistently (if non-atomically) seems reasonable as a tradeoff

@mikehardy
Copy link
Copy Markdown
Collaborator

remote-config CI checks just passed (I'm watching real-time) - clear for merge

@mikehardy mikehardy merged commit 4625961 into main Apr 27, 2026
19 of 21 checks passed
@mikehardy mikehardy deleted the remote-config-ts branch April 27, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants