Skip to content

Commit 942b894

Browse files
committed
Merge remote-tracking branch 'origin/main' into SimpleDbExtendedDebugLogging
2 parents 047407a + d91169f commit 942b894

File tree

99 files changed

+427
-522
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+427
-522
lines changed

.changeset/thin-bikes-tan.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/app': minor
3+
'firebase': minor
4+
---
5+
6+
initializeServerApp now supports auto-initialization for Firebase App Hosting.

common/api-review/app.api.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,20 @@ export function initializeApp(options: FirebaseOptions, config?: FirebaseAppSett
110110
export function initializeApp(): FirebaseApp;
111111

112112
// @public
113-
export function initializeServerApp(options: FirebaseOptions | FirebaseApp, config: FirebaseServerAppSettings): FirebaseServerApp;
113+
export function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
114+
115+
// @public
116+
export function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
114117

115118
// @internal (undocumented)
116-
export function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions): obj is FirebaseApp;
119+
export function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp;
117120

118121
// @internal (undocumented)
119122
export function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp;
120123

124+
// @internal (undocumented)
125+
export function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings;
126+
121127
// @public
122128
export function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
123129

config/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
'unused-imports'
3232
],
3333
'parserOptions': {
34-
'ecmaVersion': 2017,
34+
'ecmaVersion': 2020,
3535
'sourceType': 'module'
3636
},
3737
'overrides': [

config/tsconfig.base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"strict": true,
77
"lib": [
88
"dom",
9-
"es2017",
9+
"es2020",
1010
"esnext.WeakRef",
1111
],
1212
"module": "ES2015",
1313
"moduleResolution": "node",
1414
"resolveJsonModule": true,
1515
"esModuleInterop": true,
1616
"sourceMap": true,
17-
"target": "es2017",
17+
"target": "es2020",
1818
"typeRoots": [
1919
"../node_modules/@types"
2020
],

config/webpack.test.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = {
4444
options: {
4545
compilerOptions: {
4646
module: 'commonjs',
47-
target: 'es2017',
47+
target: 'es2020',
4848
downlevelIteration: true,
4949
resolveJsonModule: true
5050
}
@@ -56,15 +56,6 @@ module.exports = {
5656
use: 'source-map-loader',
5757
enforce: 'pre'
5858
},
59-
{
60-
test: /\.tsx?$/,
61-
use: {
62-
loader: 'istanbul-instrumenter-loader',
63-
options: { esModules: true }
64-
},
65-
enforce: 'post',
66-
exclude: [/\.test\.ts$/, /\btest(ing)?\//]
67-
},
6859
{
6960
test: /\.js$/,
7061
include: [/node_modules\/chai-as-promised/],

docs-devsite/app.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ This package coordinates the communication between the different Firebase compon
2323
| <b>function()</b> |
2424
| [getApps()](./app.md#getapps) | A (read-only) array of all initialized apps. |
2525
| [initializeApp()](./app.md#initializeapp) | Creates and initializes a FirebaseApp instance. |
26+
| <b>function(config, ...)</b> |
27+
| [initializeServerApp(config)](./app.md#initializeserverapp_e7d0728) | Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance. |
2628
| <b>function(libraryKeyOrName, ...)</b> |
2729
| [registerVersion(libraryKeyOrName, version, variant)](./app.md#registerversion_f673248) | Registers a library's name and version for platform logging purposes. |
2830
| <b>function(logCallback, ...)</b> |
@@ -116,6 +118,38 @@ export declare function initializeApp(): FirebaseApp;
116118

117119
[FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)
118120

121+
## function(config, ...)
122+
123+
### initializeServerApp(config) {:#initializeserverapp_e7d0728}
124+
125+
Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.
126+
127+
<b>Signature:</b>
128+
129+
```typescript
130+
export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
131+
```
132+
133+
#### Parameters
134+
135+
| Parameter | Type | Description |
136+
| --- | --- | --- |
137+
| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Optional <code>FirebaseServerApp</code> settings. |
138+
139+
<b>Returns:</b>
140+
141+
[FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface)
142+
143+
The initialized `FirebaseServerApp`<!-- -->.
144+
145+
#### Exceptions
146+
147+
If invoked in an unsupported non-server environment such as a browser.
148+
149+
If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support.
150+
151+
If the `FIREBASE_OPTIONS` enviornment variable does not contain a valid project configuration required for auto-initialization.
152+
119153
## function(libraryKeyOrName, ...)
120154

121155
### registerVersion(libraryKeyOrName, version, variant) {:#registerversion_f673248}
@@ -260,6 +294,12 @@ export declare function initializeApp(options: FirebaseOptions, name?: string):
260294

261295
The initialized app.
262296

297+
#### Exceptions
298+
299+
If the optional `name` parameter is malformed or empty.
300+
301+
If a `FirebaseApp` already exists with the same name but with a different configuration.
302+
263303
### Example 1
264304

265305

@@ -312,6 +352,12 @@ export declare function initializeApp(options: FirebaseOptions, config?: Firebas
312352

313353
[FirebaseApp](./app.firebaseapp.md#firebaseapp_interface)
314354

355+
#### Exceptions
356+
357+
If [FirebaseAppSettings.name](./app.firebaseappsettings.md#firebaseappsettingsname) is defined but the value is malformed or empty.
358+
359+
If a `FirebaseApp` already exists with the same name but with a different configuration.
360+
315361
### initializeServerApp(options, config) {:#initializeserverapp_30ab697}
316362

317363
Creates and initializes a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) instance.
@@ -323,22 +369,28 @@ See [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_fi
323369
<b>Signature:</b>
324370

325371
```typescript
326-
export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config: FirebaseServerAppSettings): FirebaseServerApp;
372+
export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
327373
```
328374

329375
#### Parameters
330376

331377
| Parameter | Type | Description |
332378
| --- | --- | --- |
333379
| options | [FirebaseOptions](./app.firebaseoptions.md#firebaseoptions_interface) \| [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | <code>Firebase.AppOptions</code> to configure the app's services, or a a <code>FirebaseApp</code> instance which contains the <code>AppOptions</code> within. |
334-
| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | <code>FirebaseServerApp</code> configuration. |
380+
| config | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | Optional <code>FirebaseServerApp</code> settings. |
335381

336382
<b>Returns:</b>
337383

338384
[FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface)
339385

340386
The initialized `FirebaseServerApp`<!-- -->.
341387

388+
#### Exceptions
389+
390+
If invoked in an unsupported non-server environment such as a browser.
391+
392+
If [FirebaseServerAppSettings.releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) is defined but the runtime doesn't provide Finalization Registry support.
393+
342394
### Example
343395

344396

integration/compat-interop/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"moduleResolution": "node",
99
"noImplicitAny": true,
1010
"outDir": "dist",
11-
"target": "es2017",
11+
"target": "es2020",
1212
"sourceMap": true,
1313
"esModuleInterop": true
1414
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
"http-server": "14.1.1",
112112
"indexeddbshim": "10.1.0",
113113
"inquirer": "8.2.6",
114-
"istanbul-instrumenter-loader": "3.0.1",
115114
"js-yaml": "4.1.0",
116115
"karma": "6.4.4",
117116
"karma-chrome-launcher": "3.2.0",

packages/ai/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"node": ">=18.0.0"
88
},
99
"main": "dist/index.cjs.js",
10-
"browser": "dist/esm/index.esm2017.js",
11-
"module": "dist/esm/index.esm2017.js",
10+
"browser": "dist/esm/index.esm.js",
11+
"module": "dist/esm/index.esm.js",
1212
"exports": {
1313
".": {
1414
"types": "./dist/ai-public.d.ts",
@@ -18,9 +18,9 @@
1818
},
1919
"browser": {
2020
"require": "./dist/index.cjs.js",
21-
"import": "./dist/esm/index.esm2017.js"
21+
"import": "./dist/esm/index.esm.js"
2222
},
23-
"default": "./dist/esm/index.esm2017.js"
23+
"default": "./dist/esm/index.esm.js"
2424
},
2525
"./package.json": "./package.json"
2626
},

packages/ai/rollup.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const buildPlugins = [
3939
'integration'
4040
],
4141
compilerOptions: {
42-
target: 'es2017'
42+
target: 'es2020'
4343
}
4444
}
4545
}),
@@ -57,7 +57,7 @@ const browserBuilds = [
5757
plugins: [
5858
...buildPlugins,
5959
replace({
60-
...generateBuildTargetReplaceConfig('esm', 2017),
60+
...generateBuildTargetReplaceConfig('esm', 2020),
6161
__PACKAGE_VERSION__: pkg.version
6262
}),
6363
emitModulePackageFile()
@@ -74,7 +74,7 @@ const browserBuilds = [
7474
plugins: [
7575
...buildPlugins,
7676
replace({
77-
...generateBuildTargetReplaceConfig('cjs', 2017),
77+
...generateBuildTargetReplaceConfig('cjs', 2020),
7878
__PACKAGE_VERSION__: pkg.version
7979
})
8080
],
@@ -93,7 +93,7 @@ const nodeBuilds = [
9393
plugins: [
9494
...buildPlugins,
9595
replace({
96-
...generateBuildTargetReplaceConfig('esm', 2017)
96+
...generateBuildTargetReplaceConfig('esm', 2020)
9797
})
9898
],
9999
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
@@ -108,7 +108,7 @@ const nodeBuilds = [
108108
plugins: [
109109
...buildPlugins,
110110
replace({
111-
...generateBuildTargetReplaceConfig('cjs', 2017)
111+
...generateBuildTargetReplaceConfig('cjs', 2020)
112112
})
113113
],
114114
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))

0 commit comments

Comments
 (0)