Skip to content

Commit

Permalink
🚮 Clean up ANALYTICS_VENDOR_SPLIT (#26797)
Browse files Browse the repository at this point in the history
* cleanup

* iframeping

* remove flag

* nit & lint

* lint
  • Loading branch information
zhouyx committed Feb 25, 2020
1 parent f9d8e7c commit c66bfa9
Show file tree
Hide file tree
Showing 88 changed files with 32 additions and 6,330 deletions.
28 changes: 23 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"sourceType": "module"
},
"globals": {
"ANALYTICS_VENDOR_SPLIT": "readonly",
"NATIVE_CUSTOM_ELEMENTS_V1": "readonly",
"IS_ESM": "readonly",

Expand Down Expand Up @@ -68,7 +67,12 @@
]
}
],
"jsdoc/check-types": [2, {"noDefaults": true}],
"jsdoc/check-types": [
2,
{
"noDefaults": true
}
],
"jsdoc/require-param": 2,
"jsdoc/require-param-name": 2,
"jsdoc/require-param-type": 2,
Expand Down Expand Up @@ -123,7 +127,12 @@
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-implicit-coercion": [2, {"boolean": false}],
"no-implicit-coercion": [
2,
{
"boolean": false
}
],
"no-implied-eval": 2,
"no-iterator": 2,
"no-lone-blocks": 2,
Expand All @@ -148,7 +157,10 @@
"no-var": 2,
"no-warning-comments": [
2,
{"terms": ["do not submit"], "location": "anywhere"}
{
"terms": ["do not submit"],
"location": "anywhere"
}
],
"notice/notice": [
2,
Expand All @@ -160,7 +172,13 @@
}
}
],
"object-shorthand": [2, "properties", {"avoidQuotes": true}],
"object-shorthand": [
2,
"properties",
{
"avoidQuotes": true
}
],
"prefer-const": 2,
"prettier/prettier": 2,
"radix": 2,
Expand Down
4 changes: 1 addition & 3 deletions build-system/global-configs/experiments-const.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"ANALYTICS_VENDOR_SPLIT": true
}
{}
113 changes: 0 additions & 113 deletions build-system/tasks/generate-vendor-jsons.js

This file was deleted.

3 changes: 0 additions & 3 deletions build-system/tasks/presubmit-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ const forbiddenTerms = {
'build-system/server/routes/analytics.js',
'extensions/amp-analytics/0.1/config.js',
'extensions/amp-analytics/0.1/requests.js',
'extensions/amp-analytics/0.1/vendors.js',
],
},
// Service factories that should only be installed once.
Expand Down Expand Up @@ -664,8 +663,6 @@ const forbiddenTerms = {
'src/web-worker/web-worker.js', // Web worker custom error reporter.
'tools/experiments/experiments.js',
'build-system/server/amp4test.js',
// TODO: @jonathantyng cleanup #22757
'build-system/tasks/generate-vendor-jsons.js',
],
},
'data:image/svg(?!\\+xml;charset=utf-8,)[^,]*,': {
Expand Down
34 changes: 0 additions & 34 deletions extensions/amp-analytics/0.1/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class AnalyticsConfig {
return Promise.all([this.fetchRemoteConfig_(), this.fetchVendorConfig_()])
.then(this.processConfigs_.bind(this))
.then(this.checkWarningMessage_.bind(this))
.then(this.addExperimentParams_.bind(this))
.then(() => this.config_);
}

Expand Down Expand Up @@ -98,10 +97,6 @@ export class AnalyticsConfig {
* @return {!Promise<undefined>}
*/
fetchVendorConfig_() {
if (!ANALYTICS_VENDOR_SPLIT) {
return Promise.resolve();
}

const type = this.element_.getAttribute('type');
if (!type) {
return Promise.resolve();
Expand All @@ -126,35 +121,6 @@ export class AnalyticsConfig {
);
}

/**
* TODO: cleanup #22757 @jonathantyng
* Append special param to pageview request for RC and experiment builds
* for the googleanalytics component. This is to track pageview changes
* in AB experiment
*/
addExperimentParams_() {
const type = this.element_.getAttribute('type');
const rtv = getMode().rtvVersion;
const isRc = rtv ? rtv.substring(0, 2) === '03' : false;

if (
type === 'googleanalytics' &&
(isRc || ANALYTICS_VENDOR_SPLIT) &&
this.config_['requests']
) {
if (this.config_['requests']['pageview']) {
this.config_['requests']['pageview'][
'baseUrl'
] += `&aae=${ANALYTICS_VENDOR_SPLIT}`;
}
if (this.config_['requests']['timing']) {
this.config_['requests']['timing'][
'baseUrl'
] += `&aae=${ANALYTICS_VENDOR_SPLIT}`;
}
}
}

/**
* Returns a promise that resolves when remote config is ready (or
* immediately if no remote config is specified.)
Expand Down
Loading

0 comments on commit c66bfa9

Please sign in to comment.