-
Notifications
You must be signed in to change notification settings - Fork 937
SSR related improvements for RC client SDK. #8699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
18d1fd8
Add config option for templateId
fce5596
Update API to accept initial config as a part of getRemoteConfig options
da21142
split storage into indexeddeb storage and in-memory storage implement…
11c7252
split out storage impls
d1f6bfd
Initial pass at adding some tests
2bbe42f
rename and clean up a few things
d145636
clean up after merging main
2255b79
Run docgen
872be7f
run formatter
efab458
add changeset
7b76774
bump minor version
6898123
move FetchResponse types to public_types
62e1e84
extract custom signal merging logic to common function
551020e
run formatted again
edb7abe
Update comments after review
221d659
format and docgen
676627d
Add RemoteConfigOptions param doc comment
6756dfa
Mark options as optional
bb99031
format
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@firebase/remote-config': minor | ||
'firebase': minor | ||
--- | ||
|
||
Adds support for initial state hydration (from SSR contexts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
Project: /docs/reference/js/_project.yaml | ||
Book: /docs/reference/_book.yaml | ||
page_type: reference | ||
|
||
{% comment %} | ||
DO NOT EDIT THIS FILE! | ||
This is generated by the JS SDK team, and any local changes will be | ||
overwritten. Changes should be made in the source code at | ||
https://github.com/firebase/firebase-js-sdk | ||
{% endcomment %} | ||
|
||
# FetchResponse interface | ||
Defines a successful response (200 or 304). | ||
|
||
<p>Modeled after the native `Response` interface, but simplified for Remote Config's use case. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface FetchResponse | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [config](./remote-config.fetchresponse.md#fetchresponseconfig) | [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines the map of parameters returned as "entries" in the fetch response body.<p>Only defined for 200 responses. | | ||
| [eTag](./remote-config.fetchresponse.md#fetchresponseetag) | string | Defines the ETag response header value.<p>Only defined for 200 and 304 responses. | | ||
| [status](./remote-config.fetchresponse.md#fetchresponsestatus) | number | The HTTP status, which is useful for differentiating success responses with data from those without.<p>The Remote Config client is modeled after the native <code>Fetch</code> interface, so HTTP status is first-class.<p>Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. | | ||
|
||
## FetchResponse.config | ||
|
||
Defines the map of parameters returned as "entries" in the fetch response body. | ||
|
||
<p>Only defined for 200 responses. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
config?: FirebaseRemoteConfigObject; | ||
``` | ||
|
||
## FetchResponse.eTag | ||
|
||
Defines the ETag response header value. | ||
|
||
<p>Only defined for 200 and 304 responses. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
eTag?: string; | ||
``` | ||
|
||
## FetchResponse.status | ||
|
||
The HTTP status, which is useful for differentiating success responses with data from those without. | ||
|
||
<p>The Remote Config client is modeled after the native `Fetch` interface, so HTTP status is first-class. | ||
|
||
<p>Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
status: number; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Project: /docs/reference/js/_project.yaml | ||
Book: /docs/reference/_book.yaml | ||
page_type: reference | ||
|
||
{% comment %} | ||
DO NOT EDIT THIS FILE! | ||
This is generated by the JS SDK team, and any local changes will be | ||
overwritten. Changes should be made in the source code at | ||
https://github.com/firebase/firebase-js-sdk | ||
{% endcomment %} | ||
|
||
# FirebaseRemoteConfigObject interface | ||
Defines a self-descriptive reference for config key-value pairs. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface FirebaseRemoteConfigObject | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Project: /docs/reference/js/_project.yaml | ||
Book: /docs/reference/_book.yaml | ||
page_type: reference | ||
|
||
{% comment %} | ||
DO NOT EDIT THIS FILE! | ||
This is generated by the JS SDK team, and any local changes will be | ||
overwritten. Changes should be made in the source code at | ||
https://github.com/firebase/firebase-js-sdk | ||
{% endcomment %} | ||
|
||
# RemoteConfigOptions interface | ||
Options for Remote Config initialization. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface RemoteConfigOptions | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [initialFetchResponse](./remote-config.remoteconfigoptions.md#remoteconfigoptionsinitialfetchresponse) | [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Hydrates the state with an initial fetch response. | | ||
| [templateId](./remote-config.remoteconfigoptions.md#remoteconfigoptionstemplateid) | string | The ID of the template to use. If not provided, defaults to "firebase". | | ||
|
||
## RemoteConfigOptions.initialFetchResponse | ||
|
||
Hydrates the state with an initial fetch response. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
initialFetchResponse?: FetchResponse; | ||
``` | ||
|
||
## RemoteConfigOptions.templateId | ||
|
||
The ID of the template to use. If not provided, defaults to "firebase". | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
templateId?: string; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.