-
Notifications
You must be signed in to change notification settings - Fork 927
Remote Config Modularization #3975
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
Conversation
Size Analysis ReportAffected Products
|
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 10.4 kB | ? (?) |
size_with_ext_deps | ? | 27.0 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 9 depsactivate asRemoteConfigImpl ensureInitialized getUserLanguage isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 6 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache |
? |
variables | ? | Click to show 10 depsAPP_NAMESPACE_STORE DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
ensureInitialized
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 10.0 kB | ? (?) |
size_with_ext_deps | ? | 26.7 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 7 depsensureInitialized getUserLanguage isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 6 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache |
? |
variables | ? | Click to show 10 depsAPP_NAMESPACE_STORE DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
fetchAndActivate
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 11.0 kB | ? (?) |
size_with_ext_deps | ? | 27.6 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 12 depsactivate asRemoteConfigImpl ensureInitialized fetchAndActivate fetchConfig getUserLanguage hasErrorCode isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RemoteConfigAbortSignal RestClient RetryingClient Storage StorageCache |
? |
variables | ? | Click to show 10 depsAPP_NAMESPACE_STORE DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
fetchConfig
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 10.6 kB | ? (?) |
size_with_ext_deps | ? | 27.3 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 10 depsasRemoteConfigImpl ensureInitialized fetchConfig getUserLanguage hasErrorCode isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RemoteConfigAbortSignal RestClient RetryingClient Storage StorageCache |
? |
variables | ? | Click to show 10 depsAPP_NAMESPACE_STORE DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
getAll
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 11.2 kB | ? (?) |
size_with_ext_deps | ? | 27.9 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 11 depsasRemoteConfigImpl ensureInitialized getAll getAllKeys getUserLanguage getValue isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache Value |
? |
variables | ? | Click to show 14 depsAPP_NAMESPACE_STORE BOOLEAN_TRUTHY_VALUES DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS DEFAULT_VALUE_FOR_BOOLEAN DEFAULT_VALUE_FOR_NUMBER DEFAULT_VALUE_FOR_STRING ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
getBoolean
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 11.1 kB | ? (?) |
size_with_ext_deps | ? | 27.7 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 10 depsasRemoteConfigImpl ensureInitialized getBoolean getUserLanguage getValue isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache Value |
? |
variables | ? | Click to show 14 depsAPP_NAMESPACE_STORE BOOLEAN_TRUTHY_VALUES DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS DEFAULT_VALUE_FOR_BOOLEAN DEFAULT_VALUE_FOR_NUMBER DEFAULT_VALUE_FOR_STRING ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
getNumber
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 11.1 kB | ? (?) |
size_with_ext_deps | ? | 27.7 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 10 depsasRemoteConfigImpl ensureInitialized getNumber getUserLanguage getValue isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache Value |
? |
variables | ? | Click to show 14 depsAPP_NAMESPACE_STORE BOOLEAN_TRUTHY_VALUES DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS DEFAULT_VALUE_FOR_BOOLEAN DEFAULT_VALUE_FOR_NUMBER DEFAULT_VALUE_FOR_STRING ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
getRemoteConfig
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 10.1 kB | ? (?) |
size_with_ext_deps | ? | 26.7 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 8 depsensureInitialized getRemoteConfig getUserLanguage isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 6 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache |
? |
variables | ? | Click to show 10 depsAPP_NAMESPACE_STORE DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _getProvider _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
getString
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 11.1 kB | ? (?) |
size_with_ext_deps | ? | 27.7 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 10 depsasRemoteConfigImpl ensureInitialized getString getUserLanguage getValue isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache Value |
? |
variables | ? | Click to show 14 depsAPP_NAMESPACE_STORE BOOLEAN_TRUTHY_VALUES DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS DEFAULT_VALUE_FOR_BOOLEAN DEFAULT_VALUE_FOR_NUMBER DEFAULT_VALUE_FOR_STRING ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
getValue
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 11.0 kB | ? (?) |
size_with_ext_deps | ? | 27.7 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 9 depsasRemoteConfigImpl ensureInitialized getUserLanguage getValue isRetriableError openDatabase registerRemoteConfig setAbortableTimeout toFirebaseError |
? |
classes | ? | Click to show 7 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache Value |
? |
variables | ? | Click to show 14 depsAPP_NAMESPACE_STORE BOOLEAN_TRUTHY_VALUES DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS DEFAULT_VALUE_FOR_BOOLEAN DEFAULT_VALUE_FOR_NUMBER DEFAULT_VALUE_FOR_STRING ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
setLogLevel
Size
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
size | ? | 10.2 kB | ? (?) |
size_with_ext_deps | ? | 26.9 kB | ? (?) |
Dependencies
Type | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
functions | ? | Click to show 9 depsasRemoteConfigImpl ensureInitialized getUserLanguage isRetriableError openDatabase registerRemoteConfig setAbortableTimeout setLogLevel toFirebaseError |
? |
classes | ? | Click to show 6 depsCachingClient RemoteConfig RestClient RetryingClient Storage StorageCache |
? |
variables | ? | Click to show 10 depsAPP_NAMESPACE_STORE DB_NAME DB_VERSION DEFAULT_CACHE_MAX_AGE_MILLIS DEFAULT_FETCH_TIMEOUT_MILLIS ERROR_DESCRIPTION_MAP ERROR_FACTORY RC_COMPONENT_NAME name version |
? |
External Dependencies
Module | Base (7c15fb0) | Head (73be89b) | Diff |
---|---|---|---|
@firebase/logger |
? | LogLevel Logger |
? |
@firebase/util |
? | ErrorFactory FirebaseError calculateBackoffMillis |
? |
@firebase/app-exp |
? | SDK_VERSION _registerComponent registerVersion |
? |
@firebase/component |
? | Component |
? |
Test Logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, Fei 🙏
} | ||
|
||
function asRemoteConfigImpl(remoteConfig: RemoteConfig): RemoteConfigImpl { | ||
return remoteConfig as RemoteConfigImpl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: I'm guessing it's a best-practice to wrap the cast operation, but it's new to me. Is there a doc you'd recommend for the rationale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't think it's a best-practice. I didn't want to do casting(using as
) in every API, so I moved it to a function. On reflection, I think it's probably not necessary, and will waste cycles by introducing a no-op function call.
Changed to do casting directly in individual functions.
export function fetchConfig(remoteConfig: RemoteConfig): Promise<void>; | ||
|
||
// @public (undocumented) | ||
export function getAll(remoteConfig: RemoteConfig): Record<string, Value>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type before was object
:
https://github.com/firebase/firebase-js-sdk/blob/master/packages/remote-config-types/index.d.ts#L68 -> https://firebase.google.com/docs/reference/js/firebase.remoteconfig.RemoteConfig#getall
Using { [key: string]: Value }
still seems idiomatic:
https://www.typescriptlang.org/docs/handbook/interfaces.html#indexable-types
What's the value of using Record
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an alias of { [key:string]: Value}
. The only reason to use it is it is shorter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good to know. Thx
|
* Rolls a node app building bundles. * Build bundle files for given list of project IDs. * Build the bundle json map and save it for integration tests. * Add emulator_settings.ts to gulp * Move bundle.test.ts to api/ * Bundles passes all tests and expose in classic API * Add CI project ID to bundles. * Adhoc string replacement and length re-calculation * Fix lint errors. * Delete old changes from make node app * Address comments * Update yarn.lock for release (#3998) Temp fix where database version is bumped before firebase-admin can update deps * Manually prepares the bundle strings. * Update API * Update config.ts * Use Chrome for karma debugging (#4007) * Cache emulator between runs (#3956) * Remote Config Modularization (#3975) * rc exp init * Add apis * register rc exp * implement funcitonal APIs * fix tests * build rc exp * add api-extractor to rc types * cast directly witout function * delete changelog for rc exp * add code owners to rc exp * update dep version * Remove AuthErrorCode from core export (#4013) * Remove AuthErrorCode from core export * Api * Update config.ts to remove bundles * adds a root changelog (#4009) * adds a root changelog * Update CHANGELOG.md Co-authored-by: Feiyang <[email protected]> * Update dependency typescript to v4.0.5 (#3846) Co-authored-by: Renovate Bot <[email protected]> * Update dependency karma-firefox-launcher to v2 (#3987) Co-authored-by: Renovate Bot <[email protected]> * Update dependency google-closure-library to v20200830 (#3765) * Update dependency google-closure-library to v20200830 * Replace goog.isArray with Array.isArray https://github.com/google/closure-library/releases/tag/v20200628 Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Alex Volkovitsky <[email protected]> * exclude remote config exp packages in changeset (#4014) * Set 1s timeout for onBackgroundMessage Hook (#3780) * await onBackgroundMessage hook * Create fluffy-panthers-hide.md * block in onPush to let onBackgroundMessage to execute * polish wording * Update changeset to be more specific * Update fluffy-panthers-hide.md * Clarify PR is about a bug fix * Update fluffy-panthers-hide.md * A whole bunch of things to bring auth (compat) to parity (#3970) * Handle anonymous auth re-login edge case * Formatting * Initial fixes * Fix redirect * clean up additional user info * Formatting * PR feedback * Fix some tests * Fix tests & write some new ones * Fix broken build * Formatting * Formatting * PR feedback * Formatting * PR feedback Co-authored-by: avolkovi <[email protected]> * Add withFunctionsTriggersDisabled method to rules-unit-testing (#3928) * Update integration tests to use free functions * Functions compat package (#3739) * Add free functions to exports * Fix to avoid false failures on changeset checker (#4012) * Add changeset for Firestore (#4030) * Update functions-compat dep version and fix changeset script error (#4032) * Update integration tests. Minified tests fail. * Bump node memory limit for all test CI (#4035) * Compat Layer for Firestore (#4003) * Rename all public API types to PublicX (#4039) * Update all non-major dependencies (#3953) Co-authored-by: Renovate Bot <[email protected]> * Version Packages (#4033) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Set up Storage modularization (#3499) Refactor storage for modularization. * Free functions removed from exp database.ts Co-authored-by: Christina Holland <[email protected]> Co-authored-by: Sebastian Schmidt <[email protected]> Co-authored-by: Sam Stern <[email protected]> Co-authored-by: Feiyang <[email protected]> Co-authored-by: Sam Horlbeck Olsen <[email protected]> Co-authored-by: Dimitri Mitropoulos <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Alex Volkovitsky <[email protected]> Co-authored-by: Kai Wu <[email protected]> Co-authored-by: Google Open Source Bot <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The internal implementation is unchanged (clients and storage). They are created when you initialize remote config and are members of the remote config object, unchanged from the current behavior. It's possible to modularize them, so that they are only included when you import functions that use them, e.g.
fetchConfig
, but it probably doesn't provide any real benefits since everyone who uses RC usesfetchConfig
.There are lots of files in this PR, but most of them are just copied and unchanged. Only the following files are changed/added/deleted:
Changed:
src/remote_config.ts
test/remote_config.test.ts
package.json
index.d.ts
inremote-config-types-exp
Added:
src/api.ts
src/api2.ts
src/index.ts
src/register.ts
api-extractor.json
TODOs (will address in separate PRs to keep this PR reasonable in terms of size):