refactor: load bytes in deno_graph (#22212)

Upgrades deno_graph to 0.64 where deno_graph is now responsible for
turning bytes into a string. This is in preparation for Wasm modules.
This commit is contained in:
David Sherret 2024-01-31 22:15:22 -05:00 committed by GitHub
parent 830d096b66
commit 4b7c6049ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 325 additions and 637 deletions

View file

@ -528,7 +528,7 @@ impl ModuleRegistry {
);
self.http_cache.set(specifier, headers_map, &[])?;
}
let file = fetch_result?;
let file = fetch_result?.into_text_decoded()?;
let config: RegistryConfigurationJson = serde_json::from_str(&file.source)?;
validate_config(&config)?;
Ok(config.registries)
@ -610,6 +610,8 @@ impl ModuleRegistry {
.file_fetcher
.fetch(&endpoint, PermissionsContainer::allow_all())
.await
.ok()?
.into_text_decoded()
.ok()?;
let documentation: lsp::Documentation =
serde_json::from_str(&file.source).ok()?;
@ -974,6 +976,8 @@ impl ModuleRegistry {
.file_fetcher
.fetch(&specifier, PermissionsContainer::allow_all())
.await
.ok()?
.into_text_decoded()
.ok()?;
serde_json::from_str(&file.source).ok()
}
@ -1037,6 +1041,8 @@ impl ModuleRegistry {
specifier, err
);
})
.ok()?
.into_text_decoded()
.ok()?;
let items: VariableItems = serde_json::from_str(&file.source)
.map_err(|err| {
@ -1073,6 +1079,8 @@ impl ModuleRegistry {
specifier, err
);
})
.ok()?
.into_text_decoded()
.ok()?;
let items: VariableItems = serde_json::from_str(&file.source)
.map_err(|err| {