Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
fix: Fix memory issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 21, 2023
1 parent 148d4ef commit 9139fe6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.4.1

#### 🐞 Fixes

- Potentially fixed a WASM memory issue.

## 0.4.0

#### 🚀 Updates
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/node-depman/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node_depman_plugin"
version = "0.4.0"
version = "0.4.1"
edition = "2021"
license = "MIT"
publish = false
Expand Down
10 changes: 4 additions & 6 deletions crates/node-depman/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,16 @@ pub fn load_versions(Json(input): Json<LoadVersionsInput>) -> FnResult<Json<Load
Ok(())
};

map_output(fetch_url_with_cache(format!(
map_output(fetch_url(format!(
"https://registry.npmjs.org/{}/",
package_name
))?)?;

// Yarn is managed by 2 different packages, so we need to request versions from both of them!
if manager.is_yarn_berry(&input.initial) {
map_output(fetch_url_with_cache("https://registry.npmjs.org/yarn/")?)?;
map_output(fetch_url("https://registry.npmjs.org/yarn/")?)?;
} else if manager.is_yarn_classic(&input.initial) {
map_output(fetch_url_with_cache(
"https://registry.npmjs.org/@yarnpkg/cli-dist/",
)?)?;
map_output(fetch_url("https://registry.npmjs.org/@yarnpkg/cli-dist/")?)?;
}

output
Expand All @@ -239,7 +237,7 @@ pub fn resolve_version(
// version that comes bundled with the current Node.js version.
if input.initial == "bundled" {
let response: Vec<NodeDistVersion> =
fetch_url_with_cache("https://nodejs.org/download/release/index.json")?;
fetch_url("https://nodejs.org/download/release/index.json")?;
let mut found_version = false;

// Infer from proto's environment variable
Expand Down
2 changes: 1 addition & 1 deletion crates/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node_plugin"
version = "0.4.0"
version = "0.4.1"
edition = "2021"
license = "MIT"
publish = false
Expand Down
4 changes: 2 additions & 2 deletions crates/node/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub fn download_prebuilt(
// When canary, extract the latest version from the index
if version == "canary" {
let response: Vec<NodeDistVersion> =
fetch_url_with_cache("https://nodejs.org/download/nightly/index.json")?;
fetch_url("https://nodejs.org/download/nightly/index.json")?;

host = "https://nodejs.org/download/nightly".into();
version = response[0].version.strip_prefix('v').unwrap().to_owned();
Expand Down Expand Up @@ -128,7 +128,7 @@ pub fn locate_bins(Json(_): Json<LocateBinsInput>) -> FnResult<Json<LocateBinsOu
pub fn load_versions(Json(_): Json<LoadVersionsInput>) -> FnResult<Json<LoadVersionsOutput>> {
let mut output = LoadVersionsOutput::default();
let response: Vec<NodeDistVersion> =
fetch_url_with_cache("https://nodejs.org/download/release/index.json")?;
fetch_url("https://nodejs.org/download/release/index.json")?;

for (index, item) in response.iter().enumerate() {
let version = Version::parse(&item.version[1..])?;
Expand Down

0 comments on commit 9139fe6

Please sign in to comment.