Skip to content

Commit

Permalink
♻️ Remove version from legacy mode object (#35624)
Browse files Browse the repository at this point in the history
* Remove `version` from legacy mode object

* Restore version to mode-object for now

* Remove version entirely

* Lint fixes

* Fix transformer test fixtures

* Fix test
  • Loading branch information
rcebulko committed Aug 12, 2021
1 parent 00b8e7e commit 87d5d14
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const test = getMode().test;
const localDev = getMode().localDev;
const minified = getMode().minified;
const development = getMode().development;
const version = getMode().version;

function foo() {
if (getMode().development == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const test = false;
const localDev = false;
const minified = true;
const development = false;
const version = "$internalRuntimeVersion$";

function foo() {
if (false == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const test = getMode().test;
const localDev = getMode().localDev;
const minified = getMode().minified;
const development = getMode().development;
const version = getMode().version;
const namespaceVersion = mode.version();

function foo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const test = false;
const localDev = false;
const minified = true;
const development = false;
const version = "$internalRuntimeVersion$";
const namespaceVersion = "$internalRuntimeVersion$";

function foo() {
Expand Down
6 changes: 3 additions & 3 deletions extensions/amp-script/0.1/amp-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ export class AmpScript extends AMP.BaseElement {
const folder = mode.isMinified() ? 'current-min' : 'current';
iframeUrl = `/dist.3p/${folder}/amp-script-proxy-iframe.html`;
} else {
iframeUrl = `${urls.thirdParty}/${
getMode().version
}/amp-script-proxy-iframe.html`;
iframeUrl = `${
urls.thirdParty
}/${mode.version()}/amp-script-proxy-iframe.html`;
}

// @see src/main-thread/configuration.WorkerDOMConfiguration in worker-dom.
Expand Down
1 change: 0 additions & 1 deletion src/mode-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function getModeObject(opt_win) {
esm: IS_ESM,
test: getMode(opt_win).test,
log: getMode(opt_win).log,
version: getMode(opt_win).version,
rtvVersion: getMode(opt_win).rtvVersion,
};
}
2 changes: 0 additions & 2 deletions src/mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {parseQueryString} from '#core/types/string/url';
* development: boolean,
* test: boolean,
* log: (string|undefined),
* version: string,
* rtvVersion: string,
* runtime: (null|string|undefined),
* a4aId: (null|string|undefined),
Expand Down Expand Up @@ -76,7 +75,6 @@ function getMode_(win) {
geoOverride: hashQuery['amp-geo'],
test: coreMode.isTest(win),
log: parseInt(hashQuery['log'], 10),
version: coreMode.version(),
rtvVersion: getRtvVersion(win),
};
}
Expand Down
1 change: 0 additions & 1 deletion test/unit/3p/test-3p-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ describes.realWin('3p-frame', {amp: true}, (env) => {
'localDev': true,
'development': false,
'test': false,
'version': '$internalRuntimeVersion$',
'esm': false,
},
'canary': false,
Expand Down

0 comments on commit 87d5d14

Please sign in to comment.