@firebase/analytics
Advanced tools
Comparing version
@@ -169,3 +169,3 @@ 'use strict'; | ||
script.src = trustedTypesPolicy | ||
? trustedTypesPolicy === null || trustedTypesPolicy === void 0 ? void 0 : trustedTypesPolicy.createScriptURL(gtagScriptURL) | ||
? trustedTypesPolicy?.createScriptURL(gtagScriptURL) | ||
: gtagScriptURL; | ||
@@ -456,3 +456,2 @@ script.async = true; | ||
async function fetchDynamicConfig(appFields) { | ||
var _a; | ||
const { appId, apiKey } = appFields; | ||
@@ -470,3 +469,3 @@ const request = { | ||
const jsonResponse = (await response.json()); | ||
if ((_a = jsonResponse.error) === null || _a === void 0 ? void 0 : _a.message) { | ||
if (jsonResponse.error?.message) { | ||
errorMessage = jsonResponse.error.message; | ||
@@ -522,3 +521,2 @@ } | ||
) { | ||
var _a; | ||
const { appId, measurementId } = appFields; | ||
@@ -535,3 +533,3 @@ // Starts with a (potentially zero) timeout to support resumption from stored state. | ||
` Falling back to the measurement ID ${measurementId}` + | ||
` provided in the "measurementId" field in the local Firebase config. [${e === null || e === void 0 ? void 0 : e.message}]`); | ||
` provided in the "measurementId" field in the local Firebase config. [${e?.message}]`); | ||
return { appId, measurementId }; | ||
@@ -554,3 +552,3 @@ } | ||
` Falling back to the measurement ID ${measurementId}` + | ||
` provided in the "measurementId" field in the local Firebase config. [${error === null || error === void 0 ? void 0 : error.message}]`); | ||
` provided in the "measurementId" field in the local Firebase config. [${error?.message}]`); | ||
return { appId, measurementId }; | ||
@@ -562,3 +560,3 @@ } | ||
} | ||
const backoffMillis = Number((_a = error === null || error === void 0 ? void 0 : error.customData) === null || _a === void 0 ? void 0 : _a.httpStatus) === 503 | ||
const backoffMillis = Number(error?.customData?.httpStatus) === 503 | ||
? util.calculateBackoffMillis(backoffCount, retryData.intervalMillis, LONG_RETRY_FACTOR) | ||
@@ -672,3 +670,6 @@ : util.calculateBackoffMillis(backoffCount, retryData.intervalMillis); | ||
const measurementId = await initializationPromise; | ||
const params = Object.assign(Object.assign({}, eventParams), { 'send_to': measurementId }); | ||
const params = { | ||
...eventParams, | ||
'send_to': measurementId | ||
}; | ||
gtagFunction("event" /* GtagCommand.EVENT */, eventName, params); | ||
@@ -820,3 +821,3 @@ } | ||
logger.warn(ERROR_FACTORY.create("indexeddb-unavailable" /* AnalyticsError.INDEXEDDB_UNAVAILABLE */, { | ||
errorInfo: e === null || e === void 0 ? void 0 : e.toString() | ||
errorInfo: e?.toString() | ||
}).message); | ||
@@ -842,3 +843,2 @@ return false; | ||
async function _initializeAnalytics(app, dynamicConfigPromisesList, measurementIdToAppId, installations, gtagCore, dataLayerName, options) { | ||
var _a; | ||
const dynamicConfigPromise = fetchDynamicConfigWithRetry(app); | ||
@@ -890,3 +890,3 @@ // Once fetched, map measurementIds to appId, for ease of lookup in wrapped gtag function. | ||
// base Firebase config properties. | ||
const configProperties = (_a = options === null || options === void 0 ? void 0 : options.config) !== null && _a !== void 0 ? _a : {}; | ||
const configProperties = options?.config ?? {}; | ||
// guard against developers accidentally setting properties with prefix `firebase_` | ||
@@ -1248,3 +1248,3 @@ configProperties[ORIGIN_KEY] = 'firebase'; | ||
const name = "@firebase/analytics"; | ||
const version = "0.10.17-20250626140224"; | ||
const version = "0.10.17-canary.25b60fdaa"; | ||
@@ -1268,4 +1268,4 @@ /** | ||
app.registerVersion(name, version); | ||
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation | ||
app.registerVersion(name, version, 'cjs2017'); | ||
// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation | ||
app.registerVersion(name, version, 'cjs2020'); | ||
function internalFactory(container) { | ||
@@ -1272,0 +1272,0 @@ try { |
{ | ||
"name": "@firebase/analytics", | ||
"version": "0.10.17-20250626140224", | ||
"version": "0.10.17-canary.25b60fdaa", | ||
"description": "A analytics package for new firebase packages", | ||
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", | ||
"main": "dist/index.cjs.js", | ||
"browser": "dist/esm/index.esm2017.js", | ||
"module": "dist/esm/index.esm2017.js", | ||
"browser": "dist/esm/index.esm.js", | ||
"module": "dist/esm/index.esm.js", | ||
"exports": { | ||
@@ -13,3 +13,3 @@ ".": { | ||
"require": "./dist/index.cjs.js", | ||
"default": "./dist/esm/index.esm2017.js" | ||
"default": "./dist/esm/index.esm.js" | ||
}, | ||
@@ -40,9 +40,9 @@ "./package.json": "./package.json" | ||
"peerDependencies": { | ||
"@firebase/app": "0.13.2-20250626140224" | ||
"@firebase/app": "0.13.2-canary.25b60fdaa" | ||
}, | ||
"dependencies": { | ||
"@firebase/installations": "0.6.18-20250626140224", | ||
"@firebase/logger": "0.4.4", | ||
"@firebase/util": "1.12.1-20250626140224", | ||
"@firebase/component": "0.6.18-20250626140224", | ||
"@firebase/installations": "0.6.18-canary.25b60fdaa", | ||
"@firebase/logger": "0.4.4-canary.25b60fdaa", | ||
"@firebase/util": "1.12.1-canary.25b60fdaa", | ||
"@firebase/component": "0.6.18-canary.25b60fdaa", | ||
"tslib": "^2.1.0" | ||
@@ -52,3 +52,3 @@ }, | ||
"devDependencies": { | ||
"@firebase/app": "0.13.2-20250626140224", | ||
"@firebase/app": "0.13.2-canary.25b60fdaa", | ||
"rollup": "2.79.2", | ||
@@ -55,0 +55,0 @@ "rollup-plugin-dts": "5.3.1", |
Sorry, the diff of this file is not supported yet
511399
-0.37%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed