Skip to content

change(rc): deprecate RemoteConfigFetchResponse and FetchResponseData - #3302

Open
ritiktaneja wants to merge 4 commits into
firebase:mainfrom
ritiktaneja:chore/rc-deprecate-fetch-response
Open

ritiktaneja wants to merge 4 commits into
firebase:mainfrom
ritiktaneja:chore/rc-deprecate-fetch-response

Conversation

@ritiktaneja

Copy link
Copy Markdown

Remote Config server-side rendering (SSR) hydration of the client SDK has been deprecated; the backend rejects client fetches of server templates, and the JS SDK is deprecating templateId/initialFetchResponse in parallel.

  • Mark RemoteConfigFetchResponse and FetchResponseData @deprecated (to be removed in the next major release).
  • Log a one-time console warning when RemoteConfigFetchResponse is constructed.
  • No changes to getServerTemplate / initServerTemplate / evaluate().

@ritiktaneja
ritiktaneja requested a review from a team November 2, 2026 07:40

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

Copy link
Copy Markdown
Contributor

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 deprecates the FetchResponseData interface and the RemoteConfigFetchResponse class in the Remote Config module, adding deprecation warnings and corresponding unit tests. The feedback points out that using a global module-level variable to track the warning state makes unit tests order-dependent and fragile. It is recommended to refactor this state into a static property on the RemoteConfigFetchResponse class and reset it in the test suite's beforeEach hook to ensure test isolation.

Comment thread src/remote-config/remote-config.ts Resolved
Comment thread src/remote-config/remote-config.ts Resolved
Comment on lines +1590 to +1592
beforeEach(() => {
warnStub = sinon.stub(console, 'warn');
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Reset the static deprecationWarned property on RemoteConfigFetchResponse before each test to ensure that tests are completely isolated and independent of execution order.

Suggested change
beforeEach(() => {
warnStub = sinon.stub(console, 'warn');
});
beforeEach(() => {
warnStub = sinon.stub(console, 'warn');
(RemoteConfigFetchResponse as any).deprecationWarned = false;
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@ritiktaneja
ritiktaneja force-pushed the chore/rc-deprecate-fetch-response branch from 7f45b94 to 50b56ea Compare November 3, 2026 10:20
Comment thread src/remote-config/remote-config.ts Resolved

@tusharkhandelwal8 tusharkhandelwal8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved, but apply the suggested changes if required.

Comment on lines +1590 to +1592
beforeEach(() => {
warnStub = sinon.stub(console, 'warn');
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

Ritik Taneja added 2 commits November 11, 2026 11:32
…sponseData

Remote Config server-side rendering (SSR) hydration of the client SDK
has been deprecated; the backend rejects client fetches of server
templates, and the JS SDK is deprecating templateId/initialFetchResponse
in parallel.

- Mark RemoteConfigFetchResponse and FetchResponseData @deprecated
  (to be removed in the next major release).
- Log a one-time console warning when RemoteConfigFetchResponse is
  constructed.
- No changes to getServerTemplate / initServerTemplate / evaluate().
…ng flag

Moves the one-time warning flag from module scope to a private static
property on RemoteConfigFetchResponse and resets it in the test's
beforeEach, so the warning test no longer depends on execution order.
@ritiktaneja
ritiktaneja force-pushed the chore/rc-deprecate-fetch-response branch from 17e4c6a to 4abf33e Compare November 11, 2026 06:03
@lahirumaramba
lahirumaramba requested review from hsubox76 and removed request for hsubox76 November 12, 2026 20:07

@lahirumaramba lahirumaramba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @ritiktaneja! Overall this looks good. Added a couple of quick questions and a minor nit.

Comment thread src/remote-config/remote-config.ts Resolved
*
* @deprecated Remote Config server-side rendering (SSR) hydration of the
* client SDK is no longer supported. This type will be removed in the
* next major release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we get a TW review on these new deprecation docstrings, and would it help to mention an alternative or link a migration guide if one exists?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@nk-1983 can I ask you to review this whenever you're available?

Comment thread src/remote-config/remote-config.ts Resolved
@lahirumaramba lahirumaramba changed the title chore(remote-config): deprecate RemoteConfigFetchResponse and FetchResponseData change(rc): deprecate RemoteConfigFetchResponse and FetchResponseData Nov 12, 2026
@ritiktaneja
ritiktaneja requested a review from nk-1983 November 13, 2026 07:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants