Skip to content

Commit

Permalink
move to build
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Oct 10, 2023
1 parent de892b2 commit 4c55d20
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions app/services/adapters/web-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,37 +141,6 @@ function loadEmberDebug() {
let minimumVersion = config.emberVersionsSupported[0].replace(/\./g, '-');
let xhr;

/* istanbul ignore next */
function loadEmberDebugInWebpage() {
const waitForEmberLoad = new Promise((resolve) => {
if (window.requireModule) {
const has =
window.requireModule.has ||
function has(id) {
return !!(
window.requireModule.entries[id] ||
window.requireModule.entries[id + '/index']
);
};
if (has('ember')) {
return resolve();
}
}

/**
* NOTE: if the above (for some reason) fails and the consuming app has
* deprecation-workflow's throwOnUnhandled: true
* or set `ember-global`'s handler to 'throw'
* and is using at least `[email protected]`
*
* this will throw an exception in the consuming project
*/
if (window.Ember) return resolve();

window.addEventListener('Ember', resolve, { once: true });
});
waitForEmberLoad.then(() => 'replace-with-ember-debug');
}
return new Promise((resolve) => {
if (!emberDebug) {
xhr = new XMLHttpRequest();
Expand All @@ -183,16 +152,6 @@ function loadEmberDebug() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
emberDebug = xhr.responseText;
// prepare for usage in replace, dollar signs are part of special replacement patterns...
// wrap in curly braces to be usable in arrow function
emberDebug = '{' + emberDebug.replace(/\$/g, '$$$$') + '}';
emberDebug =
'(' +
loadEmberDebugInWebpage
.toString()
// Use regex to support different cases in dev and prod builds
.replace(/['"]replace-with-ember-debug['"];*/, emberDebug) +
')()';
resolve(emberDebug);
}
}
Expand Down

0 comments on commit 4c55d20

Please sign in to comment.