@firebase/app-compat
Advanced tools
Comparing version 0.0.800-exp.fe55004be to 0.0.900-exp.0bd766e7a
@@ -8,5 +8,27 @@ 'use strict'; | ||
var component = require('@firebase/component'); | ||
var app = require('@firebase/app'); | ||
var modularAPIs = require('@firebase/app'); | ||
var logger$1 = require('@firebase/logger'); | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
var n = Object.create(null); | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
if (k !== 'default') { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
n['default'] = e; | ||
return Object.freeze(n); | ||
} | ||
var modularAPIs__namespace = /*#__PURE__*/_interopNamespace(modularAPIs); | ||
/** | ||
@@ -33,10 +55,9 @@ * @license | ||
var FirebaseAppImpl = /** @class */ (function () { | ||
function FirebaseAppImpl(app$1, firebase) { | ||
function FirebaseAppImpl(app, firebase) { | ||
var _this = this; | ||
this.app = app$1; | ||
this.app = app; | ||
this.firebase = firebase; | ||
// add itself to container | ||
// TODO: change the component name to 'app-compat' before the official release | ||
app._addComponent(app$1, new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
this.container = app$1.container; | ||
modularAPIs._addComponent(app, new component.Component('app-compat', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
this.container = app.container; | ||
} | ||
@@ -74,3 +95,3 @@ Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", { | ||
_this.firebase.INTERNAL.removeApp(_this.name); | ||
return app.deleteApp(_this.app); | ||
return modularAPIs.deleteApp(_this.app); | ||
}); | ||
@@ -93,3 +114,3 @@ }; | ||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) { | ||
if (instanceIdentifier === void 0) { instanceIdentifier = app._DEFAULT_ENTRY_NAME; } | ||
if (instanceIdentifier === void 0) { instanceIdentifier = modularAPIs._DEFAULT_ENTRY_NAME; } | ||
this.app.checkDestroyed(); | ||
@@ -112,3 +133,3 @@ // getImmediate will always succeed because _getService is only called for registered components. | ||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) { | ||
if (instanceIdentifier === void 0) { instanceIdentifier = app._DEFAULT_ENTRY_NAME; } | ||
if (instanceIdentifier === void 0) { instanceIdentifier = modularAPIs._DEFAULT_ENTRY_NAME; } | ||
this.app.container | ||
@@ -124,7 +145,14 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
FirebaseAppImpl.prototype._addComponent = function (component) { | ||
app._addComponent(this.app, component); | ||
modularAPIs._addComponent(this.app, component); | ||
}; | ||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) { | ||
app._addOrOverwriteComponent(this.app, component); | ||
modularAPIs._addOrOverwriteComponent(this.app, component); | ||
}; | ||
FirebaseAppImpl.prototype.toJSON = function () { | ||
return { | ||
name: this.name, | ||
automaticDataCollectionEnabled: this.automaticDataCollectionEnabled, | ||
options: this.options | ||
}; | ||
}; | ||
return FirebaseAppImpl; | ||
@@ -199,13 +227,14 @@ }()); | ||
// @ts-ignore | ||
app: app$1, | ||
registerVersion: app.registerVersion, | ||
setLogLevel: app.setLogLevel, | ||
onLog: app.onLog, | ||
app: app, | ||
registerVersion: modularAPIs.registerVersion, | ||
setLogLevel: modularAPIs.setLogLevel, | ||
onLog: modularAPIs.onLog, | ||
// @ts-ignore | ||
apps: null, | ||
SDK_VERSION: app.SDK_VERSION, | ||
SDK_VERSION: modularAPIs.SDK_VERSION, | ||
INTERNAL: { | ||
registerComponent: registerComponentCompat, | ||
removeApp: removeApp, | ||
useAsService: useAsService | ||
useAsService: useAsService, | ||
modularAPIs: modularAPIs__namespace | ||
} | ||
@@ -239,4 +268,4 @@ }; | ||
*/ | ||
function app$1(name) { | ||
name = name || app._DEFAULT_ENTRY_NAME; | ||
function app(name) { | ||
name = name || modularAPIs._DEFAULT_ENTRY_NAME; | ||
if (!util.contains(apps, name)) { | ||
@@ -248,3 +277,3 @@ throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name }); | ||
// @ts-ignore | ||
app$1['App'] = firebaseAppImpl; | ||
app['App'] = firebaseAppImpl; | ||
/** | ||
@@ -255,5 +284,5 @@ * Create a new App instance (name must be unique). | ||
if (rawConfig === void 0) { rawConfig = {}; } | ||
var app$1 = app.initializeApp(options, rawConfig); | ||
var appCompat = new firebaseAppImpl(app$1, namespace); | ||
apps[app$1.name] = appCompat; | ||
var app = modularAPIs.initializeApp(options, rawConfig); | ||
var appCompat = new firebaseAppImpl(app, namespace); | ||
apps[app.name] = appCompat; | ||
return appCompat; | ||
@@ -270,3 +299,3 @@ } | ||
var componentName = component.name; | ||
if (app._registerComponent(component) && | ||
if (modularAPIs._registerComponent(component) && | ||
component.type === "PUBLIC" /* PUBLIC */) { | ||
@@ -276,3 +305,3 @@ // create service namespace for public components | ||
var serviceNamespace = function (appArg) { | ||
if (appArg === void 0) { appArg = app$1(); } | ||
if (appArg === void 0) { appArg = app(); } | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -389,3 +418,3 @@ if (typeof appArg[componentName] !== 'function') { | ||
var name = "@firebase/app-compat"; | ||
var version = "0.0.800-exp.fe55004be"; | ||
var version = "0.0.900"; | ||
@@ -410,3 +439,3 @@ /** | ||
// Register `app` package. | ||
app.registerVersion(name, version, variant); | ||
modularAPIs.registerVersion(name, version, variant); | ||
} | ||
@@ -413,0 +442,0 @@ |
import { ErrorFactory, contains, deepExtend, createSubscribe, isBrowser } from '@firebase/util'; | ||
import { Component } from '@firebase/component'; | ||
import * as modularAPIs from '@firebase/app'; | ||
import { _addComponent, deleteApp, _DEFAULT_ENTRY_NAME, _addOrOverwriteComponent, registerVersion, setLogLevel, onLog, SDK_VERSION, initializeApp, _registerComponent } from '@firebase/app'; | ||
@@ -31,4 +32,3 @@ import { Logger } from '@firebase/logger'; | ||
// add itself to container | ||
// TODO: change the component name to 'app-compat' before the official release | ||
_addComponent(app, new Component('app', () => this, "PUBLIC" /* PUBLIC */)); | ||
_addComponent(app, new Component('app-compat', () => this, "PUBLIC" /* PUBLIC */)); | ||
this.container = app.container; | ||
@@ -104,2 +104,9 @@ } | ||
} | ||
toJSON() { | ||
return { | ||
name: this.name, | ||
automaticDataCollectionEnabled: this.automaticDataCollectionEnabled, | ||
options: this.options | ||
}; | ||
} | ||
} | ||
@@ -173,12 +180,13 @@ // TODO: investigate why the following needs to be commented out | ||
app, | ||
registerVersion, | ||
setLogLevel, | ||
onLog, | ||
registerVersion: registerVersion, | ||
setLogLevel: setLogLevel, | ||
onLog: onLog, | ||
// @ts-ignore | ||
apps: null, | ||
SDK_VERSION, | ||
SDK_VERSION: SDK_VERSION, | ||
INTERNAL: { | ||
registerComponent: registerComponentCompat, | ||
removeApp, | ||
useAsService | ||
useAsService, | ||
modularAPIs | ||
} | ||
@@ -351,3 +359,3 @@ }; | ||
const name = "@firebase/app-compat"; | ||
const version = "0.0.800-exp.fe55004be"; | ||
const version = "0.0.900"; | ||
@@ -354,0 +362,0 @@ /** |
import { ErrorFactory, contains, deepExtend, createSubscribe, isBrowser } from '@firebase/util'; | ||
import { __assign } from 'tslib'; | ||
import { Component } from '@firebase/component'; | ||
import * as modularAPIs from '@firebase/app'; | ||
import { deleteApp, _addComponent, _addOrOverwriteComponent, _DEFAULT_ENTRY_NAME, registerVersion, setLogLevel, onLog, SDK_VERSION, initializeApp, _registerComponent } from '@firebase/app'; | ||
@@ -33,4 +34,3 @@ import { Logger } from '@firebase/logger'; | ||
// add itself to container | ||
// TODO: change the component name to 'app-compat' before the official release | ||
_addComponent(app, new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
_addComponent(app, new Component('app-compat', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
this.container = app.container; | ||
@@ -121,2 +121,9 @@ } | ||
}; | ||
FirebaseAppImpl.prototype.toJSON = function () { | ||
return { | ||
name: this.name, | ||
automaticDataCollectionEnabled: this.automaticDataCollectionEnabled, | ||
options: this.options | ||
}; | ||
}; | ||
return FirebaseAppImpl; | ||
@@ -201,3 +208,4 @@ }()); | ||
removeApp: removeApp, | ||
useAsService: useAsService | ||
useAsService: useAsService, | ||
modularAPIs: modularAPIs | ||
} | ||
@@ -376,3 +384,3 @@ }; | ||
var name = "@firebase/app-compat"; | ||
var version = "0.0.800-exp.fe55004be"; | ||
var version = "0.0.900"; | ||
@@ -379,0 +387,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import * as modularAPIs from '@firebase/app'; | ||
import { _addComponent, deleteApp, _DEFAULT_ENTRY_NAME, registerVersion, setLogLevel, onLog, SDK_VERSION, initializeApp, _registerComponent } from '@firebase/app'; | ||
@@ -30,3 +31,3 @@ import { Component } from '@firebase/component'; | ||
// add itself to container | ||
_addComponent(app, new Component('app', () => this, "PUBLIC" /* PUBLIC */)); | ||
_addComponent(app, new Component('app-compat', () => this, "PUBLIC" /* PUBLIC */)); | ||
} | ||
@@ -132,12 +133,13 @@ get automaticDataCollectionEnabled() { | ||
app, | ||
registerVersion, | ||
setLogLevel, | ||
onLog, | ||
registerVersion: registerVersion, | ||
setLogLevel: setLogLevel, | ||
onLog: onLog, | ||
// @ts-ignore | ||
apps: null, | ||
SDK_VERSION, | ||
SDK_VERSION: SDK_VERSION, | ||
INTERNAL: { | ||
registerComponent: registerComponentCompat, | ||
removeApp, | ||
useAsService | ||
useAsService, | ||
modularAPIs | ||
} | ||
@@ -268,4 +270,3 @@ }; | ||
namespace.SDK_VERSION = `${namespace.SDK_VERSION}_LITE`; | ||
const registerComponent = namespace.INTERNAL | ||
.registerComponent; | ||
const registerComponent = namespace.INTERNAL.registerComponent; | ||
namespace.INTERNAL.registerComponent = registerComponentForLite; | ||
@@ -291,3 +292,3 @@ /** | ||
const name$1 = "@firebase/app-compat"; | ||
const version = "0.0.800-exp.fe55004be"; | ||
const version = "0.0.900"; | ||
@@ -294,0 +295,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import * as modularAPIs from '@firebase/app'; | ||
import { deleteApp, _addComponent, _DEFAULT_ENTRY_NAME, registerVersion, setLogLevel, onLog, SDK_VERSION, initializeApp, _registerComponent } from '@firebase/app'; | ||
@@ -31,3 +32,3 @@ import { Component } from '@firebase/component'; | ||
// add itself to container | ||
_addComponent(app, new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
_addComponent(app, new Component('app-compat', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
} | ||
@@ -157,3 +158,4 @@ Object.defineProperty(FirebaseAppLiteImpl.prototype, "automaticDataCollectionEnabled", { | ||
removeApp: removeApp, | ||
useAsService: useAsService | ||
useAsService: useAsService, | ||
modularAPIs: modularAPIs | ||
} | ||
@@ -290,4 +292,3 @@ }; | ||
namespace.SDK_VERSION = namespace.SDK_VERSION + "_LITE"; | ||
var registerComponent = namespace.INTERNAL | ||
.registerComponent; | ||
var registerComponent = namespace.INTERNAL.registerComponent; | ||
namespace.INTERNAL.registerComponent = registerComponentForLite; | ||
@@ -313,3 +314,3 @@ /** | ||
var name$1 = "@firebase/app-compat"; | ||
var version = "0.0.800-exp.fe55004be"; | ||
var version = "0.0.900"; | ||
@@ -316,0 +317,0 @@ /** |
@@ -17,6 +17,6 @@ /** | ||
*/ | ||
import { FirebaseApp, FirebaseOptions } from '@firebase/app-types'; | ||
import { _FirebaseNamespace, FirebaseService } from '@firebase/app-types/private'; | ||
import { FirebaseApp, FirebaseOptions } from './public-types'; | ||
import { Component } from '@firebase/component'; | ||
import { _FirebaseAppInternal } from "@firebase/app-types"; | ||
import { _FirebaseAppInternal as _FirebaseAppExp } from "@firebase/app"; | ||
import { _FirebaseService, _FirebaseNamespace } from './types'; | ||
/** | ||
@@ -29,4 +29,4 @@ * Global context object for a collection of services using | ||
private readonly firebase; | ||
private readonly container; | ||
constructor(app: _FirebaseAppInternal, firebase: _FirebaseNamespace); | ||
private container; | ||
constructor(app: _FirebaseAppExp, firebase: _FirebaseNamespace); | ||
get automaticDataCollectionEnabled(): boolean; | ||
@@ -51,3 +51,3 @@ set automaticDataCollectionEnabled(val: boolean); | ||
*/ | ||
_getService(name: string, instanceIdentifier?: string): FirebaseService; | ||
_getService(name: string, instanceIdentifier?: string): _FirebaseService; | ||
/** | ||
@@ -70,2 +70,3 @@ * Remove a service instance from the cache, so we will create a new instance for this service | ||
_addOrOverwriteComponent(component: Component): void; | ||
toJSON(): object; | ||
} |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
import { FirebaseNamespace } from '@firebase/app-types'; | ||
import { FirebaseNamespace } from './public-types'; | ||
/** | ||
@@ -20,0 +20,0 @@ * Return a firebase namespace object. |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
import { FirebaseNamespace } from '@firebase/app-types'; | ||
import { _FirebaseNamespace } from './types'; | ||
import { FirebaseAppImpl } from './firebaseApp'; | ||
@@ -28,2 +28,2 @@ import { FirebaseAppLiteImpl } from './lite/firebaseAppLite'; | ||
*/ | ||
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): FirebaseNamespace; | ||
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): _FirebaseNamespace; |
@@ -17,4 +17,6 @@ /** | ||
*/ | ||
import { FirebaseNamespace } from '@firebase/app-types'; | ||
import { FirebaseNamespace } from './public-types'; | ||
export declare const firebase: FirebaseNamespace; | ||
export default firebase; | ||
export { _FirebaseNamespace, _FirebaseService } from './types'; | ||
export { FirebaseApp } from './public-types'; |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
export declare const firebase: import("@firebase/app-types").FirebaseNamespace; | ||
export declare const firebase: import("./public-types").FirebaseNamespace; | ||
export default firebase; |
@@ -17,5 +17,5 @@ /** | ||
*/ | ||
import { FirebaseApp, FirebaseOptions } from '@firebase/app-types'; | ||
import { _FirebaseNamespace, FirebaseService } from '@firebase/app-types/private'; | ||
import { _FirebaseAppInternal } from "@firebase/app-types"; | ||
import { FirebaseApp, FirebaseOptions } from '../public-types'; | ||
import { _FirebaseNamespace, _FirebaseService } from '../types'; | ||
import { _FirebaseAppInternal as FirebaseAppExp } from "@firebase/app"; | ||
/** | ||
@@ -28,3 +28,3 @@ * Global context object for a collection of services using | ||
private readonly firebase; | ||
constructor(app: _FirebaseAppInternal, firebase: _FirebaseNamespace); | ||
constructor(app: FirebaseAppExp, firebase: _FirebaseNamespace); | ||
get automaticDataCollectionEnabled(): boolean; | ||
@@ -49,3 +49,3 @@ set automaticDataCollectionEnabled(val: boolean); | ||
*/ | ||
_getService(name: string, instanceIdentifier?: string): FirebaseService; | ||
_getService(name: string, instanceIdentifier?: string): _FirebaseService; | ||
} |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
import { FirebaseNamespace } from '@firebase/app-types'; | ||
import { FirebaseNamespace } from '../public-types'; | ||
export declare function createFirebaseNamespaceLite(): FirebaseNamespace; |
@@ -17,6 +17,6 @@ /** | ||
*/ | ||
import { FirebaseService } from '@firebase/app-types/private'; | ||
import { FirebaseApp } from '@firebase/app-types'; | ||
import { _FirebaseService } from '../src/types'; | ||
import { FirebaseApp } from '../src/public-types'; | ||
import { ComponentType, Component } from '@firebase/component'; | ||
export declare class TestService implements FirebaseService { | ||
export declare class TestService implements _FirebaseService { | ||
private app_; | ||
@@ -23,0 +23,0 @@ instanceIdentifier?: string | undefined; |
{ | ||
"name": "@firebase/app-compat", | ||
"version": "0.0.800-exp.fe55004be", | ||
"version": "0.0.900-exp.0bd766e7a", | ||
"description": "The primary entrypoint to the Firebase JS SDK", | ||
@@ -28,12 +28,11 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", | ||
"test:browser:debug": "karma start --browsers Chrome --auto-watch", | ||
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* src/**/*.test.ts --config ../../config/mocharc.node.js", | ||
"prepare": "yarn build:release" | ||
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* src/**/*.test.ts --config ../../config/mocharc.node.js" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@firebase/app": "0.0.800-exp.fe55004be", | ||
"@firebase/util": "0.3.2", | ||
"@firebase/app": "0.0.900-exp.0bd766e7a", | ||
"@firebase/util": "0.4.0", | ||
"@firebase/logger": "0.2.6", | ||
"@firebase/component": "0.1.19", | ||
"tslib": "^1.11.1", | ||
"@firebase/component": "0.2.1", | ||
"tslib": "^2.0.0", | ||
"dom-storage": "2.1.0", | ||
@@ -43,7 +42,7 @@ "xmlhttprequest": "1.8.0" | ||
"devDependencies": { | ||
"rollup": "2.28.1", | ||
"rollup-plugin-json": "4.0.0", | ||
"rollup": "2.35.1", | ||
"@rollup/plugin-json": "4.1.0", | ||
"rollup-plugin-replace": "2.2.0", | ||
"rollup-plugin-typescript2": "0.27.2", | ||
"typescript": "4.0.2" | ||
"rollup-plugin-typescript2": "0.29.0", | ||
"typescript": "4.2.2" | ||
}, | ||
@@ -50,0 +49,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209341
27
2475
35
284
+ Added@firebase/app@0.0.900-exp.0bd766e7a(transitive)
+ Added@firebase/component@0.2.1(transitive)
+ Added@firebase/util@0.4.0(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@firebase/app@0.0.800-exp.fe55004be(transitive)
- Removed@firebase/app-types@0.0.800-exp.fe55004be(transitive)
- Removed@firebase/component@0.1.19(transitive)
- Removed@firebase/util@0.3.2(transitive)
- Removedtslib@1.14.1(transitive)
Updated@firebase/component@0.2.1
Updated@firebase/util@0.4.0
Updatedtslib@^2.0.0