Comparing version 0.80.8 to 0.80.9
{ | ||
"name": "metro", | ||
"version": "0.80.8", | ||
"version": "0.80.9", | ||
"description": "🚇 The JavaScript bundler for React Native.", | ||
@@ -37,14 +37,14 @@ "main": "src/index.js", | ||
"lodash.throttle": "^4.1.1", | ||
"metro-babel-transformer": "0.80.8", | ||
"metro-cache": "0.80.8", | ||
"metro-cache-key": "0.80.8", | ||
"metro-config": "0.80.8", | ||
"metro-core": "0.80.8", | ||
"metro-file-map": "0.80.8", | ||
"metro-resolver": "0.80.8", | ||
"metro-runtime": "0.80.8", | ||
"metro-source-map": "0.80.8", | ||
"metro-symbolicate": "0.80.8", | ||
"metro-transform-plugins": "0.80.8", | ||
"metro-transform-worker": "0.80.8", | ||
"metro-babel-transformer": "0.80.9", | ||
"metro-cache": "0.80.9", | ||
"metro-cache-key": "0.80.9", | ||
"metro-config": "0.80.9", | ||
"metro-core": "0.80.9", | ||
"metro-file-map": "0.80.9", | ||
"metro-resolver": "0.80.9", | ||
"metro-runtime": "0.80.9", | ||
"metro-source-map": "0.80.9", | ||
"metro-symbolicate": "0.80.9", | ||
"metro-transform-plugins": "0.80.9", | ||
"metro-transform-worker": "0.80.9", | ||
"mime-types": "^2.1.27", | ||
@@ -70,4 +70,4 @@ "node-fetch": "^2.2.0", | ||
"jest-snapshot-serializer-raw": "^1.2.0", | ||
"metro-babel-register": "0.80.8", | ||
"metro-memory-fs": "0.80.8", | ||
"metro-babel-register": "0.80.9", | ||
"metro-memory-fs": "0.80.9", | ||
"mock-req": "^0.2.0", | ||
@@ -74,0 +74,0 @@ "mock-res": "^0.6.0", |
@@ -91,3 +91,12 @@ "use strict"; | ||
let fullKey = Buffer.concat([partialKey, Buffer.from(sha1, "hex")]); | ||
const result = await cache.get(fullKey); | ||
let result; | ||
try { | ||
result = await cache.get(fullKey); | ||
} catch (error) { | ||
this._config.reporter.update({ | ||
type: "cache_read_error", | ||
error, | ||
}); | ||
throw error; | ||
} | ||
const data = result | ||
@@ -106,3 +115,8 @@ ? { | ||
} | ||
void cache.set(fullKey, data.result); | ||
cache.set(fullKey, data.result).catch((error) => { | ||
this._config.reporter.update({ | ||
type: "cache_write_error", | ||
error, | ||
}); | ||
}); | ||
return { | ||
@@ -109,0 +123,0 @@ ...data.result, |
@@ -13,4 +13,2 @@ /** | ||
export type GlobalCacheDisabledReason = 'too_many_errors' | 'too_many_misses'; | ||
export interface BundleDetails { | ||
@@ -69,8 +67,8 @@ bundleType: string; | ||
| { | ||
type: 'global_cache_error'; | ||
type: 'cache_read_error'; | ||
error: Error; | ||
} | ||
| { | ||
type: 'global_cache_disabled'; | ||
reason: GlobalCacheDisabledReason; | ||
type: 'cache_write_error'; | ||
error: Error; | ||
} | ||
@@ -77,0 +75,0 @@ | {type: 'transform_cache_reset'} |
@@ -9,4 +9,2 @@ "use strict"; | ||
const path = require("path"); | ||
const GLOBAL_CACHE_DISABLED_MESSAGE_FORMAT = | ||
"The global cache is now disabled because %s"; | ||
const DARK_BLOCK_CHAR = "\u2593"; | ||
@@ -65,21 +63,2 @@ const LIGHT_BLOCK_CHAR = "\u2591"; | ||
} | ||
_logCacheDisabled(reason) { | ||
const format = GLOBAL_CACHE_DISABLED_MESSAGE_FORMAT; | ||
switch (reason) { | ||
case "too_many_errors": | ||
reporting.logWarning( | ||
this.terminal, | ||
format, | ||
"it has been failing too many times." | ||
); | ||
break; | ||
case "too_many_misses": | ||
reporting.logWarning( | ||
this.terminal, | ||
format, | ||
"it has been missing too many consecutive keys." | ||
); | ||
break; | ||
} | ||
} | ||
_logBundleBuildDone(buildID) { | ||
@@ -168,5 +147,2 @@ const progress = this._activeBundles.get(buildID); | ||
break; | ||
case "global_cache_disabled": | ||
this._logCacheDisabled(event.reason); | ||
break; | ||
case "resolver_warning": | ||
@@ -173,0 +149,0 @@ this._logWarning(event.message); |
@@ -59,3 +59,4 @@ "use strict"; | ||
dependencyMapName, | ||
globalPrefix | ||
globalPrefix, | ||
skipRequireRename | ||
) { | ||
@@ -70,3 +71,3 @@ const params = buildParameters( | ||
const ast = t.file(t.program([t.expressionStatement(def)])); | ||
const requireName = renameRequires(ast); | ||
const requireName = skipRequireRename ? "require" : renameRequires(ast); | ||
return { | ||
@@ -73,0 +74,0 @@ ast, |
@@ -44,3 +44,3 @@ "use strict"; | ||
if (result == null) { | ||
throw new Error("invalid asset file path: `${filePath}"); | ||
throw new Error(`invalid asset file path: ${filePath}`); | ||
} | ||
@@ -47,0 +47,0 @@ return result; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
717706
10218
+ Addedmetro-babel-transformer@0.80.9(transitive)
+ Addedmetro-cache@0.80.9(transitive)
+ Addedmetro-cache-key@0.80.9(transitive)
+ Addedmetro-config@0.80.9(transitive)
+ Addedmetro-core@0.80.9(transitive)
+ Addedmetro-file-map@0.80.9(transitive)
+ Addedmetro-minify-terser@0.80.9(transitive)
+ Addedmetro-resolver@0.80.9(transitive)
+ Addedmetro-runtime@0.80.9(transitive)
+ Addedmetro-source-map@0.80.9(transitive)
+ Addedmetro-symbolicate@0.80.9(transitive)
+ Addedmetro-transform-plugins@0.80.9(transitive)
+ Addedmetro-transform-worker@0.80.9(transitive)
+ Addedob1@0.80.9(transitive)
- Removedmetro-babel-transformer@0.80.8(transitive)
- Removedmetro-cache@0.80.8(transitive)
- Removedmetro-cache-key@0.80.8(transitive)
- Removedmetro-config@0.80.8(transitive)
- Removedmetro-core@0.80.8(transitive)
- Removedmetro-file-map@0.80.8(transitive)
- Removedmetro-minify-terser@0.80.8(transitive)
- Removedmetro-resolver@0.80.8(transitive)
- Removedmetro-runtime@0.80.8(transitive)
- Removedmetro-source-map@0.80.8(transitive)
- Removedmetro-symbolicate@0.80.8(transitive)
- Removedmetro-transform-plugins@0.80.8(transitive)
- Removedmetro-transform-worker@0.80.8(transitive)
- Removedob1@0.80.8(transitive)
Updatedmetro-cache@0.80.9
Updatedmetro-cache-key@0.80.9
Updatedmetro-config@0.80.9
Updatedmetro-core@0.80.9
Updatedmetro-file-map@0.80.9
Updatedmetro-resolver@0.80.9
Updatedmetro-runtime@0.80.9
Updatedmetro-source-map@0.80.9
Updatedmetro-symbolicate@0.80.9