Skip to content

Conversation

athiramanu
Copy link

@athiramanu athiramanu commented Sep 25, 2025

This change introduces experiment details in the response of fetch call in Remote Config. The change is split into 3 PRs where:

  1. Introduces the experiment details in the fetch response type
  2. Extracts experiments received from the fetch response and saves in indexedDB
  3. Sets the experiment and variant received as user property

This is 1/3 mentioned above

Design doc (internal): go/experiments-web

Copy link

changeset-bot bot commented Sep 25, 2025

⚠️ No Changeset found

Latest commit: 19c0fd6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 25, 2025

Size Report 1

Affected Products

  • @firebase/remote-config

    TypeBase (1bcf83d)Merge (9d75585)Diff
    browser39.0 kB39.1 kB+106 B (+0.3%)
    main40.2 kB40.4 kB+106 B (+0.3%)
    module39.0 kB39.1 kB+106 B (+0.3%)
  • bundle

    TypeBase (1bcf83d)Merge (9d75585)Diff
    remote-config (getAndFetch)59.4 kB59.5 kB+55 B (+0.1%)
  • firebase

    TypeBase (1bcf83d)Merge (9d75585)Diff
    firebase-compat.js809 kB809 kB+48 B (+0.0%)
    firebase-remote-config-compat.js38.7 kB38.7 kB+48 B (+0.1%)
    firebase-remote-config.js43.5 kB43.6 kB+48 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/pyk5jCF5mr.html

@athiramanu athiramanu requested a review from a team as a code owner September 25, 2025 05:43
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 25, 2025

Size Analysis Report 1

Affected Products

  • @firebase/remote-config

    • activate

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.5 kB23.6 kB+55 B (+0.2%)
      size-with-ext-deps50.0 kB50.1 kB+55 B (+0.1%)
    • ensureInitialized

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.1 kB23.2 kB+55 B (+0.2%)
      size-with-ext-deps49.6 kB49.7 kB+55 B (+0.1%)
    • fetchAndActivate

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size24.2 kB24.2 kB+55 B (+0.2%)
      size-with-ext-deps50.7 kB50.7 kB+55 B (+0.1%)
    • fetchConfig

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.7 kB23.8 kB+55 B (+0.2%)
      size-with-ext-deps50.2 kB50.3 kB+55 B (+0.1%)
    • getAll

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size24.3 kB24.4 kB+55 B (+0.2%)
      size-with-ext-deps50.8 kB50.9 kB+55 B (+0.1%)
    • getBoolean

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size24.2 kB24.2 kB+55 B (+0.2%)
      size-with-ext-deps50.7 kB50.7 kB+55 B (+0.1%)
    • getNumber

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size24.2 kB24.2 kB+55 B (+0.2%)
      size-with-ext-deps50.7 kB50.7 kB+55 B (+0.1%)
    • getRemoteConfig

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.9 kB24.0 kB+55 B (+0.2%)
      size-with-ext-deps57.3 kB57.4 kB+55 B (+0.1%)
    • getString

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size24.2 kB24.2 kB+55 B (+0.2%)
      size-with-ext-deps50.7 kB50.7 kB+55 B (+0.1%)
    • getValue

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size24.1 kB24.2 kB+55 B (+0.2%)
      size-with-ext-deps50.6 kB50.7 kB+55 B (+0.1%)
    • isSupported

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.3 kB23.3 kB+55 B (+0.2%)
      size-with-ext-deps49.7 kB49.8 kB+55 B (+0.1%)
    • onConfigUpdate

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.3 kB23.3 kB+55 B (+0.2%)
      size-with-ext-deps49.7 kB49.8 kB+55 B (+0.1%)
    • setCustomSignals

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.6 kB23.7 kB+55 B (+0.2%)
      size-with-ext-deps50.1 kB50.2 kB+55 B (+0.1%)
    • setLogLevel

      Size

      TypeBase (1bcf83d)Merge (9d75585)Diff
      size23.3 kB23.4 kB+55 B (+0.2%)
      size-with-ext-deps49.8 kB49.9 kB+55 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/iWLhXOAROh.html

@athiramanu athiramanu changed the title feat: Process experiment metadata in RC fetch response Process experiment metadata in RC fetch response Sep 25, 2025
@athiramanu athiramanu requested a review from hsubox76 September 25, 2025 18:28
export interface FetchResponse {
config?: FirebaseRemoteConfigObject;
eTag?: string;
// Warning: (ae-forgotten-export) The symbol "FirebaseExperimentDescription" needs to be exported by the entry point index.d.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I didn't look far enough up and see that this is part of FetchResponse, which is already public. In that case I guess we need to export FirebaseExperimentDescription as well. You can keep the documentation on it minimal if you don't expect users to have to populate it. I was trying to see why FetchResponse needs to be public and the only place I see it exposed to users is that they can specify a "initialFetchResponse" in RemoteConfigOptions when they initialize remote config but I don't know where they get that object from. I assume from server-side RC somewhere, and they just pass it in. So in that case they probably don't inspect it and probably don't need much documentation about what's in it, but since they're handling it and passing it, I guess they need a somewhat accurate typing for it.

I'll leave it up to you and your tech writer how much or how little documentation you think it needs but if FetchResponse needs to stay public, then we need to at least export the types of everything in it.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@athiramanu athiramanu requested a review from hsubox76 September 26, 2025 01:38
@athiramanu athiramanu merged commit 8ee4b72 into web-experiment Sep 27, 2025
34 checks passed
@athiramanu athiramanu deleted the web-exp-fetch branch September 27, 2025 11:12
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.

4 participants