@atlaspack/runtime-js
Advanced tools
Comparing version 2.12.1-canary.3613 to 2.12.1-canary.3614
@@ -47,13 +47,11 @@ "use strict"; | ||
// eslint-disable-next-line no-undef | ||
return await __parcel__import__(`${url}?t=${Date.now()}`); | ||
const result = await __parcel__import__(`${url}?t=${Date.now()}`); | ||
sendAnalyticsEvent('recovered', url, i); | ||
return result; | ||
} catch (error) { | ||
if (i === maxRetries) throw error; | ||
// Dispatch event for reporting | ||
const event = { | ||
detail: { | ||
target: url, | ||
attempt: i | ||
} | ||
}; | ||
globalThis.dispatchEvent(new CustomEvent('atlaspack:import_retry', event)); | ||
if (i === maxRetries) { | ||
sendAnalyticsEvent('failure', url, i); | ||
throw error; | ||
} | ||
sendAnalyticsEvent('progress', url, i); | ||
} | ||
@@ -65,2 +63,12 @@ } | ||
} | ||
function sendAnalyticsEvent(status, targetUrl, attempt) { | ||
require('./analytics/analytics.js').sendAnalyticsEvent({ | ||
action: 'importRetry', | ||
attributes: { | ||
status, | ||
targetUrl, | ||
attempt | ||
} | ||
}); | ||
} | ||
module.exports = load; |
{ | ||
"name": "@atlaspack/runtime-js", | ||
"version": "2.12.1-canary.3613+d904a75ee", | ||
"version": "2.12.1-canary.3614+c789b2fe4", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -15,14 +15,14 @@ "publishConfig": { | ||
"engines": { | ||
"atlaspack": "2.12.1-canary.3613+d904a75ee", | ||
"atlaspack": "2.12.1-canary.3614+c789b2fe4", | ||
"node": ">= 16.0.0" | ||
}, | ||
"dependencies": { | ||
"@atlaspack/diagnostic": "2.12.1-canary.3613+d904a75ee", | ||
"@atlaspack/domain-sharding": "2.12.1-canary.3613+d904a75ee", | ||
"@atlaspack/feature-flags": "2.12.1-canary.3613+d904a75ee", | ||
"@atlaspack/plugin": "2.12.1-canary.3613+d904a75ee", | ||
"@atlaspack/utils": "2.12.1-canary.3613+d904a75ee", | ||
"@atlaspack/diagnostic": "2.12.1-canary.3614+c789b2fe4", | ||
"@atlaspack/domain-sharding": "2.12.1-canary.3614+c789b2fe4", | ||
"@atlaspack/feature-flags": "2.12.1-canary.3614+c789b2fe4", | ||
"@atlaspack/plugin": "2.12.1-canary.3614+c789b2fe4", | ||
"@atlaspack/utils": "2.12.1-canary.3614+c789b2fe4", | ||
"nullthrows": "^1.1.1" | ||
}, | ||
"gitHead": "d904a75eecaea2c2e62cd8ff18f217057d545fc4" | ||
"gitHead": "c789b2fe40acf04714fbbd27c7851b505e70dff8" | ||
} |
@@ -45,10 +45,11 @@ async function load(id) { | ||
// eslint-disable-next-line no-undef | ||
return await __parcel__import__(`${url}?t=${Date.now()}`); | ||
const result = await __parcel__import__(`${url}?t=${Date.now()}`); | ||
sendAnalyticsEvent('recovered', url, i); | ||
return result; | ||
} catch (error) { | ||
if (i === maxRetries) throw error; | ||
// Dispatch event for reporting | ||
const event = {detail: {target: url, attempt: i}}; | ||
globalThis.dispatchEvent( | ||
new CustomEvent('atlaspack:import_retry', event), | ||
); | ||
if (i === maxRetries) { | ||
sendAnalyticsEvent('failure', url, i); | ||
throw error; | ||
} | ||
sendAnalyticsEvent('progress', url, i); | ||
} | ||
@@ -62,2 +63,13 @@ } | ||
function sendAnalyticsEvent(status, targetUrl, attempt) { | ||
require('./analytics/analytics.js').sendAnalyticsEvent({ | ||
action: 'importRetry', | ||
attributes: { | ||
status, | ||
targetUrl, | ||
attempt, | ||
}, | ||
}); | ||
} | ||
module.exports = load; |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
99391
56
2434