Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unneeded dependencies #129

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { verifyVersions } from "./versions.ts";

const correctMap: { [name: string]: string } = {
"wasm-bindgen": "0.2.91",
"wasm-bindgen-futures": "0.4.41",
"js-sys": "0.3.68",
"web-sys": "0.3.68",
};

Deno.test("should verify when all correct", () => {
Expand Down
8 changes: 0 additions & 8 deletions lib/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@ interface WasmCrate {

export const versions = {
wasmBindgen: "0.2.91",
wasmBindgenFutures: "0.4.41",
jsSys: "0.3.68",
webSys: "0.3.68",
};

export function verifyVersions(crate: WasmCrate) {
verifyVersion(crate, "wasm-bindgen", versions.wasmBindgen);
verifyVersionAllowNone(
crate,
"wasm-bindgen-futures",
versions.wasmBindgenFutures,
);
verifyVersionAllowNone(crate, "js-sys", versions.jsSys);
verifyVersionAllowNone(crate, "web-sys", versions.webSys);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe all of these need to be kept in sync in order to work well with wasm-bindgen?

Copy link
Member

@dsherret dsherret Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these all need to be using the same version of wasm-bindgen (ex. web-sys has a dep on wasm-bindgen https://crates.io/crates/web-sys/0.3.69/dependencies). Them getting out of sync causes problems... the wasm-bindgen-cli enforces these checks IIRC. We should probably add a comment here explaining this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass fine, and I wasn't able to find any occurrences of "web-sys" and "wasm-bingen-futures" anywhere besides the versions files. If my understanding is wrong, fair enough. I'll close the PR 🙂

Copy link
Member

@dsherret dsherret Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be fine to only enforce the wasm-bindgen version and ensure no duplicates of wasm-bindgen in the cargo metadata: rustwasm/wasm-bindgen#2913 (review)

}

function verifyVersionAllowNone(
Expand Down
6 changes: 3 additions & 3 deletions lib/wasmbuild.generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ const imports = {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
},
__wbindgen_object_drop_ref: function (arg0) {
takeObject(arg0);
},
__wbindgen_is_string: function (arg0) {
const ret = typeof (getObject(arg0)) === "string";
return ret;
Expand All @@ -212,6 +209,9 @@ const imports = {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
},
__wbindgen_object_drop_ref: function (arg0) {
takeObject(arg0);
},
__wbindgen_object_clone_ref: function (arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
Expand Down
Binary file modified lib/wasmbuild_bg.wasm
Binary file not shown.