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

Support non-browser WASM #1147

Merged
merged 7 commits into from
Feb 28, 2023
Merged

Support non-browser WASM #1147

merged 7 commits into from
Feb 28, 2023

Conversation

tyranron
Copy link
Member

Resolved #1118

Synopsis

From #1118:

When compiling projects targeting wasm32-unknown-unknown, dependencies on wbindgen are emitted in the wasm file.

(import "__wbindgen_placeholder__" "__wbindgen_describe" (func $_ZN12wasm_bindgen19__wbindgen_describe17hd0bb5db14a487f56E (type $t0)))
(import "__wbindgen_placeholder__" "__wbindgen_throw" (func $_ZN12wasm_bindgen16__wbindgen_throw17h1f7ec3f048b25bd4E (type $t10)))
(import "__wbindgen_externref_xform__" "__wbindgen_externref_table_grow" (func $_ZN12wasm_bindgen9externref31__wbindgen_externref_table_grow17h23c6ebadcc732f10E (type $t1)))
(import "__wbindgen_externref_xform__" "__wbindgen_externref_table_set_null" (func $_ZN12wasm_bindgen9externref35__wbindgen_externref_table_set_null17h8f133612ea24d34dE (type $t0)))

In a non-browser environment, these dependencies will not be supported. A non-browser environment is a substantial use case for a graphql server (perhaps more than a browser environment), and should be supported.

Solution

Enable support for js-sys behind a js Cargo feature only.

@tyranron tyranron added enhancement Improvement of existing features or bugfix k::dependencies Pull requests that update a dependency file rust Related to Rust specifically labels Feb 27, 2023
@tyranron tyranron added this to the 0.16.0 milestone Feb 27, 2023
@tyranron tyranron self-assigned this Feb 27, 2023
@tyranron tyranron merged commit 7e5c881 into master Feb 28, 2023
@tyranron tyranron deleted the 1118-non-browser-wasm branch February 28, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::dependencies Pull requests that update a dependency file rust Related to Rust specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wasm32-unknown-unknown support in non-browser environment
1 participant