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

feat: Wasm module support #26668

Merged
merged 14 commits into from
Nov 19, 2024
Merged

feat: Wasm module support #26668

merged 14 commits into from
Nov 19, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Oct 31, 2024

Support for Wasm modules.

Note this implements the standard where the default export is the instance (not the module). The module will come later with source phase imports.

import { add } from "./math.wasm";

console.log(add(1, 2));

Closes #2552

@bartlomieju bartlomieju added this to the 2.1.0 milestone Nov 6, 2024
@dsherret dsherret marked this pull request as ready for review November 19, 2024 22:14
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, fantastic 🚀

@@ -78,7 +78,7 @@ pub fn validate_import_attributes_callback(
for (key, value) in attributes {
let msg = if key != "type" {
Some(format!("\"{key}\" attribute is not supported."))
} else if value != "json" {
} else if value != "json" && value != "$$deno-core-internal-wasm-module" {
Copy link
Member

Choose a reason for hiding this comment

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

I probably should have exported that string in deno_core or handled the validation there.

@dsherret dsherret merged commit 8be2bbf into denoland:main Nov 19, 2024
17 checks passed
@dsherret dsherret deleted the wasm_support branch November 19, 2024 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support importing wasm modules
2 participants