-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Unify wasm-bindgen output under -sWASM_BINDGEN with marker-based detection #27208
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
Merged
sbc100
merged 14 commits into
emscripten-core:main
from
guybedford:wasm-bindgen-unified-flow
Sep 5, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a0be7db
Unify wasm-bindgen output under -sWASM_BINDGEN, add -sWASM_BINDGEN=auto
guybedford b902aee
Address review feedback
guybedford 733d0b1
Resolve WASM_BINDGEN mode and export detection after the initial link
guybedford 012105e
Simplify wasm-bindgen export handling
guybedford 47424ed
rewordings
guybedford 99fe8d6
Fold wasm_bindgen_internal_exports into expected_exports
guybedford e8081bd
Guard _main append on expected_exports
guybedford f764bc9
Make WASM_BINDGEN always detect the marker section, removing the auto…
guybedford da5af2f
Clarify WASM_BINDGEN marker section docs
guybedford d0336e5
Detect the wasm-bindgen marker from linker inputs to avoid relinking
guybedford d60eb0e
Fix ruff lints
guybedford 55adaba
rebaseline fix
guybedford 449f097
Fix ChangeLog entry
guybedford ad4ec93
Use the managed wasm-bindgen CLI in test_wasm_bindgen_tsd_multi_return
guybedford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| [package] | ||
| name = "bindgen_greeter" | ||
| edition = "2021" | ||
|
|
||
| [[bin]] | ||
| name = "bindgen_greeter" | ||
| path = "src/main.rs" | ||
|
|
||
| [dependencies] | ||
| # 0.2.127 is the first release with the emscripten __export/__force attribute | ||
| # support (wasm-bindgen/wasm-bindgen#5253); must match the wasm-bindgen-cli | ||
| # version exactly. | ||
| wasm-bindgen = "0.2.127" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| use wasm_bindgen::prelude::*; | ||
|
|
||
| #[wasm_bindgen] | ||
| pub struct Greeter { | ||
| greeting: String, | ||
| } | ||
|
|
||
| #[wasm_bindgen] | ||
| impl Greeter { | ||
| #[wasm_bindgen(constructor)] | ||
| pub fn new(greeting: String) -> Greeter { | ||
| Greeter { greeting } | ||
| } | ||
|
|
||
| pub fn greet(&self, name: String) -> String { | ||
| format!("{}, {}!", self.greeting, name) | ||
| } | ||
| } | ||
|
|
||
| fn main() { | ||
| // Matches the emscripten idiom: main runs automatically on init. | ||
| println!("main ran"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.