[PR #991] [MERGED] #wg-wasm tips #1844

Closed
opened 2026-03-16 02:29:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/991
Author: @moshevds
Created: 1/13/2020
Status: Merged
Merged: 1/14/2020
Merged by: @bluejekyll

Base: masterHead: wg-wasm-tips


📝 Commits (2)

  • ade768b Simply use "wasm-bindgen" as the feature name.
  • 990f3ed Wrap the error for wasm-bindgen in a js_sys::Error.

📊 Changes

3 files changed (+7 additions, -5 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/proto/Cargo.toml (+3 -2)
📝 crates/proto/src/error.rs (+3 -3)

📄 Description

As I mentioned on discord, I asked on #wg-wasm about the proper way to do the previous change. I received 2 tips:

  • Using "wasm-bindgen" as the feature name is the most straight-forward for users, but it requires renaming the dependency.
  • Directly returning a JS string as an error result is considered bad practice. js_sys::Error is provided for this purpose, just like one would do it in Javascript.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/991 **Author:** [@moshevds](https://github.com/moshevds) **Created:** 1/13/2020 **Status:** ✅ Merged **Merged:** 1/14/2020 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `master` ← **Head:** `wg-wasm-tips` --- ### 📝 Commits (2) - [`ade768b`](https://github.com/hickory-dns/hickory-dns/commit/ade768b2415870f91335dffbe1141da8b8974272) Simply use "wasm-bindgen" as the feature name. - [`990f3ed`](https://github.com/hickory-dns/hickory-dns/commit/990f3edd9322601a46eaa56caf8b083f612b8428) Wrap the error for wasm-bindgen in a js_sys::Error. ### 📊 Changes **3 files changed** (+7 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/proto/Cargo.toml` (+3 -2) 📝 `crates/proto/src/error.rs` (+3 -3) </details> ### 📄 Description As I mentioned on discord, I asked on #wg-wasm about the proper way to do the previous change. I received 2 tips: - Using "wasm-bindgen" as the feature name is the most straight-forward for users, but it requires renaming the dependency. - Directly returning a JS string as an error result is considered bad practice. js_sys::Error is provided for this purpose, just like one would do it in Javascript. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 02:29:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#1844
No description provided.