Skip to content

Commit abfa6fb

Browse files
committed
Merge remote-tracking branch 'origin/master' into LimboThrottling
2 parents 545fa89 + bd85150 commit abfa6fb

File tree

112 files changed

+3421
-2615
lines changed

Some content is hidden

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

112 files changed

+3421
-2615
lines changed

integration/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "7.12.0"
10+
"firebase": "7.13.1"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.8.7",

integration/firebase-typings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "tsc"
77
},
88
"dependencies": {
9-
"firebase": "7.12.0"
9+
"firebase": "7.13.1"
1010
},
1111
"devDependencies": {
1212
"typescript": "3.8.3"

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:manual": "mocha --exit"
99
},
1010
"dependencies": {
11-
"firebase": "7.12.0"
11+
"firebase": "7.13.1"
1212
},
1313
"devDependencies": {
1414
"chai": "4.2.0",

integration/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "karma start --single-run"
77
},
88
"dependencies": {
9-
"firebase": "7.12.0"
9+
"firebase": "7.13.1"
1010
},
1111
"devDependencies": {
1212
"@babel/core": "7.8.7",

integration/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "7.12.0"
10+
"firebase": "7.13.1"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.8.7",

packages/analytics-types/index.d.ts

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2019 Google Inc.
3+
* Copyright 2019 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -143,6 +143,13 @@ export interface EventParams {
143143
value?: number;
144144
event_label?: string;
145145
event_category?: string;
146+
shipping_tier?: string;
147+
item_list_id?: string;
148+
item_list_name?: string;
149+
promotion_id?: string;
150+
promotion_name?: string;
151+
payment_type?: string;
152+
affiliation?: string;
146153
}
147154

148155
/**
@@ -158,6 +165,7 @@ export interface CustomParams {
158165
*/
159166
export type EventNameString =
160167
| 'add_payment_info'
168+
| 'add_shipping_info'
161169
| 'add_to_cart'
162170
| 'add_to_wishlist'
163171
| 'begin_checkout'
@@ -172,10 +180,13 @@ export type EventNameString =
172180
| 'screen_view'
173181
| 'search'
174182
| 'select_content'
183+
| 'select_item'
184+
| 'select_promotion'
175185
| 'set_checkout_option'
176186
| 'share'
177187
| 'sign_up'
178188
| 'timing_complete'
189+
| 'view_cart'
179190
| 'view_item'
180191
| 'view_item_list'
181192
| 'view_promotion'
@@ -184,17 +195,39 @@ export type EventNameString =
184195
export type Currency = string | number;
185196

186197
export interface Item {
187-
brand?: string;
188-
category?: string;
198+
item_id?: string;
199+
item_name?: string;
200+
item_brand?: string;
201+
item_category?: string;
202+
item_category2?: string;
203+
item_category3?: string;
204+
item_category4?: string;
205+
item_category5?: string;
206+
item_variant?: string;
207+
price?: Currency;
208+
quantity?: number;
209+
index?: number;
210+
coupon?: string;
211+
item_list_name?: string;
212+
item_list_id?: string;
213+
discount?: Currency;
214+
affiliation?: string;
189215
creative_name?: string;
190216
creative_slot?: string;
191-
id?: string;
217+
promotion_id?: string;
218+
promotion_name?: string;
192219
location_id?: string;
220+
/** @deprecated Use item_brand instead. */
221+
brand?: string;
222+
/** @deprecated Use item_category instead. */
223+
category?: string;
224+
/** @deprecated Use item_id instead. */
225+
id?: string;
226+
/** @deprecated Use item_name instead. */
193227
name?: string;
194-
price?: Currency;
195-
quantity?: number;
196228
}
197229

230+
/** @deprecated Use Item instead. */
198231
export interface Promotion {
199232
creative_name?: string;
200233
creative_slot?: string;

packages/analytics-types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/analytics-types",
3-
"version": "0.2.8",
3+
"version": "0.3.0",
44
"description": "@firebase/analytics Types",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",

packages/analytics/index.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ describe('FirebaseAnalytics instance tests', () => {
6464
resetGlobalVars();
6565
app = getFakeApp(analyticsId);
6666
fidDeferred = new Deferred<void>();
67-
const installations = getFakeInstallations('fid-1234', () => fidDeferred.resolve());
67+
const installations = getFakeInstallations('fid-1234', () =>
68+
fidDeferred.resolve()
69+
);
6870

6971
window['gtag'] = gtagStub;
7072
window['dataLayer'] = [];
@@ -132,7 +134,9 @@ describe('FirebaseAnalytics instance tests', () => {
132134
resetGlobalVars();
133135
const app = getFakeApp(analyticsId);
134136
fidDeferred = new Deferred<void>();
135-
const installations = getFakeInstallations('fid-1234', () => fidDeferred.resolve());
137+
const installations = getFakeInstallations('fid-1234', () =>
138+
fidDeferred.resolve()
139+
);
136140
window[customGtagName] = gtagStub;
137141
window[customDataLayerName] = [];
138142
analyticsSettings({

packages/analytics/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import '@firebase/installations';
1919
import { FirebaseAnalytics } from '@firebase/analytics-types';
2020
import { FirebaseAnalyticsInternal } from '@firebase/analytics-interop-types';
2121
import { _FirebaseNamespace } from '@firebase/app-types/private';
22-
import { factory, settings, resetGlobalVars, getGlobalVars } from './src/factory';
22+
import {
23+
factory,
24+
settings,
25+
resetGlobalVars,
26+
getGlobalVars
27+
} from './src/factory';
2328
import { EventName } from './src/constants';
2429
import {
2530
Component,

packages/analytics/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/analytics",
3-
"version": "0.2.18",
3+
"version": "0.3.0",
44
"description": "A analytics package for new firebase packages",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.cjs.js",
@@ -13,6 +13,7 @@
1313
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1414
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1515
"build": "rollup -c",
16+
"build:deps": "lerna run --scope @firebase/'{app,analytics}' --include-dependencies build",
1617
"dev": "rollup -c -w",
1718
"test": "yarn type-check && yarn run-p lint test:browser",
1819
"test:browser": "karma start --single-run --nocache",
@@ -24,7 +25,7 @@
2425
"@firebase/app-types": "0.x"
2526
},
2627
"dependencies": {
27-
"@firebase/analytics-types": "0.2.8",
28+
"@firebase/analytics-types": "0.3.0",
2829
"@firebase/installations": "0.4.6",
2930
"@firebase/logger": "0.2.0",
3031
"@firebase/util": "0.2.43",

packages/analytics/src/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ export enum GtagCommand {
3434
* Any other string is also allowed.
3535
*/
3636
export enum EventName {
37+
ADD_SHIPPING_INFO = 'add_shipping_info',
3738
ADD_PAYMENT_INFO = 'add_payment_info',
3839
ADD_TO_CART = 'add_to_cart',
3940
ADD_TO_WISHLIST = 'add_to_wishlist',
4041
BEGIN_CHECKOUT = 'begin_checkout',
42+
/** @deprecated */
4143
CHECKOUT_PROGRESS = 'checkout_progress',
4244
EXCEPTION = 'exception',
4345
GENERATE_LEAD = 'generate_lead',
@@ -49,10 +51,14 @@ export enum EventName {
4951
SCREEN_VIEW = 'screen_view',
5052
SEARCH = 'search',
5153
SELECT_CONTENT = 'select_content',
54+
SELECT_ITEM = 'select_item',
55+
SELECT_PROMOTION = 'select_promotion',
56+
/** @deprecated */
5257
SET_CHECKOUT_OPTION = 'set_checkout_option',
5358
SHARE = 'share',
5459
SIGN_UP = 'sign_up',
5560
TIMING_COMPLETE = 'timing_complete',
61+
VIEW_CART = 'view_cart',
5662
VIEW_ITEM = 'view_item',
5763
VIEW_ITEM_LIST = 'view_item_list',
5864
VIEW_PROMOTION = 'view_promotion',

packages/analytics/src/factory.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export function resetGlobalVars(
8888
/**
8989
* For testing
9090
*/
91-
export function getGlobalVars(): { initializedIdPromisesMap: { [gaId: string]: Promise<void> }} {
91+
export function getGlobalVars(): {
92+
initializedIdPromisesMap: { [gaId: string]: Promise<void> };
93+
} {
9294
return {
9395
initializedIdPromisesMap
9496
};

packages/analytics/src/helpers.test.ts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ describe('FirebaseAnalytics methods', () => {
8383
const initPromise1 = new Deferred<void>();
8484
const initPromise2 = new Deferred<void>();
8585
wrapOrCreateGtag(
86-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
86+
{
87+
[mockAnalyticsId]: initPromise1.promise,
88+
otherId: initPromise2.promise
89+
},
8790
'dataLayer',
8891
'gtag'
8992
);
@@ -110,7 +113,10 @@ describe('FirebaseAnalytics methods', () => {
110113
const initPromise1 = new Deferred<void>();
111114
const initPromise2 = new Deferred<void>();
112115
wrapOrCreateGtag(
113-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
116+
{
117+
[mockAnalyticsId]: initPromise1.promise,
118+
otherId: initPromise2.promise
119+
},
114120
'dataLayer',
115121
'gtag'
116122
);
@@ -138,7 +144,10 @@ describe('FirebaseAnalytics methods', () => {
138144
const initPromise1 = new Deferred<void>();
139145
const initPromise2 = new Deferred<void>();
140146
wrapOrCreateGtag(
141-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
147+
{
148+
[mockAnalyticsId]: initPromise1.promise,
149+
otherId: initPromise2.promise
150+
},
142151
'dataLayer',
143152
'gtag'
144153
);
@@ -165,7 +174,10 @@ describe('FirebaseAnalytics methods', () => {
165174
const initPromise1 = new Deferred<void>();
166175
const initPromise2 = new Deferred<void>();
167176
wrapOrCreateGtag(
168-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
177+
{
178+
[mockAnalyticsId]: initPromise1.promise,
179+
otherId: initPromise2.promise
180+
},
169181
'dataLayer',
170182
'gtag'
171183
);
@@ -249,7 +261,10 @@ describe('FirebaseAnalytics methods', () => {
249261
const initPromise1 = new Deferred<void>();
250262
const initPromise2 = new Deferred<void>();
251263
wrapOrCreateGtag(
252-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
264+
{
265+
[mockAnalyticsId]: initPromise1.promise,
266+
otherId: initPromise2.promise
267+
},
253268
'dataLayer',
254269
'gtag'
255270
);
@@ -278,7 +293,10 @@ describe('FirebaseAnalytics methods', () => {
278293
const initPromise1 = new Deferred<void>();
279294
const initPromise2 = new Deferred<void>();
280295
wrapOrCreateGtag(
281-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
296+
{
297+
[mockAnalyticsId]: initPromise1.promise,
298+
otherId: initPromise2.promise
299+
},
282300
'dataLayer',
283301
'gtag'
284302
);
@@ -312,7 +330,10 @@ describe('FirebaseAnalytics methods', () => {
312330
const initPromise1 = new Deferred<void>();
313331
const initPromise2 = new Deferred<void>();
314332
wrapOrCreateGtag(
315-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
333+
{
334+
[mockAnalyticsId]: initPromise1.promise,
335+
otherId: initPromise2.promise
336+
},
316337
'dataLayer',
317338
'gtag'
318339
);
@@ -342,7 +363,10 @@ describe('FirebaseAnalytics methods', () => {
342363
const initPromise1 = new Deferred<void>();
343364
const initPromise2 = new Deferred<void>();
344365
wrapOrCreateGtag(
345-
{ [mockAnalyticsId]: initPromise1.promise, otherId: initPromise2.promise },
366+
{
367+
[mockAnalyticsId]: initPromise1.promise,
368+
otherId: initPromise2.promise
369+
},
346370
'dataLayer',
347371
'gtag'
348372
);

packages/analytics/testing/get-fake-firebase-services.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export function getFakeInstallations(
4545
onFidResolve?: Function
4646
): FirebaseInstallations {
4747
return {
48-
getId: async () => { onFidResolve && onFidResolve(); return fid; },
48+
getId: async () => {
49+
onFidResolve && onFidResolve();
50+
return fid;
51+
},
4952
getToken: async () => 'authToken',
5053
onIdChange: () => () => undefined,
5154
delete: async () => undefined

packages/app/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import { isNode, isBrowser } from '@firebase/util';
2121
import { logger } from './src/logger';
2222
import { registerCoreComponents } from './src/registerCoreComponents';
2323

24-
// Firebase Lite detection
24+
// Firebase Lite detection test
2525
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2626
if (isBrowser() && (self as any).firebase !== undefined) {
2727
logger.warn(`

packages/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1818
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1919
"build": "rollup -c",
20+
"build:deps": "lerna run --scope @firebase/app --include-dependencies build",
2021
"dev": "rollup -c -w",
2122
"test": "yarn type-check && run-p lint test:browser test:node",
2223
"type-check": "tsc -p . --noEmit",

packages/app/src/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const ERRORS: ErrorMap<AppError> = {
3636
[AppError.INVALID_APP_ARGUMENT]:
3737
'firebase.{$appName}() takes either no argument or a ' +
3838
'Firebase App instance.',
39-
[AppError.INVALID_LOG_ARGUMENT]: 'First argument to `onLog` must be null or a function.'
39+
[AppError.INVALID_LOG_ARGUMENT]:
40+
'First argument to `onLog` must be null or a function.'
4041
};
4142

4243
type ErrorParams = { [key in AppError]: { appName: string } };

0 commit comments

Comments
 (0)