@firebase/app-compat
Advanced tools
Comparing version 0.0.900-exp.8294e6082 to 0.0.900-exp.894b5da5a
@@ -407,3 +407,3 @@ 'use strict'; | ||
var name = "@firebase/app-compat"; | ||
var version = "0.0.900-exp.8294e6082"; | ||
var version = "0.0.900-exp.894b5da5a"; | ||
@@ -410,0 +410,0 @@ /** |
@@ -357,3 +357,3 @@ import { ErrorFactory, contains, deepExtend, createSubscribe, isBrowser } from '@firebase/util'; | ||
const name = "@firebase/app-compat"; | ||
const version = "0.0.900-exp.8294e6082"; | ||
const version = "0.0.900-exp.894b5da5a"; | ||
@@ -360,0 +360,0 @@ /** |
@@ -382,3 +382,3 @@ import { ErrorFactory, contains, deepExtend, createSubscribe, isBrowser } from '@firebase/util'; | ||
var name = "@firebase/app-compat"; | ||
var version = "0.0.900-exp.8294e6082"; | ||
var version = "0.0.900-exp.894b5da5a"; | ||
@@ -385,0 +385,0 @@ /** |
import * as modularAPIs from '@firebase/app'; | ||
import { deleteApp, _addComponent, _DEFAULT_ENTRY_NAME, registerVersion, setLogLevel, onLog, SDK_VERSION, initializeApp, _registerComponent } from '@firebase/app'; | ||
import { _addComponent, deleteApp, _DEFAULT_ENTRY_NAME, registerVersion, setLogLevel, onLog, SDK_VERSION, initializeApp, _registerComponent } from '@firebase/app'; | ||
import { Component } from '@firebase/component'; | ||
@@ -26,38 +26,25 @@ import { ErrorFactory, contains, deepExtend } from '@firebase/util'; | ||
*/ | ||
var FirebaseAppLiteImpl = /** @class */ (function () { | ||
function FirebaseAppLiteImpl(_delegate, firebase) { | ||
var _this = this; | ||
class FirebaseAppLiteImpl { | ||
constructor(_delegate, firebase) { | ||
this._delegate = _delegate; | ||
this.firebase = firebase; | ||
// add itself to container | ||
_addComponent(_delegate, new Component('app-compat', function () { return _this; }, "PUBLIC" /* PUBLIC */)); | ||
_addComponent(_delegate, new Component('app-compat', () => this, "PUBLIC" /* PUBLIC */)); | ||
} | ||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "automaticDataCollectionEnabled", { | ||
get: function () { | ||
return this._delegate.automaticDataCollectionEnabled; | ||
}, | ||
set: function (val) { | ||
this.automaticDataCollectionEnabled = val; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "name", { | ||
get: function () { | ||
return this._delegate.name; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "options", { | ||
get: function () { | ||
return this._delegate.options; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
FirebaseAppLiteImpl.prototype.delete = function () { | ||
get automaticDataCollectionEnabled() { | ||
return this._delegate.automaticDataCollectionEnabled; | ||
} | ||
set automaticDataCollectionEnabled(val) { | ||
this.automaticDataCollectionEnabled = val; | ||
} | ||
get name() { | ||
return this._delegate.name; | ||
} | ||
get options() { | ||
return this._delegate.options; | ||
} | ||
delete() { | ||
this.firebase.INTERNAL.removeApp(this.name); | ||
return deleteApp(this._delegate); | ||
}; | ||
} | ||
/** | ||
@@ -77,4 +64,3 @@ * Return a service instance associated with this app (creating it | ||
*/ | ||
FirebaseAppLiteImpl.prototype._getService = function (name, instanceIdentifier) { | ||
if (instanceIdentifier === void 0) { instanceIdentifier = _DEFAULT_ENTRY_NAME; } | ||
_getService(name, instanceIdentifier = _DEFAULT_ENTRY_NAME) { | ||
this._delegate.checkDestroyed(); | ||
@@ -85,5 +71,4 @@ // getImmediate will always succeed because _getService is only called for registered components. | ||
}); | ||
}; | ||
return FirebaseAppLiteImpl; | ||
}()); | ||
} | ||
} | ||
@@ -106,10 +91,9 @@ /** | ||
*/ | ||
var _a; | ||
var ERRORS = (_a = {}, | ||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " + | ||
const ERRORS = { | ||
["no-app" /* NO_APP */]: "No Firebase App '{$appName}' has been created - " + | ||
'call Firebase App.initializeApp()', | ||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' + | ||
'Firebase App instance.', | ||
_a); | ||
var ERROR_FACTORY = new ErrorFactory('app-compat', 'Firebase', ERRORS); | ||
["invalid-app-argument" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' + | ||
'Firebase App instance.' | ||
}; | ||
const ERROR_FACTORY = new ErrorFactory('app-compat', 'Firebase', ERRORS); | ||
@@ -140,7 +124,7 @@ /** | ||
function createFirebaseNamespaceCore(firebaseAppImpl) { | ||
var apps = {}; | ||
const apps = {}; | ||
// // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// const components = new Map<string, Component<any>>(); | ||
// A namespace is a plain JavaScript Object. | ||
var namespace = { | ||
const namespace = { | ||
// Hack to prevent Babel from modifying the object returned | ||
@@ -152,3 +136,3 @@ // as the firebase namespace. | ||
// @ts-ignore | ||
app: app, | ||
app, | ||
registerVersion: registerVersion, | ||
@@ -162,5 +146,5 @@ setLogLevel: setLogLevel, | ||
registerComponent: registerComponentCompat, | ||
removeApp: removeApp, | ||
useAsService: useAsService, | ||
modularAPIs: modularAPIs | ||
removeApp, | ||
useAsService, | ||
modularAPIs | ||
} | ||
@@ -206,6 +190,5 @@ }; | ||
*/ | ||
function initializeAppCompat(options, rawConfig) { | ||
if (rawConfig === void 0) { rawConfig = {}; } | ||
var app = initializeApp(options, rawConfig); | ||
var appCompat = new firebaseAppImpl(app, namespace); | ||
function initializeAppCompat(options, rawConfig = {}) { | ||
const app = initializeApp(options, rawConfig); | ||
const appCompat = new firebaseAppImpl(app, namespace); | ||
apps[app.name] = appCompat; | ||
@@ -219,7 +202,7 @@ return appCompat; | ||
// Make a copy so caller cannot mutate the apps list. | ||
return Object.keys(apps).map(function (name) { return apps[name]; }); | ||
return Object.keys(apps).map(name => apps[name]); | ||
} | ||
function registerComponentCompat(component) { | ||
var componentName = component.name; | ||
var componentNameWithoutCompat = componentName.replace('-compat', ''); | ||
const componentName = component.name; | ||
const componentNameWithoutCompat = componentName.replace('-compat', ''); | ||
if (_registerComponent(component) && | ||
@@ -229,4 +212,3 @@ component.type === "PUBLIC" /* PUBLIC */) { | ||
// The Service namespace is an accessor function ... | ||
var serviceNamespace = function (appArg) { | ||
if (appArg === void 0) { appArg = app(); } | ||
const serviceNamespace = (appArg = app()) => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -256,8 +238,4 @@ if (typeof appArg[componentNameWithoutCompat] !== 'function') { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var serviceFxn = this._getService.bind(this, componentName); | ||
function (...args) { | ||
const serviceFxn = this._getService.bind(this, componentName); | ||
return serviceFxn.apply(this, component.multipleInstances ? args : []); | ||
@@ -277,3 +255,3 @@ }; | ||
} | ||
var useService = name; | ||
const useService = name; | ||
return useService; | ||
@@ -301,5 +279,5 @@ } | ||
function createFirebaseNamespaceLite() { | ||
var namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl); | ||
namespace.SDK_VERSION = namespace.SDK_VERSION + "_LITE"; | ||
var registerComponent = namespace.INTERNAL.registerComponent; | ||
const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl); | ||
namespace.SDK_VERSION = `${namespace.SDK_VERSION}_LITE`; | ||
const registerComponent = namespace.INTERNAL.registerComponent; | ||
namespace.INTERNAL.registerComponent = registerComponentForLite; | ||
@@ -317,3 +295,3 @@ /** | ||
component.name !== 'installations') { | ||
throw Error(name + " cannot register with the standalone perf instance"); | ||
throw Error(`${name} cannot register with the standalone perf instance`); | ||
} | ||
@@ -325,4 +303,4 @@ return registerComponent(component); | ||
var name$1 = "@firebase/app-compat"; | ||
var version = "0.0.900-exp.8294e6082"; | ||
const name$1 = "@firebase/app-compat"; | ||
const version = "0.0.900-exp.894b5da5a"; | ||
@@ -366,3 +344,3 @@ /** | ||
*/ | ||
var firebase = createFirebaseNamespaceLite(); | ||
const firebase = createFirebaseNamespaceLite(); | ||
registerCoreComponents('lite'); | ||
@@ -369,0 +347,0 @@ |
{ | ||
"name": "@firebase/app-compat", | ||
"version": "0.0.900-exp.8294e6082", | ||
"version": "0.0.900-exp.894b5da5a", | ||
"description": "The primary entrypoint to the Firebase JS SDK", | ||
@@ -8,7 +8,6 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", | ||
"main": "dist/index.cjs.js", | ||
"browser": "dist/index.esm5.js", | ||
"module": "dist/index.esm5.js", | ||
"esm2017": "dist/index.esm2017.js", | ||
"browser": "dist/index.esm2017.js", | ||
"module": "dist/index.esm2017.js", | ||
"lite": "dist/index.lite.js", | ||
"lite-esm2017": "dist/index.lite.esm2017.js", | ||
"lite-esm5": "dist/index.lite.esm5.js", | ||
"files": [ | ||
@@ -33,6 +32,6 @@ "dist" | ||
"dependencies": { | ||
"@firebase/app": "0.0.900-exp.8294e6082", | ||
"@firebase/util": "0.4.1", | ||
"@firebase/app": "0.0.900-exp.894b5da5a", | ||
"@firebase/util": "1.0.0", | ||
"@firebase/logger": "0.2.6", | ||
"@firebase/component": "0.3.1", | ||
"@firebase/component": "0.4.1", | ||
"tslib": "^2.1.0", | ||
@@ -64,3 +63,4 @@ "dom-storage": "2.1.0", | ||
}, | ||
"esm5": "dist/index.esm5.js", | ||
"peerDependencies": {} | ||
} |
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
215064
+ Added@firebase/app@0.0.900-exp.894b5da5a(transitive)
+ Added@firebase/component@0.4.1(transitive)
+ Added@firebase/util@1.0.0(transitive)
- Removed@firebase/app@0.0.900-exp.8294e6082(transitive)
- Removed@firebase/component@0.3.1(transitive)
- Removed@firebase/util@0.4.1(transitive)
Updated@firebase/component@0.4.1
Updated@firebase/util@1.0.0